docs/install/configure-operate/separate-workers.mdx
Benefits of separating workers from the main application (APP):
```bash
npx @activepieces/cli workers token
```
When prompted, enter the same `AP_JWT_SECRET` used for the app server. The generated token will be displayed in your terminal — copy it and use it in the next step.
```bash
AP_CONTAINER_TYPE=WORKER
# the public URL of your instance — the worker reaches the app at $AP_FRONTEND_URL/api
AP_FRONTEND_URL=https://your-instance-url
AP_WORKER_TOKEN=<token from the first step>
AP_WORKER_CONCURRENCY=1
AP_REUSE_SANDBOX=true
AP_EXECUTION_MODE=SANDBOX_CODE_ONLY
```
<Warning>
On the **APP** machine, set `AP_CONTAINER_TYPE` to `APP`. The default is `WORKER_AND_APP`, so without it the app keeps running an embedded worker.
</Warning>