How to Handle 507 Errors When Creating Adhoc Bots

Last updated: October 24, 2024

When creating adhoc bots, you may occasionally encounter a 507 error. This article explains what causes this error and how to handle it effectively.

What is a 507 Error?

A 507 error occurs when you try to create an adhoc bot and no bots are available in the "adhoc bot pool". Adhoc bots are created without specifying a join time in advance and are claimed from a pool of idle bots that we scale predictively based on expected load.

How to Avoid 507 Errors

There are two main approaches to avoid or handle 507 errors:

1. Use Scheduled Bots

The most reliable way to avoid 507 errors is to use scheduled bots. These bots have a join time specified in advance through the join_at parameter. When you create a scheduled bot, we launch and reserve a bot specifically for you, guaranteeing it will join the call at the indicated time.

2. Implement Retry Logic

If you need to use adhoc bots and can't predict when you'll need them, implement a retry mechanism in your application. If you receive a 507 error, retry the bot creation request every 30 seconds. The adhoc bot pool is constantly replenished, so retrying after a short delay often resolves the issue.

Additional Information

For more details about adhoc bot pool errors, refer to our error documentation.

Note: It's not possible to reserve a fixed number of bots for your application outside of scheduling them in advance. The adhoc bot pool is designed to handle requests from all users and is dynamically managed based on overall demand.