# How agents run

> Understand where your agent runs, what you host, and how a new version reaches callers.

Source: https://docs.vlayers.ai/build/deploy

Kind: Concept

Every call runs on VoiceLayer's own pool of workers, behind its safety checks. You choose how to build the agent, and that choice decides what, if anything, you host.

## Two ways to build, one place to run

| | Flow builder | Voice agent SDK |
|---|---|---|
| Who runs the call | VoiceLayer | VoiceLayer |
| What you host | Nothing | A small worker that serves your code: tools, hooks, a brain |
| Provider keys | Saved under **Settings → Provider accounts**, never in your code | Saved under **Settings → Provider accounts**, never in your process |
| Custom logic | Tool steps call your HTTP API | Any code you write, on your own network |
| VoiceLayer numbers | Yes | Yes |
| Playground | Yes | Yes |
| Text channels (SMS, Discord, chat widget) | Yes | Not yet |

Start with the flow builder: it covers most agents and has nothing to operate. You do not need the SDK for custom logic such as a database lookup or creating a ticket: add a **Call an API** step or register a [tool](https://docs.vlayers.ai/build/tools) that points at an endpoint you host. Reach for the SDK when you need logic the canvas cannot express. You can mix them: a flow can call your API for the hard parts.

## Putting a flow live

1. **Save.** The flow is a draft. Nothing runs.
2. **Publish.** An immutable version is saved and checked. Errors block publishing; warnings do not.
3. **Go live.** Saves, publishes and points the shared runtime at the new version in one step. The agent appears under **Agents**.
4. **Attach a number.** Inbound calls to it run this version. See [Phone numbers](https://docs.vlayers.ai/build/numbers).

You can keep editing the draft while the live version answers calls.

## Rolling out a new version

Each published version is immutable. New calls use the version that is live when they start; calls already in progress finish on the version they started with, so publishing never cuts a call off.

An agent's **Versions** tab holds its draft and live configurations. You can promote a draft to live, split new calls between two versions, and see every published version.

## Code agents

An SDK agent adds a worker you run. It opens one outbound connection to VoiceLayer and holds a worker key, never a provider key or a key to the call infrastructure. How to deploy it, roll workers and roll back is in [Voice agent SDK](https://docs.vlayers.ai/developers/sdks/voice-agents).

## Next steps

- [Flow builder](https://docs.vlayers.ai/build/flow-builder): Build an agent with nothing to host.
- [Voice agent SDK](https://docs.vlayers.ai/developers/sdks/voice-agents): Write an agent in code and run its worker.
- [Limits and troubleshooting](https://docs.vlayers.ai/build/limits): Why an agent shows offline, and other fixes.
