Chat Data icon

Chat Data

Basic Chat Data Node

Overview

The node implements an integration to send chat messages to a chatbot service. It allows users to send one or more messages as part of a conversation with a specified chatbot, optionally continuing an existing conversation or starting a new one. This is useful for automating interactions with AI chatbots, such as customer support bots, virtual assistants, or conversational agents embedded in workflows.

Typical use cases include:

  • Sending user queries or commands to a chatbot and receiving AI-generated responses.
  • Automating multi-turn conversations by appending messages to ongoing chats.
  • Customizing chatbot behavior by specifying different base models or prompts.
  • Streaming partial responses from the chatbot for real-time feedback.

For example, a user can configure this node to send a question to a GPT-based assistant and receive the answer, which can then be used downstream in the workflow for further processing or decision-making.

Properties

Name Meaning
Chatbot Name or ID Select a chatbot from a dropdown list or specify its ID via expression. Identifies which chatbot will process the messages.
Messages One or more messages to send in the conversation. Each message includes:
• Role: "User" or "Assistant" indicating the sender's role.
• Content: The text content of the message.
Additional Fields Optional extra parameters:
• Conversation ID: ID of the current conversation; if omitted, a new conversation is created.
• Base Model: Choose the OpenAI model (GPT 3.5, GPT 4o, GPT 4) overriding chatbot default.
• Base Prompt: Override the chatbot’s base prompt when processing context.
• Append Messages: Boolean to append messages to previous conversation (true) or replace all (false). Default is true.
• Stream Response: Boolean to stream partial response progressively or wait for full response. Default is false.

Output

The node outputs JSON data containing the chatbot's response to the sent messages. The output structure is:

{
  "output": {
    // chatbot API response object
  }
}
  • The output field contains the full response returned by the chatbot API.
  • The response typically includes the generated reply, conversation metadata, and any other relevant information from the chatbot service.
  • The node does not output binary data.

Each output item is paired with the corresponding input item index for traceability.

Dependencies

  • Requires an API key credential for authenticating with the chatbot service.
  • Needs the base URL of the chatbot API configured in credentials.
  • Uses HTTP requests to communicate with the chatbot API endpoint /api/v2/chat.
  • The node relies on n8n's built-in HTTP request helper with authentication support.

Troubleshooting

  • Missing or invalid credentials: If the base URL or API key is missing or incorrect, the node will throw an error indicating credential misconfiguration. Verify that the API key and base URL are correctly set in the node credentials.
  • No messages provided: The node requires at least one message to send. If none are provided, it throws an error stating "At least one message is required."
  • API errors: If the chatbot API returns an error status, the node surfaces the error message. Common causes include invalid chatbot ID, malformed request body, or exceeding rate limits.
  • Network issues: Connectivity problems to the chatbot API endpoint will cause request failures. Check network access and firewall settings.
  • Streaming option: When enabling streaming, ensure downstream nodes can handle partial responses appropriately.
  • To continue execution despite errors on some items, enable "Continue On Fail" in the node settings.

Links and References

Discussion