How to deploy self-hosted agents without disrupting ongoing calls

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

For self-hosted agents, what should be the deployment strategy to not disrupt ongoing calls during release?

Use the drain timeout feature:

Deployment strategy:

  1. Start updated agents
  2. Send SIGTERM to old agents
  3. Old agents will stop receiving new sessions but continue handling existing calls
  4. Once all calls are drained (completed), the old agents will exit

When you send a SIGTERM to the process, existing calls continue and drain naturally. The newly deployed agents will receive new sessions during this period.

Defaults are usually good, but you can adjust the drain timeout based on your expected call duration.