Browse Integrate
Integrate · Chat Interfaces

Twilio

Integrating Twilio with your BotDojo account allows you to leverage Twilio's powerful communication capabilities within your BotDojo workflows.

6 min read

Introduction

Integrating Twilio with your BotDojo account allows you to leverage Twilio's powerful communication capabilities within your BotDojo workflows.

This guide provides a step-by-step walkthrough to connect Twilio with your BotDojo account, ensuring a seamless setup process. Follow each step carefully to ensure successful integration.

Prerequisites

Before you begin, ensure you have the following:

  • Twilio Account: If you don't have one, sign up at Twilio.
  • BotDojo Account: Access to your BotDojo account.
  • Active Twilio Phone Number: A phone number purchased from Twilio to integrate with BotDojo.

Getting Twilio Credentials

Follow these steps to obtain your Twilio Account SID and Auth Token, which are essential for integration.

  1. Log in to Twilio

    • Navigate to Twilio Console.
    • Enter your Twilio account credentials to log in.
  2. Access Account Dashboard

    • Upon logging in, you'll be directed to the Account Dashboard.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Copy Credentials
  • Locate your Account SID and Auth Token on this page.

  • Click the Copy buttons next to both Account SID and Auth Token to copy them to your clipboard.

Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

Connecting Twilio to Your BotDojo Account

Now that you have your Twilio credentials, you can connect Twilio to your BotDojo account.

Step 1: Access Twilio Integration in BotDojo

  1. Log in to BotDojo

    • Go to your BotDojo account dashboard.
  2. Navigate to Integrations

    • On the left sidebar panel, click on the Integrations option.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

Step 2: Connect Twilio Integration

  1. Initiate Twilio Connection

    • In the Integrations page, locate the Twilio integration.
    • Click on the Connect button associated with Twilio.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Enter Twilio Credentials

    • A Twilio Integration dialog box will appear.
    • Paste your previously copied Account SID and Auth Token into the respective fields.
    • Click the Connect button to establish the connection.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Access Flows

    • After connecting, navigate to the Flows screen within BotDojo.
    • This screen lists all your existing flows.
    • Open the flow you wish to integrate with Twilio.
Flow Screen
Screenshot previewFlow Screen
Flow Screen
  1. Configure Flow Trigger

    • Inside your selected flow, locate the Trigger Icon in the top right corner.
    • Click on it to open the Flow Triggers dialog box.
Trigger Icon
Screenshot previewTrigger Icon
Trigger Icon
  1. Select Twilio Trigger

    • In the Flow Triggers dialog, look at the left sidebar for different trigger options.
    • Click on Twilio to begin configuring it with your flow.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Generate Configuration URL

    • Upon selecting Twilio, a Generate URL button will appear.
    • Click on Generate URL to create a unique URL for your flow.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Review Configuration Prompt

    • A configuration interface will appear, indicating that the initial setup is complete.
    • However, The configuration is not yet done and some steps are required to finalize the configuration.

Warning If you try to use the integration without performing the additional steps specified below, You will get a configuration error on the call.

Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

Configuring Your Twilio with BotDojo Flow

Step 1: Mapping your Flow input

  1. Map the input to Your Flow

    • Locate the Map To dropdown field in the dialog box.
    • Click on it and select the specific flow input you want to associate with this Twilio integration.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

Step 2: (Optional) Configure Escalation Phone Number

Now, only if you want a flow that has the ability to escalate the conversation to any of your live agent, follow these steps:

  1. Escalation Phone Number Field

    • In the Flow Triggers dialog, find the Escalation Phone Number field.
    • Enter the phone number where live agents are available.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Choose Appropriate Flow

    • In order to be able to escalate your conversation to the agent, make sure you use the following flow only.

    YAML Configuration

    :::info Use the the above YAML to copy the flow in your BotDojo account :::

How to copy flow using YAML

In order to copy the flow using YAML:

  • Click on the Settings icon button on the top right corner.
    Documentation screenshot
    Screenshot previewDocumentation screenshot
    Documentation screenshot
  • A Settings dialog box will appear. Click on the Advanced option in the left sidebar panel.
    Documentation screenshot
    Screenshot previewDocumentation screenshot
    Documentation screenshot
  • A dropdown will open. Click on the YAML/JSON option from the dropdown.
    Documentation screenshot
    Screenshot previewDocumentation screenshot
    Documentation screenshot
  • Now replace the YAML you downloaded with the existing YAML (if there is any) and click on Update Flow File button.
    Documentation screenshot
    Screenshot previewDocumentation screenshot
    Documentation screenshot

You have now copied the flow using YAML file.

  1. Copy the URL

    • In the Flow Triggers dialog box, locate the URL field.
    • Copy the URL provided; you'll need it for Twilio configuration.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Save Your Settings

    • Click on the Save button at the bottom of the dialog box.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

To complete the integration, you need to link your BotDojo flow with the Twilio phone number.

Step 3: Update Twilio Phone Number Settings

  1. Navigate to Phone Numbers in Twilio

    • Return to the Twilio Console.
    • In the left sidebar, click on Phone Numbers to expand the section.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Manage Phone Numbers

    • From the expanded Phone Numbers section, click on Manage.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Select Active Numbers

    • In the subsequent dropdown, select Active Numbers to view all your active Twilio phone numbers.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Choose a Phone Number

    • Click on the specific phone number you want to configure with BotDojo.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Configure Call Settings

    • Now, locate the Voice Configuration section.
    • Find the A call comes in field and select Webhook from its dropdown.
    • Paste the BotDojo URL you copied earlier from the Flow Trigger dialog box into the URL field beside it.

Info

Important: Ensure that you replace any existing URL (if there's any) with the BotDojo URL.

Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot
  1. Save Configuration

    • Scroll to the bottom of the page and click on the Save Configuration button to apply the changes.
Documentation screenshot
Screenshot previewDocumentation screenshot
Documentation screenshot

Finalizing the Integration in BotDojo

  • Now your BotDojo flow is configured with the Twilio phone number.

Tip For voice flows, you can steer the live call either from the End node with escalate_to_agent, hang_up_call, or transfer_phone_number, or from an AI Agent node by calling the built-in Twilio voice tools such as Escalate to Agent, Hang Up, Send DTMF, and Transfer Call. Those tools queue terminal actions until the current spoken reply finishes, and the next turn surfaces a one-shot last_agent_turn_outcome trigger output when a terminal action fires, fails, or is canceled by interruption. AI Agent nodes should wire that output to agent_turn_outcome; terminal actions canceled by interruption use the shape { type: "terminal_action", action, outcome: "canceled", reason: "interrupted" }.

Conclusion

Congratulations! You've successfully integrated Twilio with your BotDojo account. Your Twilio phone number is now configured to interact with your BotDojo flows, enabling automated calls and, optionally, escalation to live agents.