Actions20
- Assistant Actions
- Embedding Actions
- File Actions
- Report Actions
- Text Actions
- Thread Actions
Overview
The "Add Message" operation of the Thread resource in this OpenAI Analytics node allows users to add a new message to an existing conversation thread. This is useful for building or continuing multi-turn conversations with an assistant or chatbot managed via OpenAI's API. Users can specify the role of the message author (currently only "User" is supported), the content of the message, and optionally attach files by their IDs.
Practical scenarios include:
- Adding user input messages to an ongoing chat session.
- Appending additional context or information to a conversation thread.
- Attaching relevant files to messages for richer interaction.
This operation facilitates dynamic conversation management within workflows that integrate OpenAI assistants.
Properties
Name | Meaning |
---|---|
Authentication | Choose which credentials to use: either dedicated OpenAI Analytics API credentials or existing OpenAI API credentials. |
Thread ID | The unique identifier of the thread to which the message will be added. |
Message Role | The role of the message author; currently only "User" is supported, indicating a user-created message. |
Message Content | The textual content of the message to add to the thread. |
File IDs | Optional comma-separated list of file IDs to attach to the message. |
Output
The node outputs the result of adding the message to the thread as JSON data. The exact structure depends on the underlying API response but typically includes details about the updated thread or confirmation of the message addition.
If any files are attached, the node handles them by referencing their IDs; binary data handling is not explicitly described for this operation.
Dependencies
- Requires valid API authentication credentials for OpenAI services, either through dedicated OpenAI Analytics API credentials or standard OpenAI API credentials.
- The node internally uses the OpenAI SDK client initialized with these credentials.
- No additional external dependencies are required beyond the OpenAI API access.
Troubleshooting
- Invalid Thread ID: If the provided thread ID does not exist or is malformed, the operation will fail. Ensure the thread ID is correct and corresponds to an existing thread.
- Missing Required Parameters: The operation requires
Thread ID
,Message Role
, andMessage Content
. Omitting any of these will cause errors. - Authentication Errors: Incorrect or expired API keys will prevent successful requests. Verify that the credentials are valid and have necessary permissions.
- File Attachment Issues: Providing invalid or inaccessible file IDs may cause failures or ignored attachments. Confirm that file IDs are correct and accessible.
- Unsupported Message Roles: Currently, only the "User" role is supported for messages. Using other roles may lead to errors or unexpected behavior.
To resolve errors, check parameter values, ensure proper authentication setup, and consult API documentation for thread and message management.
Links and References
- OpenAI API Documentation
- OpenAI Chat Completion API
- n8n Documentation on Creating Custom Nodes
Note: Internal credential names and implementation details have been generalized to comply with best practices.