Two Twilio triggers start a run the moment Twilio has something to report:

  • Twilio · New SMS received — When a text arrives at one of your Twilio numbers.
  • Twilio · Message status changed — When a message sent through a messaging service is delivered, fails or changes status.

Both are instant triggers, and Bizomate sets them up in Twilio when you publish — see How instant triggers work.

Who can do this

Workspace Admins and Editors, on every plan — Twilio is not a premium connection. Viewers see the trigger and its status but cannot change it.

Before you start

  • A Twilio connection — see Connect Twilio.
  • For New SMS received, a Twilio number that can receive SMS.
  • For Message status changed, a messaging service in Twilio, and the messages sent through it: on Send an SMS, choose the messaging service in From — see Send an SMS with Twilio.

Steps

Set up New SMS received:

  1. Open the workflow in the designer and open the trigger picker — Browse all triggers on an empty workflow, or select the trigger and Change how it starts.

  2. Under Twilio, select New SMS received — it reads Twilio · instant. Or type Twilio in Search triggers.

  3. In Connection, choose your Twilio connection — for example Consulace Twilio.

  4. In Number, choose the number that receives the texts. The list shows the account's numbers, with each one's name in Twilio beside it. Publishing points this number's incoming texts at Bizomate, in place of any address set for it in Twilio.

  5. Add the steps, then Publish.

    Publishing sets the number's incoming-message address in Twilio to Bizomate's. The panel reads Waiting for the first event — Text the number; it appears here within seconds.

Set up Message status changed:

  1. In the trigger picker, under Twilio, select Message status changed.
  2. In Connection, choose your Twilio connection.
  3. In Messaging service, choose the service — Messages sent through this service report back. Publishing sets its status address in Twilio. Each service shows its name, with its SID beside it.
  4. Under Statuses, choose which changes start a run:
    • Every change — the default. Each status Twilio reports, such as queued, sent and delivered, is a run.
    • Delivered — delivered, and read for messages that report being read.
    • Failed — failed and undelivered.
  5. Add the steps, then Publish. Publishing sets the messaging service's status address in Twilio to Bizomate's.

Test with a real text or status:

  1. Text the number from a phone, or send a message through the messaging service.
  2. Within seconds the panel reads Listening — instant — Last event 10:45 · New SMS · +919800000000, or delivered · +919800000000.
  3. On Output, select Use the last event, then Test run.

What the trigger gives

New SMS received — each text is one item:

Field What it is
messageSid Twilio's id for the message — starts with SM or MM.
from The sender's number — +919800000000.
to Your Twilio number it arrived at.
body The text.
media Links to any pictures or files sent with it (MMS), in a list. Empty for a plain SMS.
fromCity The sender's city, when Twilio knows it.
fromCountry The sender's country, as a two-letter code — IN.

Message status changed — each status report is one item:

Field What it is
messageSid Twilio's id for the message. Look it up with Get a Twilio message.
status The new status — queued, sent, delivered, undelivered, failed …
to The number it was sent to.
from The number it was sent from.
errorCode Twilio's error code when it failed or was not delivered — 30003. Empty otherwise.

Use them in later steps as {{ trigger.from }}, {{ trigger.status }} and so on. To answer a text, add Send an SMS with To set to {{ trigger.from }} and From set to the same number.

What happens next

  • Each text, or each status report, starts one run of the live version, in Production, named after it.
  • Twilio sends no reply of its own. Bizomate answers each text with an empty reply, so the sender gets nothing unless a step sends it.
  • Changing the number or the messaging service and publishing takes Bizomate's address off the old one and sets it on the new.
  • Changing to another trigger and publishing, or deleting the workflow, clears the address in Twilio — when no other workflow on the same number or service still listens. What the number had before Bizomate is not put back.

Good to know

  • Publishing replaces what the number had. If the number already sent its texts to another address or a TwiML app, that stops. Use a number kept for Bizomate.
  • A number inside a messaging service may send its texts to the service's own address instead. If Waiting for the first event stays after a text, in the Twilio Console set the service's incoming messages to Defer to sender's webhook.
  • Message status changed hears only messages sent through that messaging service. A message sent from a plain number does not report here.
  • One number, one address. Every workflow in the workspace with New SMS received on the same number and connection shares one address in Twilio, and each text starts a run in all of them. The same is true of Message status changed on one messaging service.
  • How a call is proved to be Twilio's. With a connection that uses the Auth Token, Bizomate checks Twilio's signature on every call; a call that does not match is answered 401 and starts nothing. With a connection that uses an API key, Bizomate cannot check the signature, and the secret code in the address is the check.
  • Twilio bills incoming texts as it does sent ones.

If something goes wrong

What you see Why What to do
Not listening — Twilio would not take Bizomate's address: This Twilio account has no number +919800000000. Fix it, then publish again. The number was released, or belongs to another account. Choose a number from Number, then publish.
Not listening — … Choose the number that receives the texts. … Number is empty. Choose one, then publish.
Not listening — … Choose the messaging service whose messages report back. … Messaging service is empty. Choose one, then publish.
Not listening — … Twilio refused: Authenticate. Check the connection's details on Connections. … The Auth Token or API key was changed in Twilio. Select Reconnect, fill in the details again, then publish again.
Not listening — … Twilio's Ireland and Australia regions need an API key made in that region. … The connection is in IE1 or AU1 without an API key. Reconnect with an API key made in that region.
Waiting for the first event stays after a text The number is in a messaging service that takes its texts, or someone changed the number's address in Twilio after publishing. Set the service to Defer to sender's webhook. If the address was changed, choose another number and publish, then choose this one again and publish.
No status reports arrive The messages were sent from a number, not through the messaging service. On Send an SMS, choose the messaging service in From.
A status did not start a run Statuses left it out — Delivered takes only delivered and read. Choose Every change to see them all.