Rate limits

Meya flows support loops (states can transition to previous states or flow transitioning back to itself) and when combined with (1) asynchronous delays and/or (2) the meya.schedule component, you could either initiate a runaway bot.

To guard against this, we've built in some reasonable limits that work together to keep matters under control:

  1. State transition rate limit
  2. Number of state transitions per "turn"
  3. Number of messages returned per "turn"

πŸ“˜

turn: a consecutive flow sequence that start with an action and then terminates at the end of a flow or waits for user input.

State transition rate limit

If there are too many flow state transitions for a given thread (one bot <> one user) within a short period of time, this may indicate a runaway job or infinite loop. There is a limit of 500 state transitions within each 3 second time period per thread.

How it works: A counter is incremented every time your bot transitions from one state to the next in a flow. When the first transition occurs, the counter starts at 1. If the next transition occurs within 3 seconds after the prior state transition, then the counter goes to 2. This will continue if each reply is less than 3 seconds, until the counter surpasses 500, where Meya will put a hold on any state transitions for 30 seconds for this thread.

πŸ“˜

thread: a conversation between one bot and one user constitutes a thread. If a bot is participating in a group chat, that is also considered a thread.

State transitions per turn

There is a limit of 25 state transitions per turn. If the transition counter reaches 25 within a turn, the bot will step executing any other states and return any messages in it's queue.

Messages per turn

There is a limit 5 outbound messages per turn. The bot will respond with up to 5 messages in a single turn, any other message above 5 will be truncated.