Skip to main content

Installation

Requires a running Redis server.

AgentQueue

The producer that enqueues agent and workflow jobs.

Constructor

{ host: string; port: number }
required
Redis connection details.
string
default:"agentium:jobs"
Name of the BullMQ queue.
Record<string, unknown>
Default options applied to all jobs (priority, attempts, delay, etc.).

Methods

enqueueAgentRun

Enqueue an agent execution job.

enqueueWorkflow

Enqueue a workflow execution job.

getJobStatus

Get the current status of a job.

cancelJob

Cancel a pending or active job.

Event Handlers

close

Close the queue connection.

AgentWorker

The consumer that processes jobs from the queue.

Constructor

{ host: string; port: number }
required
Redis connection details.
string
default:"agentium:jobs"
Queue name to consume from.
number
default:"5"
Number of jobs processed in parallel.
Record<string, Agent>
required
Map of agent name to Agent instance.
Record<string, Workflow>
Map of workflow name to Workflow instance.

Methods

start

Begin processing jobs from the queue.

stop

Gracefully stop the worker.

Types

JobPayload

JobStatus


Utilities

bridgeEventBusToJob

Bridges agent EventBus events to BullMQ job progress and logs, enabling real-time job status tracking.

Example