Triggers

Whatsapp Trigger

Category
Trigger
Node Type
Event-Based

Overview

The WhatsApp Trigger node automatically starts your workflow whenever a new WhatsApp message is received. It's perfect for automating responses, logging incoming chats, or kicking off custom actions when someone messages you on WhatsApp.

Description

Trigger workflow when a WhatsApp message is received via Twilio.

This node listens for incoming WhatsApp messages through your Twilio-connected WhatsApp number. Whenever someone sends a text or media message, it instantly activates the workflow and passes the message details — like sender name, message body, and attachments — to the next steps in your automation.

You can use it to:

  • Send auto-replies to specific keywords.
  • Store received messages in a database.
  • Forward media or text to another channel.
  • Trigger smart responses using AI nodes.

All message data is automatically captured by the node, so you don't need to configure anything manually. However, you must connect your WhatsApp number to Twilio and configure the webhook URL to enable message reception.

Input Parameters

The WhatsApp Trigger includes five automatically-filled fields whenever a new message is received.

messageIdstringOptional
The unique ID of the incoming WhatsApp message.
Example
"1"
fromstringOptional
The WhatsApp number or name of the sender.
Example
"Akshay" or "+919876543210"
tostringOptional
The WhatsApp number or name of the receiver (your connected account).
Example
"John" or "+911234567890"
bodystringOptional
The text content of the message. Empty if the message contains only media.
Example
"meet at evening"
filestringOptional
The file reference or ID if an image, PDF, video, or other attachment is sent.
Example
"report_2025.pdf"
Instructions

These values are automatically populated by Twilio's webhook system when a WhatsApp message is received — you don't have to set them yourself.

Before messages can be received, you must:

  1. Connect your WhatsApp number to Twilio
  2. Configure the webhook URL in Twilio's console (see "How to Connect WhatsApp to Twilio" section)
  3. Ensure the webhook method is set to POST

You can access message data anywhere in the workflow using variables like:

{{whatsappTrigger.input.messageId}}
{{whatsappTrigger.input.from}}
{{whatsappTrigger.input.to}}
{{whatsappTrigger.input.body}}
{{whatsappTrigger.input.file}}

Output Parameters

This node does not produce any output parameters of its own.
It only exposes the incoming WhatsApp message data through {{nodeId.input.*}} for downstream nodes.

Accessing Data

You can access incoming WhatsApp message values in other nodes using:

{{whatsappTrigger.input.messageId}}
{{whatsappTrigger.input.from}}
{{whatsappTrigger.input.to}}
{{whatsappTrigger.input.body}}
{{whatsappTrigger.input.file}}

Output Type

Output Type: None

The node does not define or emit any structured output type.
It only forwards the incoming WhatsApp message data as input fields accessible via {{nodeId.input.<key>}}.

Example Usage

Example 1: Basic Text Message

Incoming WhatsApp Message:

When someone sends a message to your Twilio WhatsApp number, the workflow receives:

{  "messageId": "1",  "from": "+919876543210",  "to": "+911234567890",  "body": "meet at evening",  "file": null}

Accessing Values Inside the Workflow:

{{whatsappTrigger.input.from}}    → "+919876543210"
{{whatsappTrigger.input.to}}      → "+911234567890"
{{whatsappTrigger.input.body}}    → "meet at evening"
{{whatsappTrigger.input.messageId}} → "1"

The workflow starts automatically when the message arrives, using the text content as input for downstream nodes.

Example 2: Message with Attachment

Incoming WhatsApp Message:

If a message includes media:

{  "messageId": "4523",  "from": "+919876543210",  "to": "+911234567890",  "body": "Please find the attached report.",  "file": "report_2025.pdf"}

Accessing Values Inside the Workflow:

{{whatsappTrigger.input.body}}    → "Please find the attached report."
{{whatsappTrigger.input.file}}    → "report_2025.pdf"
{{whatsappTrigger.input.from}}    → "+919876543210"

The workflow can use the file field to download, store, or forward the attachment to another system.

How to Connect WhatsApp to Twilio

1

Add the WhatsApp Trigger Node

Place the WhatsApp Trigger node at the start of your workflow. It acts as the workflow's entry point for incoming messages.

2

Get Your Webhook URL

After adding the WhatsApp Trigger node, the system generates a unique webhook URL for your workflow. This URL will look like:

https://api.worqhat.com/flows/webhooks/whatsapp/organization-{id}/{webhook-id}

Copy this webhook URL — you'll need it to configure Twilio.

3

Open Twilio Console

Navigate to the Twilio WhatsApp Sandbox Configuration page in your Twilio console.

If you don't have a Twilio account, create one at twilio.com.

4

Configure Webhook URL

On the Twilio Sandbox Configuration page, locate the "When a message comes in" section:

  • Paste your workflow webhook URL into the input field
  • Ensure the Method dropdown is set to POST (this is required)
  • The Status callback URL field can be left empty for basic setup
5

Save Configuration

Click the Save button at the bottom of the form to save your webhook configuration.

Twilio will now send all incoming WhatsApp messages to your workflow webhook URL.

6

Test the Connection

Send a test WhatsApp message to your Twilio WhatsApp number (usually starts with whatsapp:+14155238886).

The message should trigger your workflow automatically. Check your workflow logs to verify the message was received and processed.

How to Use in a No-Code Workflow

1

Connect to Action Nodes

Link the WhatsApp Trigger node to other nodes that perform actions — for example, a Send Message, Text Generation, or Return State node.

2

Use Message Data

You can use dynamic variables like {{whatsappTrigger.input.body}} to read the user's message and respond accordingly.

Example:

{{whatsappTrigger.input.from}}    → Sender's WhatsApp number
{{whatsappTrigger.input.body}}    → Message text content
{{whatsappTrigger.input.file}}    → Attachment file ID (if present)
3

Save and Activate

Once connected and configured, save and activate the workflow.

Now, every time a WhatsApp message is received at your Twilio number, the workflow will start automatically.

Best Practices

  • Ensure your Twilio webhook URL is properly configured with POST method.
  • Use {{whatsappTrigger.input.body}} to check or process the user's text.
  • If the file field has a value, handle it before performing text-only actions.
  • Store important messages or attachments in a database for record-keeping.
  • Combine this node with a Text Generation node to create auto-replies.
  • Add a Condition node if you want the workflow to react differently depending on message content.
  • Test your webhook connection by sending a test message after configuration.

Do / Don't

Do
  • ✔️ Configure the webhook URL in Twilio console before activating the workflow.
  • ✔️ Always use POST method for the webhook URL in Twilio.
  • ✔️ Test the connection with a sample message after setup.
  • ✔️ Handle both text and media messages in your workflow logic.
  • ✔️ Store message data in a database for audit trails.
  • ✔️ Use AI nodes for intelligent message processing and responses.
Don't
  • ❌ Don't use GET method for the webhook URL — it must be POST.
  • ❌ Don't forget to save the configuration in Twilio console after adding the webhook URL.
  • ❌ Don't assume every message has a body — check for media-only messages.
  • ❌ Don't process file attachments without validating the file field exists.
  • ❌ Don't skip testing the webhook connection before going to production.

Example Workflow Integration

Use Case: Automatically respond to customer inquiries received via WhatsApp.

  1. Trigger Node – WhatsApp Trigger (receives incoming messages with sender info and content.)
  2. AI Node – Text Generation (generates a personalized response based on the message.)
  3. Utility Node – Send Message (sends the AI-generated reply back to the customer via WhatsApp.)

Additional Use Cases

1. Customer Support Chatbot

A customer sends a WhatsApp message asking about product availability:

{  "messageId": "123",  "from": "+919876543210",  "to": "+911234567890",  "body": "Do you have iPhone 15 in stock?",  "file": null}

The workflow analyzes the message, checks inventory via a Database node, and sends an automated response with availability status.

2. Document Processing and Storage

A client sends a document via WhatsApp:

{  "messageId": "456",  "from": "+919876543210",  "to": "+911234567890",  "body": "Please process this invoice",  "file": "invoice_2025.pdf"}

The workflow downloads the attachment, extracts text using an AI node, stores it in a database, and sends a confirmation message back to the sender.

3. Order Status Updates

A customer messages asking about their order:

{  "messageId": "789",  "from": "+919876543210",  "to": "+911234567890",  "body": "What's the status of order #12345?",  "file": null}

The workflow extracts the order number, queries the database for order status, and sends a real-time update message with tracking information.

4. Lead Qualification and Follow-up

A potential customer sends an inquiry:

{  "messageId": "101",  "from": "+919876543210",  "to": "+911234567890",  "body": "I'm interested in your premium plan",  "file": null}

The workflow captures the lead information, stores it in a database, generates a personalized follow-up message using AI, and schedules a callback or sends additional information.

5. Image-Based Product Identification

A customer sends a product image:

{  "messageId": "202",  "from": "+919876543210",  "to": "+911234567890",  "body": "What product is this?",  "file": "product_image.jpg"}

The workflow processes the image using an AI Vision node, identifies the product, searches the database for details, and sends back product information, pricing, and purchase options.

6. Appointment Booking System

A user sends a message to book an appointment:

{  "messageId": "303",  "from": "+919876543210",  "to": "+911234567890",  "body": "I want to book an appointment for tomorrow at 2 PM",  "file": null}

The workflow extracts the date and time, checks availability in the database, confirms the booking, stores the appointment details, and sends a confirmation message with appointment details.

Common Errors

Workflow doesn't triggerErrorOptional
The webhook URL is not configured in Twilio, or the method is not set to POST. Verify your webhook URL is correctly added in Twilio's Sandbox Configuration page and the method is POST.
Webhook URL not savedErrorOptional
You added the webhook URL but didn't click Save in Twilio console. Always click Save after configuring the webhook URL.
Wrong HTTP methodErrorOptional
The webhook method in Twilio is set to GET instead of POST. Change it to POST in the Twilio Sandbox Configuration page.
File field is emptyErrorOptional
The message didn't include media. Skip file processing for text-only messages. Check if `{{whatsappTrigger.input.file}}` is null before processing attachments.
Message body missingErrorOptional
This happens if the message only contained an attachment — use the file value instead. Check `{{whatsappTrigger.input.body}}` before processing text content.
No response or actionErrorOptional
Make sure you've connected another node (like 'Return State' or 'Send Message') after the trigger to handle the incoming message.