Actions13
Overview
The node "FastGPT" provides an AI-powered customer service chat platform. It enables users to send conversational messages within a session (chat) and receive AI-generated responses. This node is useful for automating customer support interactions, building chatbots, or integrating AI-driven dialogue systems into workflows.
Typical use cases include:
- Handling customer inquiries automatically via AI chat.
- Maintaining conversation context through session IDs.
- Customizing conversations with system/user/assistant roles.
- Passing additional variables to influence the AI response.
- Simplifying output for easier downstream processing.
For example, a user can input a session ID and a list of messages representing a conversation history, then get an AI-generated reply that continues the dialogue.
Properties
| Name | Meaning |
|---|---|
| 会话ID (chatId) | The unique identifier for the chat session. Used to maintain conversation context across requests. |
| 对话消息 (prompt) | A collection of messages forming the conversation. Each message has a role (Assistant, System, User) and content text. |
| 模块变量 (variables) | Key-value pairs of variables passed to the AI model to customize or influence the conversation. |
| 响应对话详情 (detail) | Boolean flag indicating whether to return detailed conversation information in the response. |
| 简化输出结果 (simplifyOutput) | Boolean flag to simplify the output JSON structure by extracting only the main choices data. |
Output
The node outputs JSON data containing the AI-generated chat responses. By default, the output includes the full response body from the API under the json field. If the "简化输出结果" (simplifyOutput) property is enabled (true), the output is simplified to contain only the choices array from the response body under the root json field.
The output structure typically looks like this:
{
"choices": [
{
"message": {
"role": "assistant",
"content": "AI generated reply text"
},
...
}
],
...
}
If binary data were supported (not indicated here), it would represent attachments or media related to the chat, but this node focuses on textual chat responses.
Dependencies
- Requires an API key credential for authentication with the FastGPT AI service.
- Needs the base URL of the FastGPT API configured in credentials.
- No other external dependencies are indicated.
Troubleshooting
- Missing or invalid API credentials: Ensure the API key and base URL are correctly set in the node credentials.
- Invalid session ID or missing chat messages: The node requires a valid
chatIdand at least one message in the prompt; otherwise, the API may reject the request. - Malformed message roles or content: Roles must be one of Assistant, System, or User. Content should be non-empty strings.
- API errors or timeouts: The node ignores HTTP status errors by default but check network connectivity and API availability if responses fail.
- Simplify output not working as expected: Verify the
simplifyOutputboolean is set correctly; it controls post-processing of the response.
Links and References
- FastGPT Official Documentation (example placeholder)
- n8n Documentation on Creating Custom Nodes
- OpenAI Chat Completion API Concepts (similar concept reference)