OpenAI ChatKit icon

OpenAI ChatKit

Talk to Agent Builder workflows through the ChatKit beta.

Message → Send Message

AI-generated

Overview

This node interacts with the OpenAI 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 conversations with AI agents, continuing existing threads, and customizing message roles and metadata. For example, it can be used to integrate AI-driven chatbots into workflows, enabling dynamic and context-aware interactions.

Use Case Examples

  1. Create a new chat session for a specific workflow and user, then send a message as a user role to start a conversation.
  2. Refresh an existing chat session to extend its validity before sending additional messages.
  3. Send a message with system-level instructions and metadata to guide the AI assistant's response.
  4. Continue an existing conversation thread by providing a thread ID when sending a message.

Properties

Name Meaning
Session Source Choose whether to reuse the stored session or supply credentials explicitly.
Session ID Session identifier returned by ChatKit, required if providing credentials manually.
Client Secret Client secret returned when creating or refreshing the session, required if providing credentials manually.
Workflow ID Override the workflow ID associated with the stored session or specify the workflow to target when sending a message.
Thread ID Provide a thread ID to continue an existing conversation thread; leave empty to start a new thread.
Role Role attached to the outgoing message, such as user, assistant, or system.
Message Text The content of the message to be delivered to the workflow.
System Prompt Optional system-level instructions appended to the message.
Message Metadata (JSON) Optional JSON metadata forwarded with the message.
Timeout (ms) Maximum time to wait for the ChatKit API response, in milliseconds.

Output

JSON

  • workflowId - The workflow ID associated with the session or message.
  • session
    • id - The session identifier used for the chat session.
    • client_secret - The client secret for the session, partially masked for security.
    • expires_at - The expiration timestamp of the session, if available.
  • raw - The raw response data from the ChatKit API.
  • message - Confirmation message when ending a session.

Dependencies

  • Requires an API key credential for OpenAI ChatKit API access.

Troubleshooting

  • Ensure the Workflow ID is provided when creating a session or sending a message; missing this will cause errors.
  • If providing manual session credentials, both Session ID and Client Secret must be supplied.
  • Check that the ChatKit API base URL is valid and includes the protocol (e.g., https://).
  • Handle JSON parsing errors in metadata or session options inputs by ensuring valid JSON objects are provided.
  • If the node throws errors about missing session data, create or refresh a session first before sending messages.

Links

Discussion