How to create flows to respond to sent SMS messages

Estimated 7 minute read
|
Updated Dec 5, 2024, 9:55 PM EST
You will learn

You will learn

Learn how to create a flow to reply to inbound SMS messages. This flow makes it simple to run polls and surveys via SMS. It can send automated responses and update profile properties for those who text their answer.

You can set up this flow to respond to:

  • Any word (including, but not limited to, SMS subscribe keywords). 
  • Multiple words, or multiple spellings of the same word. 
Before you begin 

Before you begin 

Before setting up this type of flow, know that:

  • You must change the Unrecognized Keyword autoresponder to only send to those without SMS consent. 
  • The flow will only send to SMS subscribers. 
  • You need to have sent at least 1 SMS message previously.
    • Otherwise, you will not be able to properly set up the flow's trigger filters.  
How to change the unrecognized keyword autoresponder

To  adjust the unrecognized keyword autoresponder: 

  1. Click your account name in the lower left corner.
  2. Navigate to Settings > SMS > Sender preferences.
  3. In the Compliance keywords section, click Edit next to When no keyword is recognized.
    Compliance keywords section, showing the when no keyword recognized option
  4. Open the dropdown next to Automatically respond to
  5. Select non-consented profiles only.
  6. Click Save
Messaging process

Messaging process

This flow works best when you ask subscribers to text certain words. Because of this, there are 3 distinct messages we’ll be discussing: 

  1. Outbound
    The message that asks subscribers for information.
    Example of an outbound message from your brand to a subscriber
  2. Inbound
    The message subscribers send back to you with information.
    Example of an inbound message from a subscriber to your brand

  3. Flow response
    The automated response that replies to the subscriber’s inbound message.
    Example of an automatic response to an inbound message
How this flow works in Klaviyo

How this flow works in Klaviyo

The flow’s main trigger is the Sent SMS metric, which logs when any inbound message is sent from your subscribers to your brand number. 

There are 2 trigger filters: 

  • Message > equals [ID]
    Checks if the outbound message (specifically, the message ID) is the last message someone received.
  • Message body > contains [word]
    Checks if a specific word appears anywhere in the inbound message, including as part of any other word (e.g., if you input "update," "updates" will also trigger the flow).
    • Note that the word does not need to be an SMS subscribe word (although it can be). 

If a single text contains words that are triggers for 2 or more flows, only the first matched word will trigger a flow.

What does the Message filter do? 

Generally, people are only going to reply to the most recent SMS message they received. 

The Message filter looks up the recipient’s most recent message and checks if it’s the same as your outbound message. To do this, it uses the ID of the message, which is a unique string of characters in Klaviyo attached to every form, message, flow, etc. 

How to reply automatically to inbound SMS messages

How to reply automatically to inbound SMS messages

There are 2 parts for setup: 

  • Copying the unique ID of the outbound message.
  • Creating the flow. 

Do not send the outbound message until you finish setting up your flow. The flow must be live so that it can start sending as soon as a subscriber responds to your outbound text. 

If you have never sent an SMS with Klaviyo, you will need to send at least 1 (and it should be unrelated to the response flow described here). Otherwise, the proper trigger filters will not appear when you go to set up this flow. 

Copy the message ID

Copy the message ID

To find the 6-digit message ID:

  1. Navigate to the Campaigns or Flows tab.
  2. Click into the Content screen for the campaign or flow message. 
  3. Configure the content for the messages
  4. The next steps depend if the message is a campaign or flow:
    • Flows:
      1. In the SMS message editor, look at the URL. 
      2. Highlight the string of numbers and letters.  
        Example of highlighting the flow message ID
      3. Copy this string. 
    •  Campaigns:
      1. Select Save & continue in the upper right.
      2. Click Campaigns in the left-hand sidebar.
      3. Find and hover over the campaign you just created.
      4. In the modal that pops up, click Copy message ID
        Note: for campaigns, using either the ID in the URL or the campaign ID (typically ~26 digits) does not work. You must copy the message ID, as shown below.
        Copy message ID.jpg
  5. Paste the string somewhere safe until you need it again. 

The message ID is always 6 digits. If you find that the ID you copied is longer than that, you may be using the wrong type of ID. 

Set up the response flow

Set up the response flow

Create the flow and trigger

  1. Navigate to Flows > Create flow > Create from scratch.
  2. Select All triggers > Metric.
  3. Choose Sent SMS as the flow trigger action.
  4. In the Trigger filters section, click Add.   

    Trigger setup when there are no filters
  5. Click Add trigger filter
  6. Use the following filters:
    • Message > equals [add the copied message ID]
      AND
    • Message body > contains [word 1]
      OR
    • Message body > contains [word 2]
    • Note: include alternate spellings, typos, or capitalizations by adding OR between the filters.
  7. Click Save > Confirm and save.

If you don't see the options for Message or Message body, it means you haven't sent an SMS with Klaviyo, so these filters can't appear yet. The quickest way to fix this is by creating an SMS campaign to send to yourself (sending a preview does not count), or you can choose to wait until you begin send SMS campaigns or flow messages to subscribers.

Add in your splits and SMS responses

The next steps depend on how many words you’re using to trigger the flow. 

When determining the number of words, ignore any alternate spellings, typos, or capitalizations of the same word. 

Below are specific instructions depending on the number of triggers words you have.

1 trigger word
  1. Add an SMS message directly below the trigger. 
  2. In the right sidebar, click Edit in the Content section.
    Flow with only 1 SMS after the trigger
  3. Customize the content for that SMS. 
  4. Select Save
2 trigger words

Here, let's say we asked if subscribers preferred dark or blonde roasts. 

  1. Add a trigger split after the trigger.
  2. Use Message body > contains [word 1], with the OR condition between any other spellings of that word.
    Flow setup when 2 words are the trigger
  3. On the YES path, add an SMS message and customize the content to the word you used in the split (i.e., word 1). 
  4. On the NO path, repeat the previous step, changing the content for the other word (i.e., word 2).

3 or more trigger words 

  1. Add a trigger split after the trigger.
  2. Use Message body > contains [word 1], with the OR condition between any other spellings of that word. 
    Flow with 1 trigger split
  3. On the YES path, add an SMS message and customize the content to that word. 
  4. On the NO path, add another trigger split.
  5. For the trigger split on the NO path, use Message body > contains [word 2] along with the OR condition between any alternate spellings. 
  6. Under the new trigger split, place an SMS on the YES path. 
  7. Repeat the steps 4-6 as many times as needed. 
  8. Add an SMS to the final NO path. 

Optional: add profile properties based on the inbound SMS

  1. Drag a Profile property update action after the time delay.
  2. Set the action to Create a new property and base the property on the word a subscriber texts in.
    Note that the property must exist on at least 1 profile before you can use it for an Update profile property action.
    Creating a profile property for a subscriber's preferred roast type
Outcome

Outcome

Now that the flow is set up, all you need to do is set it live. Then, you can send your outbound message to subscribers. 

When a SMS subscriber replies with a trigger word, you can automatically: 

  • Respond back with a personalized message. 
  • Add a profile property based on the subscriber’s inbound message.
Additional resources

Additional resources

Learn other ways to respond to subscribers: 

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Live training
Join a live session with Klaviyo experts to learn about best practices, how to set up key features, and more.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type