Implementation

Limits, Scalability, Constraints

We already presented the limitations the user needs to be aware of in our user docs. In this section, we explain the technological reasons behind these limits. This is critical information for maintaining and understanding the project.

Creating your own Voiceflow diagram

A bot is described as three components coming to one.

1. An assistant is created on Twilio Autopilot to invoke tasks based on user inputs and return a JSON action response.
2. A service is created on Twilio Functions to allow for routing between tasks.
3. A phone number linked to an assistant to forward message responses.

Limits behind SMS on Twilio

Messages are first created on Twilio, put on the outbound queue and then finally the message is delivered via the carrier network.

Messaging

  • ~1 Message Segment per second per phone number.

    • This can vary for different countries and phone number types but the limit is 1 MPS. Twilio uses GSM character encoding with a 153 character message segment.
  • 14,400 Message Segment Outbound Queue Length.

  • ~500 messages per second Inbound Queue.

    • Can handle up to 500 incoming messages per second and make HTTP request to request URL. The request URL in our case would be the phone number webhook. Twilio doesn’t specify if this is across all phone numbers or account-wide.
  • ~100 concurrent requests per account.

  • Currently support only UK long code phone numbers.

    • Limited to only processing long code numbers and no support for shortcode.

Deploying and Maintaining Bots.

Twilio Autopilot

Assistants

The Voiceflow diagram is broken down into tasks and with these tasks, an assistant is built. The limits of these assistants include:

  • 30-day retention for Queries.

  • ~10 Dialogues per second.

    • Able to generate a response to 10 questions per second before other dialogues are put onto queue. Twilio doesn’t specify the size of this queue nor if this is account-wide or per assistant.
  • 16KB for the Assistant Memory.

    • Twilio will store the chain of Yes/No responses between a user and Twilio server and this memory has a limit of 16KB. Given that 5 responses between Twilio and a user has a memory size of ~1.35KB, you can have ~60 back and forth interactions. Exceeding this limit will throw the error: 90100 - Invalid Autopilot Actions JSON. This memory is per user.
  • 16KB for the Actions response.

    • When a Task is triggered, a task is ran by returning the action JSON. The largest action template used is 0.5KB so it is unlikely this is exceeded unless you create your own largest task template. This action response is limited to 16KB.
  • ~10-second request limit for fetching Actions JSON.

Model

After all tasks, samples and fields are defined, you need to create a build for your specific model. The limits of this include:

  • A model must be completed within 60 minutes.

    • Increasing the number of fields, tasks, and samples will increase your build time. A 20 task bot takes ~10 seconds to build.

Simulator

Every time you are testing the bot within the Electron application, you are interacting with Twilio Simulator.

  • Autopilot Dialogue Payload limited to 4KB.

    • Each character is two bytes, so you are limited to sending messages to a maximum of 2048 characters.

      Twilio Services

Functions & Assets

  • An account can have 50 services.

    • A service contains functions (collect.js handler script) and assets (mapping.json) and the limit to this is 50. This limits the number of fully defined bots you can have as each bot requires a service.
  • An account can do up to 100 builds per hour.

    • Builds are packages of Functions and Assets that you bundle together for deployment. Twilio doesn’t specify what happens if this limit is breached.
  • Function execution time is limited to ~10 seconds.

    • Each time collect.js is invoked, it will only be given ~10 seconds to run. Currently collect.js takes ~1 second to respond but if extended it could take longer.
  • 10MB private asset

    • The generated mapping.json is a private asset and can be no larger than 10MB in size. A 15 node diagram on average produces a 1KB file, so you can have an estimated 150,000 nodes before this limit is reached.