# Zero-downtime deploys for live voice calls · Vaakyo

> How Vaakyo deploys with blue/green slots: health checks through the edge, switching traffic, moving workers and draining live calls before the old version…

Source: https://vaakyo.com/blog/blue-green-deploys-without-dropping-calls

[← Blog](https://vaakyo.com/blog)

# Deploying without dropping a call: blue/green with draining

A web request lasts milliseconds; a phone call can last ten minutes. How we ship several times a day while calls are live, with two colours, a readiness check and a drain.

The Vaakyo team 18 September 2026 3 min read

-   Engineering
-   Infrastructure

Restarting a web server mid-request costs a retry. Restarting a voice platform mid-call hangs up on someone's customer. Our calls are long-lived streams held open by one process for minutes at a time, and we deploy several times a day. So the deploy has to switch new traffic over without touching calls already in progress.

We use two slots, **blue** and **green** , on the same host, with a small edge proxy in front that sends traffic to one of them.

## What a deploy does

Every push to the main branch builds only the images that changed, then runs one script on the server. If blue is live, it deploys green:

1.  **Pull green's images** and make sure the databases are up. They're shared by both colours and never recreated by a deploy.
2.  **Start green's API** and wait until its readiness check passes: it has finished starting up and can reach the database. Then start green's web container.
3.  **Switch the edge.** Render the proxy config to point at green, test it, and reload. A reload doesn't drop connections the proxy already holds.
4.  **Check through the edge** , not around it. Every response carries a header saying which colour served it. We call the readiness endpoint through the public path until green answers five times in a row.
5.  **Move the background workers.** Stop blue's, start green's. Queued jobs are in Redis, so nothing is lost in between.
6.  **Drain blue.** Poll blue's API for its count of active calls until it reaches zero (or a 15-minute timeout), and only then stop blue.

Step 6 is the part specific to voice. Blue gets no new calls, but it keeps serving the calls it already holds until each one ends naturally.

## Why calls can stay on the old version

A live call's audio is a WebSocket between the phone carrier and one API process. That process holds the conversation, the transcriber and voice connections, and the call's timers. Switching the edge only changes where _new_ connections go, so existing sockets stay on blue.

Hang-ups and other callbacks for a call must also reach the process running it. Each call records the **instance** that runs it, and both colours can look up whether a call is theirs.

## Startup must not close the other colour's calls

When an API starts, it closes calls left open by a crash: calls marked in progress that no process is running. The naive version, "close every open call", would hang up every call on blue each time green starts.

So a starting API closes only:

-   open calls recorded with **its own instance** , which it must have lost when it stopped;
-   open calls older than two hours, which no real call reaches.

It never touches calls belonging to the other colour.

## Rollback is the same move backwards

The script records which images each colour last ran. Rolling back switches the edge to the other colour on those images, with the same readiness checks and the same drain. Because the old colour's containers were stopped cleanly, not deleted, a rollback is fast.

## What it costs

Two copies of the app share one host for the length of a drain, which is minutes on a busy day. Database changes have to work with both versions at once: add fields before reading them, and keep reading old names until the next release. The same is true of shared Redis keys. That's a discipline, not a feature, and most of our migration code exists to respect it.

In return, deploys are boring: they're frequent and small, and nobody's customer hears a dial tone because we shipped a fix.

[Read next Speech vendors have concurrency limits: counting slots with Redis leases](https://vaakyo.com/blog/speech-vendor-capacity-with-redis-leases)

## Get started **today**

### Talk to an expert

Tell us about your calls. We'll help you plan the agent, the numbers and the rollout for your team.

[Contact sales](https://vaakyo.com/contact#sales)

### Start building

Build an agent and talk to it in your browser in minutes. New workspaces start with ₹100 of free credits.

[Start free](https://console.vaakyo.com/signup)

---

More for agents: https://vaakyo.com/llms.txt · Docs: https://docs.vaakyo.com · Sitemap: https://vaakyo.com/sitemap-index.xml
