WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The WTS Chat node's "Send Chatbot" operation allows you to trigger a chatbot flow for a specific contact or session via the WTS API. This is useful for automating customer engagement, support, or marketing workflows where you want to initiate a bot conversation programmatically. For example, you might use this node to automatically start a chatbot when a new lead is added, or to re-engage users based on certain triggers in your n8n workflow.

Properties

Below are the input properties relevant to the "Chatbot" resource and "Send Chatbot" operation:

Display Name Type Description
Session ID string The unique identifier of the session to associate with the chatbot interaction.
Chatbot Name or ID options Select or specify the chatbot to send. You can choose from a list or provide an ID/expression.
From Name or ID options Select or specify the channel (e.g., WhatsApp, Messenger) from which the chatbot will be sent.
To string The recipient's number to whom the chatbot should be sent.
Force Start Session boolean If enabled, forces the creation of a new session if one does not exist.
Skip If Bot In Execution boolean If enabled, the chatbot will not be sent if another bot is already running for the session.
Skip If In Progress boolean If enabled, the chatbot will not be sent if a conversation is currently ongoing.
Session Metadata fixedCollection Key-value pairs to attach as metadata to the session.
Contacts Metadata fixedCollection Key-value pairs to attach as metadata to the contact.

Output

  • The output is a single JSON object containing the result of the chatbot initiation request.
  • The structure typically includes status information, IDs, and any response data returned by the WTS API after sending the chatbot.
  • No binary data is produced by this operation.

Example Output

{
  "status": "success",
  "data": {
    "sessionId": "abc123",
    "botId": "bot456",
    "message": "Chatbot started successfully"
  }
}

Note: The actual fields may vary depending on the WTS API response.

Dependencies

  • External Service: Requires access to the WTS API.
  • API Key: You must configure valid WTS API credentials (wtsApi) in n8n.
  • n8n Configuration: Ensure the node has access to the necessary credentials and that the base URL (https://api.wts.chat) is reachable from your n8n instance.

Troubleshooting

Common Issues:

  • Missing Required Fields: If required fields like "Chatbot Name or ID", "From Name or ID", or "To" are not provided, the node will throw errors indicating which field is missing.
  • Invalid Channel or Bot Selection: Selecting "Undefined" or leaving the default value for channel or bot will result in an error.
  • Session Conflicts: If "Skip If Bot In Execution" or "Skip If In Progress" is enabled and a conflicting session/bot is detected, the chatbot will not be sent.
  • API Authentication Errors: Invalid or missing API key will cause authentication failures.

Error Messages & Resolutions:

  • "Choose bot" / "Fill in the From field": Make sure to select a valid chatbot and channel.
  • "Set an Instagram number or username for sending": Provide a valid recipient number.
  • "There is no data in the input": If using file-related features, ensure the correct binary data is present.
  • "SessionID is empty, please fill it in": Provide a valid session ID if required.

Links and References


This summary provides a clear understanding of how to use the "Send Chatbot" operation within the WTS Chat node in n8n, including its inputs, outputs, dependencies, and troubleshooting tips.

Discussion