@agentium/queue. Read the producer and schedules guide for setup and behavior, or return to the package reference.
A ? marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.
AgentQueue
Sourceexport declare class AgentQueue {
constructor(config: QueueConfig);
enqueueAgentRun(opts: {
agentName: string;
input: string;
sessionId?: string;
tenantId?: string;
userId?: string;
priority?: number;
delay?: number;
attempts?: number;
backoff?: {
type: "exponential" | "fixed";
delay: number;
};
repeat?: {
pattern: string;
timezone?: string;
};
}): Promise<{
jobId: string;
}>;
enqueueWorkflow(opts: {
workflowName: string;
userId?: string;
initialState?: Record<string, unknown>;
sessionId?: string;
tenantId?: string;
priority?: number;
delay?: number;
attempts?: number;
backoff?: {
type: "exponential" | "fixed";
delay: number;
};
repeat?: {
pattern: string;
timezone?: string;
};
}): Promise<{
jobId: string;
}>;
enqueueTeamRun(opts: {
teamName: string;
input: string;
sessionId?: string;
tenantId?: string;
userId?: string;
priority?: number;
delay?: number;
attempts?: number;
backoff?: {
type: "exponential" | "fixed";
delay: number;
};
repeat?: {
pattern: string;
timezone?: string;
};
}): Promise<{
jobId: string;
}>;
getJobStatus(jobId: string): Promise<JobStatus>;
cancelJob(jobId: string): Promise<void>;
onCompleted(handler: (jobId: string, result: RunOutput) => void): void;
onFailed(handler: (jobId: string, error: Error) => void): void;
schedule(opts: ScheduleOptions): Promise<{
jobId: string;
}>;
unschedule(id: string): Promise<void>;
listSchedules(): Promise<ScheduleInfo[]>;
/** BullMQ v5 maintenance only. Never silently converts persisted legacy repeat records. */
listLegacySchedules(): Promise<Array<{
key: string;
name: string;
pattern?: string;
timezone?: string;
next: number;
}>>;
pause(): Promise<void>;
resume(): Promise<void>;
/** Maintenance-only removal: callers retain inventory/payload backups and stop concurrent schedule writers. */
removeLegacySchedule(key: string): Promise<void>;
close(): Promise<void>;
}
JobStatus, QueueConfig, RunOutput, ScheduleInfo, ScheduleOptions.
QueueConfig
Sourceexport interface QueueConfig {
connection: {
host: string;
port: number;
password?: string;
db?: number;
tls?: boolean;
} | string;
queueName?: string;
defaultJobOptions?: Record<string, unknown>;
}
ScheduleOptions
Sourceexport interface ScheduleOptions {
id: string;
cron: string;
timezone?: string;
agent?: {
name: string;
input: string;
sessionId?: string;
userId?: string;
tenantId?: string;
};
workflow?: {
name: string;
initialState?: Record<string, unknown>;
sessionId?: string;
userId?: string;
tenantId?: string;
};
team?: {
name: string;
input: string;
sessionId?: string;
userId?: string;
tenantId?: string;
};
}