Twilio Trigger Plugin for Dify
A Dify plugin that triggers workflows when receiving SMS messages, voice calls, or WhatsApp messages via Twilio.
Features
- SMS Received: Trigger workflows when SMS messages are received
- Call Received: Trigger workflows when voice calls are received
- WhatsApp Received: Trigger workflows when WhatsApp messages are received
Setup
Prerequisites
- A Twilio account with Account SID and Auth Token
- A Twilio phone number with SMS and/or Voice capabilities
- For WhatsApp: A Twilio WhatsApp-enabled number or WhatsApp Business API setup
Configuration
- In Dify, add the Twilio Trigger plugin
- Enter your Twilio credentials:
- Account SID: Your Twilio Account SID (starts with )
- Auth Token: Your Twilio Auth Token
- Select a phone number from the dropdown
- Choose the events you want to trigger on
Events
SMS Received
Triggered when an SMS message is received on your Twilio phone number.
Filter Parameters:
- : Comma-separated phone numbers to filter by sender
- : Filter messages containing specific text (case-insensitive)
- : Filter messages matching a regex pattern
Output Variables:
- : Unique message identifier
- : Sender phone number
- : Recipient phone number
- : Message content
- : Number of media attachments
- Location info: , , , etc.
Call Received
Triggered when a voice call is received on your Twilio phone number.
Filter Parameters:
- : Comma-separated phone numbers to filter by caller
- : Comma-separated call statuses to filter (e.g., )
Output Variables:
- : Unique call identifier
- : Caller phone number
- : Recipient phone number
- : Call status (queued, ringing, in-progress, completed, busy, failed, no-answer, canceled)
- : Call direction (inbound, outbound-api, outbound-dial)
- : Caller ID name (if available)
- Location info: , , , etc.
WhatsApp Received
Triggered when a WhatsApp message is received on your Twilio phone number.
Filter Parameters:
- : Comma-separated WhatsApp numbers to filter (format: )
- : Filter messages containing specific text (case-insensitive)
- : Filter messages matching a regex pattern
- : Comma-separated WhatsApp profile names to filter
Output Variables:
- : Unique message identifier
- : Sender WhatsApp number (format: )
- : Recipient WhatsApp number
- : Message content
- : Sender's WhatsApp profile name
- : WhatsApp ID of the sender
- : Number of media attachments
- Location sharing: , , ,
- Button interactions: ,
Security
The plugin validates incoming webhook requests using Twilio's request signature verification (X-Twilio-Signature header) to ensure requests are genuinely from Twilio.
License
MIT