Actions39
- Chatbot Actions
- Contact Actions
- Message Actions
- Panel Actions
- Sequence Actions
- Session Actions
Overview
The WTS Chat node integrates with the WTS API to manage chatbot interactions, contacts, messages, sessions, panels, and sequences. Specifically for the Chatbot - Send Chatbot operation, it sends a chatbot message through a specified channel to a target number, optionally within an existing session or starting a new one.
This node is useful in scenarios where automated chatbot communication is needed on messaging platforms supported by WTS, such as Instagram or WhatsApp. For example, you can automate sending chatbot-driven responses to customers, trigger chatbots based on events, or enrich conversations with metadata.
Practical examples:
- Sending a chatbot message to a customer’s Instagram account via a selected channel.
- Starting a new chatbot session forcibly if none exists.
- Skipping sending the chatbot message if another bot is currently running or if a conversation is already in progress.
- Adding custom metadata to the session or contact for context-aware chatbot behavior.
Properties
Name | Meaning |
---|---|
Session ID | The identifier of the session in which to send the chatbot message. Optional; if omitted, the message may start a new session depending on other settings. |
Chatbot Name or ID | Select the chatbot to send from a list or specify its ID. This identifies which bot will be used to send the message. |
From Name or ID | The channel (e.g., Instagram or WhatsApp channel) from which the chatbot message will be sent. Choose from available channels or specify an ID. |
To | The recipient's phone number or username to whom the chatbot message will be sent. Required field. |
Force Start Session | Boolean flag indicating whether to force the start of a new session if one does not exist. |
Skip If Bot In Execution | Boolean flag that, if true, prevents sending the chatbot message if another chatbot is currently running in the session. |
Skip If In Progress | Boolean flag that, if true, prevents sending the chatbot message if a conversation is already ongoing in the session. |
Session Metadata | Key-value pairs of metadata to attach to the session when sending the chatbot message. Useful for passing contextual information to the chatbot engine. |
Contacts Metadata | Key-value pairs of metadata to attach to the contact when sending the chatbot message. Useful for enriching contact data with additional context. |
Output
The node outputs JSON data representing the response from the WTS API after attempting to send the chatbot message. The structure typically includes details about the sent message, status, session info, or error information if the request failed.
If binary data is involved (not typical for this operation), it would represent files or media associated with the message, but for "Send Chatbot" operation, output is JSON only.
Example output snippet (conceptual):
{
"botId": "string",
"from": "channel_id",
"to": "recipient_number",
"sessionId": "string",
"status": "sent",
"messageId": "string",
"sessionMetadata": { "key1": "value1" },
"contactMetadata": { "keyA": "valueA" }
}
Dependencies
- Requires an active connection to the WTS API service.
- Needs an API key credential configured in n8n for authentication with the WTS API.
- The node uses internal services (
WtsChatService
) to interact with the API endpoints. - The user must have appropriate permissions and valid chatbot, channel, and session identifiers configured in WTS.
Troubleshooting
Common Issues
- Missing required fields: Errors occur if mandatory fields like chatbot ID, channel ID, or recipient number are missing.
- Invalid IDs: Using invalid or non-existent chatbot, channel, or session IDs will cause API errors.
- Bot already running or session in progress: If
skipIfBotInExecution
orskipIfInProgress
flags are set, the node may skip sending the message silently or return an error if conditions are not met. - API authentication failure: Incorrect or missing API key credentials will prevent successful requests.
Common Error Messages
"Choose a bot"
: Indicates the chatbot ID was not provided or invalid."Set an Instagram number or username for sending"
: The recipient number/username is missing."Choose channel"
: The sending channel is not selected."Fill in the Bots ID field"
: Same as "Choose a bot", chatbot ID is required."There is no data in the input"
or"There is no file with that name that comes from input"
: Related to file sending operations, not applicable here but may appear if misconfigured."SessionID is empty!"
: When a session ID is required but missing.
To resolve these errors, ensure all required parameters are correctly filled, valid IDs are used, and API credentials are properly configured.
Links and References
- WTS API Documentation (hypothetical link)
- n8n Expressions Documentation
- WTS Chatbot Integration Guide (hypothetical link)
This summary focuses on the Chatbot - Send Chatbot operation as requested, extracted from the static analysis of the provided source code and property definitions.