tr Skip to content

Run new SMS messages in Twilio through OpenAI and send responses as SMS messages via Twilio

Each text that reaches your Twilio number is sent to OpenAI as a prompt, and the generated answer goes back to the sender by SMS from Twilio, giving you a basic AI text responder.

Twilio OpenAI (ChatGPT)

3 steps Setup ~5 min Used on 2.9k sites Free to import

The Run new SMS messages in Twilio through OpenAI and send responses as SMS messages via Twilio workflow on the FlowMattic canvas, with 3 steps across Twilio, OpenAI (ChatGPT)
The workflow as it appears in the builder after import. Each step opens for editing.

What this workflow does

People often text a business number with quick questions outside working hours. If nobody answers, the conversation stalls. This workflow gives every incoming text an AI-written reply on the same number, so you can test an SMS assistant without building an app.

The Twilio Incoming SMS trigger starts a run when a message arrives at your Twilio number. The text of that message is mapped straight into the prompt of the OpenAI (ChatGPT) Generate Content step. As imported, the prompt is only the customer's words, with no instructions about your business, tone or length. Add those yourself in front of the mapped message, or the replies will be general answers.

The final step is Twilio Send SMS. It is already mapped: the recipient is the number the message came from, and the body is the content OpenAI returned. Each incoming text gets one reply, and the workflow doesn't remember earlier messages, so every text is answered on its own.

Connect the trigger to the Twilio number you want to answer, following the trigger's setup in FlowMattic, then text that number from your own phone to test. Task History shows the prompt OpenAI received and the reply that was sent.

After-hours answers for a local service

A plumbing business adds its opening hours and service area to the prompt, so people who text the Twilio number at night get a reply that covers both.

Event information line

An event organiser puts the venue, schedule and parking details in the prompt, and attendees text questions to one number during the day of the event.

Trying out an SMS assistant

A small team texts its own Twilio number with real customer questions to see how OpenAI answers before deciding whether to offer an SMS channel.

How this workflow runs

What happens at each step once the workflow is on, and what you need before you import it.

  1. Step 1Trigger
    Twilio Incoming SMS

    Fires when an SMS arrives at your Twilio number. The message text and the sender's number are passed on; both are used by the later steps.

  2. Step 2Action
    OpenAI (ChatGPT) Generate Content

    Sends the incoming message text to OpenAI as the prompt and returns the generated reply. The template adds no instructions around it, so write your own context and rules into the prompt.

  3. Step 3Action
    Twilio Send SMS

    Texts the OpenAI reply back from Twilio to the number that sent the message. The recipient and body are already mapped to the sender and the generated content.

What you need

  • FlowMatticCore
  • Twilio AccountAccount
  • OpenAI (ChatGPT) AccountAccount

After importing, map your own data. To keep the template universal, not every step is pre-filled. Open each step in the builder and connect your accounts and fields (channels, lists, sheets, recipients) before you switch the workflow on.

Make it yours

Changes worth making after you import it.

  • Edit the prompt in the Generate Content step to start with your own instructions, such as who you are, what to answer and to keep the reply short enough for a text, then the mapped message.
  • Put a Filter between the Twilio trigger and the OpenAI step that stops texts from your own staff numbers, so internal messages don't get AI replies.
  • Add a Google Sheets step after Send SMS that logs the sender, the incoming text and the reply, so you can review what customers asked and what OpenAI said.

Questions about this workflow

Does OpenAI know anything about my business as imported?

No. The prompt is only the text the person sent. Add your business details and instructions to the prompt in the Generate Content step, or the replies will be generic.

Does the assistant remember earlier texts from the same person?

No. Each incoming SMS starts its own run, and only that message goes to OpenAI. Earlier messages from the same number aren't included in the prompt.

Do I need to set anything up in Twilio for the trigger to work?

You need a Twilio number that can receive SMS, connected to the trigger as its setup in FlowMattic describes. Send a test text to that number afterwards and check Task History to confirm the run started.

Will every text to my Twilio number get a reply?

Yes, as imported. Every incoming SMS runs all three steps. Add a Filter between the trigger and the OpenAI step if some senders or messages should not be answered.

Import this workflow into your WordPress site

Download the JSON, import it from the Workflows screen and connect your accounts. Every run stays on your server, with no per-task fees.

30-day money-back guarantee Unlimited workflows and runs Self-hosted

Customers who run it every day

Rated 4.8 out of 5 by customers
Read more reviews

Was spending much more on Zapier and running out of tasks, now have unlimited tasks. Team is continuing to add integrations and taking feedback. Creator of company is ultra responsive to emails and helpful always.

Brad U.

It's an exceptional product. Works great and extremely valuable. I saved thousands of dollard on Zapier, as Flowmattic makes me able to host the automation myself. And very deeply integrates with the products I need.