Actions20
- Assistant Actions
- Embedding Actions
- File Actions
- Report Actions
- Text Actions
- Thread Actions
Thread → Run Thread
AI-generatedOverview
The "Run Thread" operation in the OpenAI Analytics node allows you to execute a conversation thread with a selected AI assistant. This operation sends a request to run a specific thread identified by its ID, optionally overriding system instructions and controlling whether to wait for the completion of the run. It is useful for automating interactions with AI assistants where you want to trigger or continue a conversation thread programmatically.
Common scenarios include:
- Running an existing conversation thread to get updated responses.
- Automating workflows that depend on AI-generated content from a specific assistant.
- Integrating AI assistants into business processes where threads represent ongoing dialogues or tasks.
Practical example:
- You have a support assistant configured as a thread. Using this operation, you can run the thread with new input or context and retrieve the assistant’s response automatically within your workflow.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between using dedicated OpenAI Analytics API credentials or existing OpenAI API credentials. |
| Thread ID | The unique identifier of the thread to run. |
| Select Assistant | Method to select the assistant: either from a list of available assistants or by entering an ID. |
| Assistant | If selecting from list, choose the assistant to use for this run. |
| Assistant ID | If selecting by ID, enter the assistant's ID to use for the run. |
| Wait for Completion | Whether to wait until the thread run completes before returning the result (true/false). |
| Maximum Poll Time (Seconds) | Maximum time in seconds to wait for the run to complete if waiting for completion is enabled. |
| Instructions | Optional override for the default system instructions of the assistant during this run. |
| Simplify Output | Whether to return the response in a simplified format (true/false). |
Output
The output JSON contains the results of running the specified thread with the chosen assistant. Depending on the "Simplify Output" setting, the response may be returned in a simplified or detailed format.
- The
jsonfield includes the run results such as messages generated by the assistant, status information, and any metadata related to the thread execution. - If binary data were involved (not typical for this operation), it would be included accordingly, but this operation primarily deals with JSON conversational data.
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 to communicate with the OpenAI API endpoints.
- Proper configuration of API keys and optional organization IDs or base URLs is necessary in n8n credentials settings.
Troubleshooting
Common issues:
- Invalid or missing thread ID: Ensure the thread ID provided exists and is correct.
- Assistant not found or invalid assistant ID: Verify the assistant selection method and the assistant ID.
- API authentication errors: Check that the API key credentials are correctly set up and have required permissions.
- Timeout waiting for completion: If the run takes longer than the maximum poll time, consider increasing the timeout or disabling waiting for completion.
Error messages:
"Unsupported resource: thread": Occurs if the resource parameter is incorrect; ensure "thread" is selected.- Credential loading errors: Indicate misconfiguration or missing API keys; verify credential setup.
- Assistant loading errors: May indicate no assistants available or permission issues; check assistant availability.
Links and References
This summary is based solely on static analysis of the provided source code and property definitions without runtime execution.