Skip to content

Twilio Actions

The Twilio Actions allow ThinkAutomation to send and receive SMS text messages, make outbound voice calls, and format telephone numbers for international dialing. These actions integrate your Automations with Twilio’s cloud-based telephony services, enabling workflows that notify users by text, request confirmations or responses, perform automated voice calls, or conduct two-way SMS conversations. By combining Twilio Actions with variable assignment and conditional logic, you can build automated communication sequences that interact with customers or internal teams in real time.

Twilio Make A Telephone Call

This action enables you to call any telephone number. Once answered, ThinkAutomation can speak custom text to the receiver and/or connect the call to another number.

Makes an outbound voice call using the Twilio API. Twilio is a cloud-based telephony provider.

See: https://www.twilio.com for more information.

Before using this action you need to create a Twilio Account. Once you have created an account, login and select Dashboard. Select Show API Credentials - this will display the Account SID and Account Token. Enter these into ThinkAutomation Server Settings - Twilio Tab.

You must specify the From Twilio Number. This is the phone number that will be displayed on the receivers phone. In your Twilio Account you can create a new phone number, or you can verify one of your existing phone numbers with Twilio. Once verified it can be used as the From Number.

Enter the phone number to call in the Call Number entry. This must be the full international number. You can use the Normalize Phone Number action to correctly format a phone number for a given country.

Select the Ring For (Seconds). This defaults to 30 seconds. If the call is not answered within this time the call will be closed.

On Call Answer

Once the receiver has answered the call you can choose to:

Say Text

This will read the specified text to the receiver. You can specify up to 4096 characters. The text can include %variable% replacements.

Say In Voice/Language

The Say In Voice option allows you to select a voice (Woman, Man or Alice). The Say In Language can be used to select the language for the text being read. The Woman/Man voice can use languages: English US, English UK, French, German, Spanish or Italian. The Alice voice has a choice for more languages.

Play Audio File URL

You can also have an audio file played to the receiver. Specify the URL to the audio file to be played.

Hang Up If Machine Answers

Enable this option if the call should be stopped if an answering machine or voice mail system picks up the call.

Record Call

Enable this option if you want the call to be recorded. The URL of the recording can be returned to a ThinkAutomation field or variable on completion of the call.

Connect Call To

Enable this option if you want the call to be connected to another number once it has been answered and the Say Text/Play Audio has completed (if any). Specify the Connect To Number. This other number will then be called and the two calls connected. If you do not use the call connect then the call will end once the Say Text/Play Audio has completed.

On Call Completion

Once the call has ended the Call Duration, Call Status and Recording URL can be returned to ThinkAutomation variables.

The Call Status will be one of: completed, busy, failed or no-answer

Automation Processing

When ThinkAutomation starts the call the message processing for the current message will pause until the call completes (or fails). Other messages will be processed whilst the call is active. Once the call is complete the remaining actions in the Automation will execute.

Phone Number Formats

All phone numbers must include the country code preceded by + so 800 680 7712 would be +18006807712. For UK numbers the first 0 of the number is omitted. For example 01782 822577 would be +441782822577. ThinkAutomation will remove any spaces and add the + sign itself if required. Use the Normalize Phone Number Action to correctly format a phone number.


Twilio Send SMS Message

Sends an SMS text message to any phone using the Twilio API. Twilio is a cloud-based telephony provider.

See: https://www.twilio.com for more information.

Before using this action you need to create a Twilio Account. Once you have created an account, login and select Dashboard. Select Show API Credentials - this will display the Account SID and Account Token. Enter these into ThinkAutomation Server Settings - Twilio tab.

From Twilio Number Or Messaging Service SID

Messages can be sent from a specific Twilio Number. This is the phone number that will be displayed on the receivers phone. In your Twilio Account you can create a new phone number, or you can verify one of your existing phone numbers with Twilio. Once verified it can be used as the from number.

You can also specify a Messaging Service SID. In your Twilio Console you can create Messaging Services. The From number will then be automatically selected when the message is sent based on rules you define.

Enter the To number and Message Body.

The To number must include the country code.

You can also specify a Media URL if you want to send a Multi-Media Message (MMS). You can specify a URL to a Gif, Png or Jpeg image. This will be rendered on the receivers phone. The image must be less than 5mb.

MMS messages are only supported for USA and Canada numbers. Regular text messages can be sent to any number in the world.

Waiting For Delivery Status

Once the message is sent the sent status can be assigned to a ThinkAutomation variable. This status will be set to 'delivered' if the message has been successfully sent. Otherwise it will be set to 'undelivered', or 'failed: {error message}' for failed messages. If you assign the status to a variable then ThinkAutomation will wait until the SMS has been sent (or failed) before assigning the status and proceeding with the remaining actions for the Automation. Automations will still execute on other messages during this waiting phase (normally only a few seconds). ThinkAutomation will wait for up to 3 minutes for the status.

Waiting for delivery status requires the Web API to be enabled.

If you want to use the Wait For SMS Reply action to wait for a reply to this message you should always check the Assign Status To variable and only wait for the response if the sent status is 'delivered'. This ensures that the message has been sent before you start waiting for a response.

Automation Processing

When ThinkAutomation sends the text message the message processing for the current ThinkAutomation message will pause until the SMS text is sent (or fails). Other messages will be processed during this time. Once the SMS message has been sent the remaining actions in the Automation will execute.

Phone Number Formats

All phone numbers must include the country code preceded by + so 800 680 7712 would be +18006807712. For UK numbers the first 0 of the number is omitted. For example 01782 822577 would be +441782822577. ThinkAutomation will remove any spaces and add the + sign itself if required. Use the Normalize Phone Number Action to correctly format a phone number.


Twilio Wait For SMS Reply

This Action will wait to receive an SMS text message from a specific number. Normally this action would be used to wait for a response to a previously sent SMS message.

Set the From Number to the number you want to wait to receive a message from. Leave this blank to use the number from the last Twilio SMS Message action.

Set the Wait For to the number of seconds you want to wait for. If a message is not received after this time then the message text will be blank and Automation execution will continue. The maximum value for this is 9999 seconds (166 Minutes).

Set the Assign Message Text to a variable that you want to reply text to be set to.

When this action executes, ThinkAutomation will pause execution of the current Automation Message execution until the reply is received (or the timeout seconds has elapsed). Other ThinkAutomation messages will be processed during this waiting period. When the reply is received the remaining Automation actions for the current message will be executed.

You can have multiple send/wait for reply actions within a single Automation, allowing you to construct automated SMS text conversations and performing different actions based on the reply results.


Normalize Phone Number

Formats a phone number for international or domestic use.

Takes any phone number and adds or removes the international dialing code for the specified country. It also removes any spaces, dashes or parenthesis.

Specify the Phone Number. This can be a field or variable. The first phone number found in the text specified will be used.

Specify the Country Code/Name. This can also be a variable. You can use the full country name eg: United Kingdom, or the country code, eg: GB

Enable the Make International option to return the full international phone number. Otherwise the domestic number will be returned.

Select the variable to assign the result to from the Assign To list.

This action is useful when using the Twilio actions, or for normalizing phone numbers before being recorded in a database.

International phone numbers will be returned in the format:

+{countrycode}{number}

Eg:

(407) 488 2019 for United States becomes: +14074882019

01782-822577 for United Kingdom becomes: +441782822577

Eg for domestic numbers:

+44 1782 822577 for United Kingdom becomes: 01782822577

If the country specified does not exist then the phone number will be returned blank.