Actions8
- Session Actions
- Message Actions
Message → Refresh
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, as well as sending messages within those sessions. This is useful for automating conversations with AI workflows, maintaining session state, and continuing conversations in threads.
Use Case Examples
- Create a new chat session for a specific workflow to start interacting with an AI agent.
- Refresh an existing chat session to extend its validity without creating a new one.
- Send a message to an AI workflow, optionally continuing a conversation thread or providing system-level instructions.
- End a stored chat session to clear session data locally.
Properties
| Name | Meaning |
|---|---|
| Resource | The type of resource to interact with, either a chat session or a message. |
| 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 during creation. |
| Session Metadata (JSON) | Optional JSON object with metadata forwarded to the workflow during session creation. |
| Session Options (JSON) | Optional advanced session options in JSON format, e.g., expiration overrides. |
| 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 if providing manual credentials. |
| Client Secret | Client secret returned when creating or refreshing the session, required if providing manual credentials. |
| Thread ID | Optional thread identifier to continue an existing conversation thread when sending a message. |
| Role | Role attached to the outgoing message (user, assistant, or system). |
| Message Text | Content of the message sent 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 targeted Agent Builder workflow.sessionid- The chat session identifier.client_secret- The client secret for the chat session, partially masked for security.expires_at- Expiration timestamp of the chat session, if available.
raw- Raw response data from the ChatKit API, useful for debugging or extended information.
Dependencies
- OpenAI ChatKit API
Troubleshooting
- Ensure that the OpenAI ChatKit API credentials are correctly configured and include a valid API key.
- When creating a session, the Workflow ID must be provided; otherwise, the node throws an error.
- If refreshing a session, a stored session must exist; otherwise, an error prompts to create a session first.
- When sending a message with manual credentials, both Session ID and Client Secret must be provided.
- Timeout errors may occur if the ChatKit API does not respond within the specified timeout period; increase the timeout if needed.
Links
- OpenAI ChatKit Documentation - Official documentation for the OpenAI ChatKit API and usage guidelines.