> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/hosting/scaling/queue-mode.md).

# Enable queue mode in Duaer

You can run Duaer in different modes depending on your needs. Queue mode provides the best scalability.
## How it works

In queue mode you run multiple Duaer instances: one main instance receives triggers and generates executions (but does not run them); workers perform the executions. Redis maintains the queue of pending executions.

Flow: the main instance handles timers and webhooks → passes an execution ID to Redis → a worker picks it up → loads digital-organization data from the database and runs → writes results and notifies the main instance.

Use Postgres. Do not let several processes write one SQLite file. Refer to [databases](/hosting/configuration/supported-databases-settings.md).

## Set encryption key for workers

The main instance encryption key must be shared with every worker so workers can decrypt credentials stored in the database.

```
export DUAER_ENCRYPTION_KEY=<main_instance_encryption_key>
```

Refer to [Set a custom encryption key](/hosting/configuration/configuration-examples/encryption-key.md) for the full example.

## View running workers <a href="#view-running-workers" id="view-running-workers"></a>

With queue mode on, the owner and admins of the Duaer instance see every worker connected to it under Settings › Workers: host name, version, uptime, load, pool, and queue. Expand a worker to see its running executions, network interfaces, memory, and performance charts. The page refreshes by itself.

If the list is empty or a worker is missing, that worker is down or cannot reach Redis. Executions then sit in the queue while the main process still looks online. Confirm workers use the same encryption key and database settings as the main process.

On newer versions, manual executions also run on workers. Refer to [concurrency](/hosting/scaling/concurrency-control.md) and [memory](/hosting/scaling/memory-errors.md).
## Questions

### How is queue mode different from regular mode?

In Duaer, regular mode accepts and runs in one process. Queue mode hands executions to workers; the main process queues work through Redis. Every worker needs the same DUAER_ENCRYPTION_KEY.

