Skip to content

My Workflow 5 - Twilio WhatsApp Test

A simple test workflow for validating Twilio WhatsApp messaging functionality. This workflow receives webhook data and sends a WhatsApp response using Twilio's API, serving as a minimal test harness for WhatsApp integration.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

Based on the workflow notes, this appears to be a testing workflow designed to: - Validate Twilio WhatsApp message reception - Test WhatsApp message sending capabilities - Provide a minimal test environment for WhatsApp integration

⚠️ Important: This workflow shares the same webhook path as other PBA workflows, which could cause conflicts if activated simultaneously.

How It Works

  1. Webhook Reception: The workflow listens for incoming POST requests on a specific webhook endpoint
  2. Message Processing: When a webhook is triggered, it extracts phone number and message data
  3. WhatsApp Response: Sends a WhatsApp message back to the original sender using Twilio's API

The workflow is designed as a simple echo/test system where incoming webhook data triggers an outbound WhatsApp message.

Workflow Diagram

graph TD
    A[Webhook Trigger] --> B[Send WhatsApp response E!BA2]

    style A fill:#e1f5fe
    style B fill:#f3e5f5

Trigger

  • Type: Webhook (POST)
  • Path: /webhook/33898c22-f5f0-45f0-9983-3fd19c2daebb
  • Method: POST
  • Purpose: Receives incoming webhook data for processing

Nodes Used

Node Type Node Name Purpose
Webhook Webhook Receives incoming POST requests and extracts webhook data
Twilio Send WhatsApp response E!BA2 Sends WhatsApp messages using Twilio's API
Sticky Note Sticky Note Documentation and workflow notes

External Services & Credentials Required

Twilio

  • Credential Name: "Waringa" (twilioApi)
  • Required Fields:
    • Account SID
    • Auth Token
    • Phone Number (WhatsApp-enabled)
  • Purpose: Send WhatsApp messages

Environment Variables

No environment variables are explicitly configured in this workflow. All configuration is handled through: - Twilio credentials - Webhook path configuration - Node parameters

Data Flow

Input (Webhook)

  • Source: External webhook POST request
  • Expected Fields:
    • body.WaId: WhatsApp ID of the sender
    • Additional webhook payload data

Processing

  • Extracts phone number from JSON data
  • Maps WhatsApp ID from webhook body
  • Prepares message content from output field

Output (Twilio)

  • Destination: WhatsApp message to original sender
  • Content: Message content from $json.output
  • Method: Twilio WhatsApp API

Error Handling

No explicit error handling is implemented in this workflow. The workflow relies on: - n8n's default error handling - Twilio API error responses - Webhook timeout mechanisms

Known Limitations

  1. Webhook Conflict: Uses the same webhook path as other PBA workflows, creating potential conflicts
  2. No Error Handling: Lacks explicit error handling for failed message delivery
  3. Test-Only Purpose: Not designed for production use
  4. Single Message Flow: Only supports simple echo/response patterns
  • PBA Workflows: Share the same webhook endpoint and may conflict with this workflow
  • Consider using dedicated PBA workflows for production WhatsApp messaging

Setup Instructions

1. Import Workflow

  1. Copy the workflow JSON
  2. In n8n, go to Workflows → Import from JSON
  3. Paste the JSON and import

2. Configure Twilio Credentials

  1. Go to Credentials → Add Credential → Twilio
  2. Enter your Twilio Account SID and Auth Token
  3. Name the credential (e.g., "Waringa")
  4. Test the connection

3. Webhook Configuration

  1. Note the webhook URL: https://your-n8n-instance/webhook/33898c22-f5f0-45f0-9983-3fd19c2daebb
  2. Configure your external service to send POST requests to this URL
  3. Ensure the payload includes required fields (WaId, etc.)

4. Testing

  1. Do not activate if other PBA workflows are running (webhook conflict)
  2. Send a test POST request to the webhook URL
  3. Verify WhatsApp message delivery
  4. Check n8n execution logs for any errors

5. Production Considerations

  • Use a unique webhook path to avoid conflicts
  • Implement proper error handling
  • Consider using dedicated PBA workflows instead
  • Add logging and monitoring for production use