> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
last_verified: 2026-10-09
title: Worker
description: Start a Python worker, register components and agents, and connect them to AGNT5
category: Python SDK
hideRightSidebar: true
---

A worker is the process that runs your components. It registers them with AGNT5, receives runs, and executes them. `agnt5 dev` starts it locally and `agnt5 deploy` runs it in an environment.

## `Worker(...)`

```python
import asyncio

from agnt5 import Worker

from my_app.functions import send_email  # noqa: F401  (importing registers the function)
from my_app.workflows import onboarding
from my_app.agents import support_agent
from my_app.tools import lookup_order


async def main() -> None:
    worker = Worker(
        service_name="support",
        service_version="1.0.0",
        workflows=[onboarding],
        agents=[support_agent],
        tools=[lookup_order],
    )
    await worker.run()


if __name__ == "__main__":
    asyncio.run(main())
```

| Parameter | Description |
|---|---|
| `service_name` | The worker's service name. |
| `service_version` | A version string, shown with its components. |
| `coordinator_endpoint` | The AGNT5 coordinator to connect to. `agnt5 dev` and deployments set `AGNT5_COORDINATOR_ENDPOINT` for you. |
| `workflows`, `agents`, `tools`, `scorers` | The components to register. |
| `auto_register` | Register the decorated components found in your package. |

## Registering components

| Component | How it registers |
|---|---|
| Functions (`@function`) | When the module that defines it is imported. |
| Workflows (`@workflow`) | The `workflows` list. |
| Agents (`Agent`) | The `agents` list. |
| Tools (`@tool`) | The `tools` list. |

To check what registered, run `agnt5 components --dev` while `agnt5 dev` is running.

## `await worker.run()`

Connects to AGNT5, registers the components, and serves runs until the process stops.

## `agnt5.yaml`

```yaml
name: support
language: python
worker:
  command: "uv run --no-sync python app.py"
```

## Next steps

* [Getting started](/sdk/python/getting-started.md): a complete project with a worker.
* [Local development](/docs/build/local-development.md): run the worker with `agnt5 dev`.
* [Deploying](/docs/run/deploying.md): run it in an environment.
