WorkersTools
Message
📸 Screenshots
Here are visual examples of this section:
Message - Worker Configuration Interface
1. Overview and Purpose
The Message worker sends text messages, media files, and audio attachments through various messaging channels. It supports WhatsApp features like quick replies, interactive lists, and media attachments. The worker automatically handles message splitting for long content and processes markdown image syntax for media delivery.
2. Configuration Parameters
integrationChannel: The messaging service to use (currently supports "telerivet")telerivetApiKey: API key for Telerivet integrationtelerivetProjectId: Project ID for your Telerivet accountdefaultToNumber: Default phone number to send messages to if not specified in inputdefaultQuickReplies: Default array of quick reply options for WhatsAppdefaultRouteId: Default route ID for message routing in Telerivetusername: Username for authentication (optional)
3. Input/Output Handles
content: Input handle - accepts the message text content, supports markdown images and<break>tagstoNumber: Input handle - accepts the recipient phone numberquickReplies: Input handle - accepts array of quick reply button texts (max 3 for buttons, more creates interactive list)routeId: Input handle - accepts route ID for message routingfileAttachment: Input handle - accepts file data or URL for document/image attachmentsaudioAttachment: Input handle - accepts audio data{audio: base64, ext: string}or audio URLoutput: Output handle - returns success/error message with API response details
4. Usage Examples with Code
// Send a WhatsApp message with quick replies
const messageWorker = agent.createWorker('message', {
integrationChannel: 'telerivet',
telerivetApiKey: 'your-api-key',
telerivetProjectId: 'your-project-id'
});
// Connect inputs
messageWorker.fields.content.value = "Hello! How can I help you today?";
messageWorker.fields.toNumber.value = "+1234567890";
messageWorker.fields.quickReplies.value = ["Support", "Sales", "Billing"];
// Execute the worker
await messageWorker.execute();5. Integration Examples
This worker is commonly used in customer service workflows to send automated responses, notifications, and interactive menus. It integrates well with webhook workers to handle incoming messages and decision workers to route conversations based on user responses.
6. Best Practices
- Keep quick reply text under 20 characters for optimal display
- Use
<break>tags to split messages into multiple parts with delays - Upload large media files temporarily rather than embedding in message content
- Test phone number formats with your integration provider's requirements
7. Troubleshooting Tips
- Verify API credentials are correctly configured in worker parameters
- Check that phone numbers include proper country codes (e.g., +1 for US)
- Ensure media URLs are publicly accessible if using URL-based attachments
- Monitor message length limits (1024 characters) to avoid unexpected splitting
