Skip to main content

Queue Overview

Agentium provides a queue system for running agents and workflows as background jobs. Use it when you need to process long-running tasks asynchronously, scale workers independently, or retry failed runs.

Architecture

AgentQueue

Producer. Enqueue agent runs and workflows. Returns job IDs for status tracking.

AgentWorker

Consumer. Processes jobs from the queue using your agent and workflow registries.
Both use BullMQ backed by Redis. You need a running Redis server.

Dependencies

Redis must be running. BullMQ uses it for job storage, scheduling, and coordination.

Quick Start


Job Types


Job Lifecycle

1

Enqueue

Producer adds a job to the Redis-backed queue. Returns jobId.
2

Wait

Job sits in the queue until a worker picks it up.
3

Process

Worker runs the agent or workflow. Progress can be reported via job.updateProgress().
4

Complete or Fail

Result is stored (or error recorded). onCompleted / onFailed handlers fire.

Scaling

  • Run multiple workers on different processes or machines. BullMQ distributes jobs across them.
  • Use concurrency per worker to process several jobs in parallel.
  • Use priority and delay for scheduling.

Next Steps

  • Producer — AgentQueue, enqueue methods, job status
  • Worker — AgentWorker, concurrency, event bridging