Skip to content

Example Flow: SMS Chatbot with Twilio and OpenAI

Flow Description:

A SMS Chatbot sends SMS automatically from a Twilio Messaging Service to an OpenAI as a chat prompt.

Goal:

A SMS Chatbot sends SMS from Twilio to OpenAI.

Prerequisites

  1. This guide assumes you have already connected the Twilio and OpenAI apps.
  2. A Messaging Service has been configured on Twilio. Click this link to learn how to set up a Messaging Service on Twilio.

Steps:

  1. Go to the Flows page on Mation. Click the + button to create a flow. Example_Flow_SMS_Chatbot_Twilio_OpenAI_01.jpg

  2. Name your flow with an appropriate name.

    NOTE

    You may edit your flow name at any time. You don't need to unpublish a flow to rename it.

    Example_Flow_SMS_Chatbot_Twilio_OpenAI_02.jpg

  3. Choose Twilio as application from the dropdown list. Example_Flow_SMS_Chatbot_Twilio_OpenAI_03.jpg

  4. Choose Receive SMS as the Trigger event. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_04.jpg

  5. Choose your connection from the dropdown list. Click the Continue button. Example_Flow_SMS_Chatbot_Twilio_OpenAI_05.jpg

  6. Choose your To number from the dropdown list. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_06.jpg

  7. Click the Test & Continue button to test the Trigger step. Example_Flow_SMS_Chatbot_Twilio_OpenAI_07.jpg

  8. Don't worry about the error message. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_08.jpg

  9. The Action step is now ready for configuration. Example_Flow_SMS_Chatbot_Twilio_OpenAI_09.jpg

  10. Choose OpenAI as application from the dropdown list. Example_Flow_SMS_Chatbot_Twilio_OpenAI_10.jpg

  11. Choose Send chat prompt as the Action event from the dropdown list. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_11.jpg

  12. Choose Mation Integration (in your case whatever you named it) as the connection from the dropdown list. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_12.jpg

  13. Choose gpt-4 as Model from the dropdown list. Click the Continue button.Example_Flow_SMS_Chatbot_Twilio_OpenAI_13.jpg

  14. Click the Test & Continue button to test the Action step.Example_Flow_SMS_Chatbot_Twilio_OpenAI_14.jpg

  15. Click the Continue button to finish the setup. Example_Flow_SMS_Chatbot_Twilio_OpenAI_15.jpg

  16. Your flow is now configured. Click the Publish button. Example_Flow_SMS_Chatbot_Twilio_OpenAI_16.jpg

  17. If you would like to edit your new flow, Click the Unpublish button. Alternatively click the < button in the top left corner of this page to navigate to the Flows page. Example_Flow_SMS_Chatbot_Twilio_OpenAI_17.jpg

  18. Your new flow is ready and running! Example_Flow_SMS_Chatbot_Twilio_OpenAI_18.jpg