Chat Data icon

Chat Data

Basic Chat Data Node

Overview

The node interacts with a chat data service API to perform various actions related to chatbots, triggers, and chat data. Specifically for the Action > Get Leads operation, it retrieves lead information collected by a specified chatbot. This is useful for workflows that need to process or analyze leads generated from chatbot interactions.

Common scenarios include:

  • Extracting recent leads from a chatbot for CRM integration.
  • Filtering leads by creation date or source channel.
  • Limiting the number of leads retrieved for batch processing.

Example use case: Automatically fetch the latest 50 leads created by a specific chatbot on your website, filtering only those submitted via WhatsApp, and then send them to a marketing automation tool.

Properties

Name Meaning
Chatbot Name or ID Select the chatbot from which to retrieve leads, either by choosing from a list or specifying an ID.
Limit Maximum number of lead results to return (minimum 1).
Additional Fields Optional filters to refine the leads retrieved:
- Start Date Only include leads created after this date/time.
- End Date Only include leads created before this date/time.
- Source Filter leads by their origin/source channel. Options include: All Sources, API, Chat Data Site, Discord, Iframe, Messenger, Slack, WhatsApp, Widget.

Output

The output is an array of JSON objects, each representing a lead retrieved from the chatbot. Each object contains the raw lead data as returned by the API under the json property.

Structure example (simplified):

[
  {
    "json": {
      "leadId": "string",
      "name": "string",
      "email": "string",
      "createdAt": "timestamp",
      "source": "string",
      "...": "other lead fields"
    }
  },
  ...
]

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for authenticating with the chat data service.
  • The node uses the base URL configured in the credentials to make HTTP requests.
  • The API endpoints used are under /api/v2/get-customers/{chatbotId}.
  • Proper configuration of the API key and base URL in n8n credentials is necessary.

Troubleshooting

  • Missing or invalid credentials: If the base URL or API key is missing or incorrect, the node will throw errors indicating failure to connect or authenticate.
  • Invalid chatbot ID: Providing a non-existent chatbot ID will result in an error response from the API.
  • API rate limits or network issues: May cause request failures; ensure network connectivity and API usage limits are respected.
  • Date filter format: Ensure start and end dates are valid ISO date-time strings; otherwise, the API may reject the request.
  • Limit too high: Although not explicitly stated, setting an excessively high limit might cause performance issues or API rejections.

Error messages typically include the API's error message. To resolve, verify credentials, chatbot ID, and input parameters.

Links and References

Discussion