Actions6
- Chat Actions
- Completion Actions
- Feedback Actions
Chat → Send Message
AI-generatedOverview
The node integrates with the Dify AI platform to send chat messages as part of conversational AI workflows. It allows users to send a query or message to an AI assistant, optionally continuing an existing conversation or starting a new one. The node supports both blocking mode (waiting for the full response) and streaming mode (receiving partial responses as they are generated).
This node is useful in scenarios such as:
- Building chatbots that interact with users in real-time.
- Automating customer support conversations.
- Integrating AI assistants into business workflows.
- Collecting user input and generating AI-driven replies dynamically.
For example, you can use this node to ask "What is the weather today?" and receive a detailed AI-generated answer, or continue a previous conversation by specifying its ID.
Properties
| Name | Meaning |
|---|---|
| Query | The user query or message to send to the AI assistant. Example: "What is the weather today?" |
| Response Mode | How to handle the AI response: - Blocking: Wait for the complete response before returning. - Streaming: Stream the response as it is generated (Server-Sent Events). |
| Conversation ID | ID of an existing conversation to continue. Leave empty to start a new conversation. Example: "12345678-1234-5678-9012-123456789012" |
| User ID | Unique identifier for the user, used for tracking and analytics. Example: "user123" |
| Auto Generate Conversation Name | Whether to automatically generate a name for new conversations (true/false). |
| Additional Inputs | Additional key-value inputs to pass to the Dify application. These correspond to custom input variables defined in your Dify app. |
| Files | Files to attach to the chat message. Each file requires: - Input Data Field Name: the binary property name containing the file. - File Type: one of Image, Document, Audio, Video. |
| Additional Options | Extra options including: - Timeout (Seconds): max time to wait for a response (1–300 seconds). - Include Usage Stats: whether to include token usage and cost info. - Include Retriever Resources: whether to include knowledge base retrieval info. |
Output
The node outputs JSON data representing the AI assistant's response to the sent message. The structure typically includes:
- The AI-generated reply text.
- Metadata about the conversation or message.
- Optionally, token usage and cost information if requested.
- Optionally, knowledge base retrieval details if enabled.
If files were attached, the node may also handle binary data uploads, but the output focuses on the JSON response from the AI.
Dependencies
- Requires an API key credential for authenticating with the Dify AI platform.
- Needs the base URL of the Dify API configured in credentials.
- Uses HTTP requests to communicate with the Dify service.
- Supports Server-Sent Events (SSE) for streaming responses if selected.
Troubleshooting
- Timeouts: If the response takes longer than the specified timeout, the request may fail. Increase the timeout value if needed.
- Invalid Conversation ID: Providing a wrong or expired conversation ID will cause errors. Ensure the ID is correct or leave empty to start fresh.
- Missing Required Fields: The "Query" field is mandatory; omitting it will result in an error.
- API Authentication Errors: Invalid or missing API keys will prevent communication with the Dify platform.
- Streaming Issues: Streaming mode requires SSE support; network issues or incompatible environments may cause failures.
- File Upload Problems: Ensure the binary data field names match the input and that file types are correctly specified.