Chat Data icon

Chat Data

Basic Chat Data Node

Overview

The node interacts with a chat data service API to retrieve and manage chatbot-related information. Specifically, the Get Leads operation under the Action resource fetches lead data collected by a specified chatbot. This is useful for scenarios where you want to extract customer or user leads generated through chatbot interactions, filter them by date or source, and process or analyze them further in your workflow.

Practical examples include:

  • Exporting recent leads from a chatbot for CRM integration.
  • Filtering leads created within a specific timeframe or from a particular communication channel (e.g., WhatsApp, Slack).
  • Automating follow-up actions based on newly acquired leads.

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. Options include: All Sources, API, Chat Data Site, Discord, Iframe, Messenger, Slack, WhatsApp, Widget.

Output

The output consists of multiple items, each representing a single lead retrieved from the chatbot. Each item’s json field contains the lead data as returned by the API, including details such as lead identifiers, timestamps, source, and any other metadata provided by the service.

The node does not output binary data for this operation.

Dependencies

  • Requires an API key credential configured with the chat data service.
  • The node uses the base URL and API key from these credentials to authenticate requests.
  • The API endpoints used are under /api/v2/get-customers/{chatbotId}.
  • The node expects the API to return JSON responses containing arrays of leads (customers).

Troubleshooting

  • Missing or incorrect credentials: If the base URL or API key is missing or invalid, the node will throw an error indicating that credentials need to be checked.
  • Invalid chatbot ID: Selecting or specifying a chatbot ID that does not exist or is inaccessible will result in an error from the API.
  • API errors: If the API returns an error status, the node surfaces the message. Common causes include rate limits, permission issues, or malformed requests.
  • Empty or malformed response: If the API response does not contain the expected array of leads, the node throws an error about invalid response format.
  • Date filters: Ensure that start and end dates are valid ISO date strings; otherwise, filtering may not work as expected.
  • Limit handling: The node paginates internally but respects the limit parameter to avoid returning more leads than requested.

To resolve errors:

  • Verify API credentials and permissions.
  • Confirm chatbot IDs are correct.
  • Check network connectivity and API availability.
  • Use the "Continue On Fail" option in n8n to handle partial failures gracefully.

Links and References

Discussion