Actions39
- Chatbot Actions
- Contact Actions
- Message Actions
- Panel Actions
- Sequence Actions
- Session Actions
Overview
The node "WTS Chat" integrates with the WTS API to send templated messages to contacts via various messaging channels. Specifically, the Send Template To Contact operation allows users to send a predefined message template to a specified contact number. This is useful in scenarios such as automated customer support, marketing campaigns, or notifications where consistent message formatting and content are required.
For example, a business can use this node to send appointment reminders, promotional offers, or FAQs using templates that include dynamic parameters personalized for each recipient.
Properties
| Name | Meaning |
|---|---|
| Chatbot Name or ID | Select or specify the chatbot by name or ID to associate with the message sending. |
| Department Name or ID | Select or specify the department by name or ID, which may affect routing or user assignment. |
| User Name or ID | Select or specify a user within the chosen department to send the message on behalf of. |
| From Name or ID | The channel (e.g., WhatsApp, Instagram) from which the message will be sent. |
| Template Name or ID | Choose the message template to send. Templates are pre-configured message formats that can include placeholders for parameters. |
| Params | A collection of key-value pairs to fill in the template's parameters dynamically. Each parameter has a name (from the template's defined parameters) and a value to substitute. |
| To | The recipient's phone number or username to whom the template message will be sent. |
| Url | URL of a file to attach to the message if the template supports media. |
| Input Field File Name | The name of the input field containing a base64-encoded file to attach to the message. Supports deep object notation for nested fields. |
| Send Synchronous Message | Boolean flag indicating whether the message should be sent synchronously (wait for confirmation before proceeding). |
| Enable Bot | Boolean flag to activate the chatbot automatically upon receiving a response from the contact. |
| Hidden Session | Boolean flag to mark the session as hidden, possibly affecting visibility in the system. |
| Force Start Session | Boolean flag to force the start of a new session when sending the message. |
Output
The node outputs JSON data representing the result of the send template operation. The output typically includes details about the sent message such as message ID, status, timestamps, and any metadata returned by the WTS API.
If a file is attached, the node handles uploading the file first and then sends the message referencing the uploaded file ID. Binary data input is accepted for files, but the output remains JSON describing the message send result.
Dependencies
- Requires an API key credential for authenticating with the WTS API.
- The node depends on the WTS API endpoints for templates, channels, bots, and message sending.
- It uses helper methods to upload files if sending media attachments.
- Requires proper configuration of channels, templates, and chatbots in the WTS platform.
Troubleshooting
- Missing Required Fields: Errors occur if mandatory fields like Channel ("From"), Recipient ("To"), or Template are not provided. Ensure these are filled.
- Invalid Template Selection: Selecting an undefined or invalid template will cause errors. Always choose a valid template from the list.
- File Attachment Issues: If specifying a file to send, ensure the binary data exists in the input under the correct field name; otherwise, errors about missing files will appear.
- API Authentication Errors: Invalid or missing API keys will prevent communication with the WTS API.
- Parameter Mismatch: Template parameters must match those defined in the selected template; otherwise, the message may fail to send or render incorrectly.
- Session Flags: Misuse of flags like
Force Start SessionorHidden Sessionmight lead to unexpected session behavior.
Links and References
- n8n Expressions Documentation
- WTS API documentation (not publicly linked here, refer to your WTS platform resources)
- n8n official docs for creating custom nodes and handling binary data
This summary focuses on the Message resource and the Send Template To Contact operation, extracting relevant properties and logic from the provided source code and property definitions.