Twilio SMS
Send SMS and WhatsApp messages via Twilio from a workflow. Supports two operations: standard SMS and WhatsApp messaging.
Get your credentials from the Twilio Console:
- Copy your Account SID and Auth Token.
- Purchase or verify a phone number for SMS, or set up a WhatsApp sender.
- Add the credentials as environment variables on the Env Vars page:
| Variable | Description |
|----------|-------------|
| TWILIO_ACCOUNT_SID | Twilio Account SID (starts with AC) |
| TWILIO_AUTH_TOKEN | Twilio Auth Token |
| TWILIO_FROM_NUMBER | Sender phone number in E.164 format (e.g. +14155551234) or WhatsApp format (e.g. whatsapp:+14155551234) |
For WhatsApp, the from number must use the whatsapp: prefix (e.g. whatsapp:+14155551234). WhatsApp messages require either an approved message template or an open 24-hour customer service window.
Each node run executes a single operation.
Send a standard SMS message.
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | send_sms |
| to | string | Yes | Recipient phone number in E.164 format (e.g. +14155559876). Supports {{ }} bindings. |
| body | string | Yes | Message text. Supports {{ }} bindings. |
Send a WhatsApp message via Twilio.
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | send_whatsapp |
| to | string | Yes | Recipient WhatsApp number (E.164 format; Twilio adds the whatsapp: prefix). |
| body | string | Yes | Message text. Must comply with WhatsApp messaging rules. |
WhatsApp messaging restrictions:
- Requires an approved message template for outbound messages outside the 24-hour window
- Within the 24-hour window (after the recipient messages you), free-form text is allowed
TWILIO_FROM_NUMBERmust be configured with thewhatsapp:prefix
Connect a Twilio SMS node to an AI Agent Tools handle to let the agent send notifications or alerts.
Use Allowed Operations (Agent) to restrict which messaging channels the agent can use — for example, allow send_sms only and exclude send_whatsapp. This setting is excluded from the tool schema.
When used as a tool, the agent supplies operation, to, and body as tool arguments.
All operations emit a result object on the result handle, accessible downstream as {{ twilio.* }}:
| Field | Type | Description |
|-------|------|-------------|
| success | boolean | Whether the message was sent successfully |
| sid | string | Twilio message SID (e.g. SM...) |
| status | string | Message status (e.g. queued, sent, delivered) |
| error | string | Error message if success is false |
{
"success": true,
"sid": "SMabc123def456",
"status": "queued",
"error": null
}
Access results in downstream nodes:
{{ twilio.sid }}
{{ twilio.status }}
{{ twilio.success }}
