OpenAI ChatKit icon

OpenAI ChatKit

Talk to Agent Builder workflows through the ChatKit beta.

Message → Create

AI-generated

Overview

This node integrates with OpenAI's ChatKit API to manage chat sessions and send messages to Agent Builder workflows. It supports creating, refreshing, and ending chat sessions, as well as sending messages within those sessions. This node is useful for automating conversational workflows, enabling chatbots, or integrating AI-driven chat capabilities into applications.

Use Case Examples

  1. Create a new chat session for a specific workflow to start a conversation.
  2. Send a message to an existing chat session, optionally continuing a thread or adding system prompts.
  3. Refresh a stored chat session to extend its validity.
  4. End a stored chat session to clear credentials locally.

Properties

Name Meaning
Resource Specifies the type of operation: managing sessions or sending messages.
Operation The specific action to perform on the selected resource.
Workflow ID Identifier of the Agent Builder workflow to target (required for session creation and message sending).
User ID Optional user identifier to bind to the session (session creation only).
Session Metadata (JSON) Optional JSON object with metadata forwarded to the workflow (session creation only).
Session Options (JSON) Optional advanced session options in JSON format, e.g., expiration overrides (session creation only).
Session Source Choose whether to reuse a stored session or provide session credentials manually (message sending only).
Session ID Session identifier returned by ChatKit, required if providing manual credentials (message sending only).
Client Secret Client secret returned when creating or refreshing the session, required if providing manual credentials (message sending only).
Thread ID Optional thread ID to continue an existing conversation (message sending only).
Role Role attached to the outgoing message (user, assistant, or system).
Message Text Content of the message delivered to the workflow (required for sending messages).
System Prompt Optional system-level instructions appended to the message (message sending only).
Message Metadata (JSON) Optional JSON metadata forwarded with the message (message sending only).
Timeout (ms) Maximum time to wait for the ChatKit API response (message sending only).

Output

JSON

  • workflowId - The ID of the workflow associated with the session or message.
  • session
    • id - The session identifier returned by ChatKit.
    • client_secret - The client secret for the session, partially obfuscated for security.
    • expires_at - Expiration timestamp of the session, if available.
  • raw - The raw API response data from ChatKit, including full session or message details.
  • message - Confirmation message when ending a session.

Dependencies

  • OpenAI ChatKit API

Troubleshooting

  • Ensure the Workflow ID is provided when creating a session or sending a message; missing this will cause errors.
  • When providing manual session credentials, both Session ID and Client Secret must be supplied.
  • Session creation and refresh responses must include session ID and client secret; if missing, the node throws an error.
  • Invalid JSON in metadata or options fields will cause parsing errors; ensure valid JSON format.
  • The base URL for the ChatKit API must include the protocol (e.g., https://) to avoid URL errors.

Links

Discussion