Actions8
- Session Actions
- Message Actions
Session → End (Local)
AI-generatedOverview
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 locally, as well as sending messages to a workflow using stored or manual session credentials. This node is useful for automating chat interactions with AI workflows, such as customer support bots or conversational agents.
Use Case Examples
- Create a new chat session for a specific workflow to start a conversation.
- Refresh an existing chat session to extend its validity.
- End a stored chat session locally to clear session data.
- Send a message to a workflow using either a stored session or manual session credentials.
Properties
| Name | Meaning |
|---|---|
| Resource | The type of resource to interact with, either 'Session' or 'Message'. |
| Operation | The specific action to perform on the selected resource. |
| Workflow ID | The identifier of the Agent Builder workflow to target (required for creating sessions and sending messages). |
| User ID | Optional user identifier to bind to the session when creating a session. |
| Session Metadata (JSON) | Optional JSON object with metadata forwarded to the workflow during session creation. |
| Session Options (JSON) | Optional advanced session options such as expiration overrides during session creation. |
| Session Source | Choose whether to use a stored session or provide session credentials manually when sending a message. |
| Session ID | Session identifier returned by ChatKit, required when providing manual credentials for sending messages. |
| Client Secret | Client secret returned when creating or refreshing the session, required when providing manual credentials for sending messages. |
| Thread ID | Optional thread ID to continue an existing conversation when sending a message. |
| Role | Role attached to the outgoing message (user, assistant, or system). |
| Message Text | The content of the message to send 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 when sending a message. |
Output
JSON
workflowId- The ID of the workflow associated with the session or message.sessionid- The session identifier returned by ChatKit.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 API response data from ChatKit, useful for debugging or further processing.message- Confirmation message when ending a session locally.
Dependencies
- OpenAI ChatKit API
Troubleshooting
- Error 'No ChatKit session stored' indicates that a session must be created or provided before performing operations that require it. Create a session first or provide manual credentials.
- Errors related to missing 'Workflow ID' or 'Message Text' indicate required parameters are not set; ensure these are provided in the node configuration.
- Invalid JSON errors occur if session metadata, session options, or message metadata are not valid JSON strings; verify JSON formatting before input.
- API request failures may occur due to invalid API keys, incorrect base URL, or network issues; verify credentials and network connectivity.
- If the session creation or refresh response does not include 'id' or 'client_secret', the operation will fail; ensure the API is responding correctly and credentials are valid.
Links
- OpenAI ChatKit Documentation - Official documentation for the OpenAI ChatKit API used by this node.