@lastshotlabs/slingshot-orchestration-bullmq
npm install @lastshotlabs/slingshot-orchestration-bullmq
Functions
Section titled “Functions”classifyOrchestrationError
Section titled “classifyOrchestrationError”Outcome of error classification used to decide retry vs. fail-fast.
permanent: true means the error must surface to the caller without retry.
function classifyOrchestrationError(err: unknown): ErrorClassificationSource: packages/slingshot-orchestration-bullmq/src/errorClassification.ts
createBullMQOrchestrationAdapter
Section titled “createBullMQOrchestrationAdapter”BullMQ-backed Slingshot orchestration adapter.
Composition root that wires together state machine, cancellation, scheduling, and observability modules.
function createBullMQOrchestrationAdapter(rawOptions: BullMQOrchestrationAdapterOptions & { eventSink?: OrchestrationEventSink; workflowConcurrency?: number; structuredLogger?: Logger; /** * Optional `HookServices` for in-process workflow hooks and task contexts. * Provided by the orchestration plugin when the bullmq worker is colocated * with the main app process. When the worker runs in a separate process * (no app reference), omit this and tasks/hooks see `services: undefined`. */ hookServices?: import('@lastshotlabs/slingshot-core').HookServices; },): OrchestrationAdapter & ObservabilityCapability & ScheduleCapability & BullMQOrchestrationMetricsCapability & BullMQOrchestrationResetCapability & BullMQOrchestrationHealthCapabilitySource: packages/slingshot-orchestration-bullmq/src/adapter.ts
createBullMQTaskProcessor
Section titled “createBullMQTaskProcessor”Local stand-in for BullMQ’s UnrecoverableError. BullMQ’s runtime checks
err.name === 'UnrecoverableError' to short-circuit retry, so a class with
that name is treated identically without taking a hard import dependency on
a symbol that bullmq’s CJS bundle does not always re-export.
function createBullMQTaskProcessor(options: { taskRegistry: Map<string, AnyResolvedTask>; eventSink?: OrchestrationEventSink; logger?: Logger; /** * Optional `HookServices` to thread into every task's `TaskContext.services`. * Provided by the bullmq adapter when the task worker shares a process with * the main app. When the worker runs in a separate process (services * unreachable), this is omitted and tasks see `services: undefined`. */ hookServices?: import('@lastshotlabs/slingshot-core').HookServices; }): voidSource: packages/slingshot-orchestration-bullmq/src/taskWorker.ts
createBullMQWorkflowProcessor
Section titled “createBullMQWorkflowProcessor”Create the BullMQ workflow processor that walks workflow steps and dispatches child task jobs onto the appropriate BullMQ queues.
function createBullMQWorkflowProcessor(options: { workflowRegistry: Map<string, AnyResolvedWorkflow>; taskRegistry: Map<string, AnyResolvedTask>; getTaskQueue(taskName: string): Queue; getTaskQueueEvents(taskName: string): QueueEvents; eventSink?: OrchestrationEventSink; logger?: Logger; /** * Optional `HookServices` for workflow `onStart`/`onComplete`/`onFail` hooks. * Provided by the bullmq adapter when the worker process is also the main app * process (services accessible). When the worker runs in a separate process * (no app reference), services is `undefined`. */ hookServices?: import('@lastshotlabs/slingshot-core').HookServices; })Source: packages/slingshot-orchestration-bullmq/src/workflowWorker.ts
mapBullMQStatus
Section titled “mapBullMQStatus”Map BullMQ job states onto the portable orchestration run status enum.
function mapBullMQStatus(state: JobState | 'paused' | 'unknown'): RunStatusSource: packages/slingshot-orchestration-bullmq/src/statusMap.ts
Constants
Section titled “Constants”bullmqJobRetentionSchema
Section titled “bullmqJobRetentionSchema”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Config Fields
Section titled “Config Fields”| Field | Description |
|---|---|
removeOnCompleteAge | Seconds to retain completed jobs before removal (default 3600). |
removeOnCompleteCount | Maximum number of completed jobs retained per queue (default 1000). |
removeOnFailAge | Seconds to retain failed jobs before removal (default 86400). |
removeOnFailCount | Maximum number of failed jobs retained per queue (optional). |
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
bullmqOrchestrationAdapterOptionsSchema
Section titled “bullmqOrchestrationAdapterOptionsSchema”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
bullmqTlsOptionsSchema
Section titled “bullmqTlsOptionsSchema”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Config Fields
Section titled “Config Fields”| Field | Description |
|---|---|
ca | PEM-encoded CA certificate used to verify the Redis server certificate. |
cert | PEM-encoded client certificate for mTLS authentication with Redis. |
key | PEM-encoded client private key for mTLS authentication with Redis. |
rejectUnauthorized | Whether to reject connections with unverified TLS certificates. Default true. |
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
Classes
Section titled “Classes”BullMQConnectionError
Section titled “BullMQConnectionError”Errors thrown by the BullMQ orchestration adapter.
Source: packages/slingshot-orchestration-bullmq/src/errors.ts
BullMQOrchestrationError
Section titled “BullMQOrchestrationError”Errors thrown by the BullMQ orchestration adapter.
Source: packages/slingshot-orchestration-bullmq/src/errors.ts
Interfaces
Section titled “Interfaces”ErrorClassification
Section titled “ErrorClassification”Outcome of error classification used to decide retry vs. fail-fast.
permanent: true means the error must surface to the caller without retry.
Source: packages/slingshot-orchestration-bullmq/src/errorClassification.ts
BullMQJobRetentionOptions
Section titled “BullMQJobRetentionOptions”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
BullMQOrchestrationAdapterOptions
Section titled “BullMQOrchestrationAdapterOptions”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
BullMQTlsOptions
Section titled “BullMQTlsOptions”TLS settings forwarded to the underlying ioredis connection. All fields are optional; pass them when connecting to Redis behind TLS (e.g. ElastiCache, Upstash, MemoryStore).
Source: packages/slingshot-orchestration-bullmq/src/validation.ts
Exports
Section titled “Exports”BullMQOrchestrationAdapterMetrics
Section titled “BullMQOrchestrationAdapterMetrics”BullMQ-backed Slingshot orchestration adapter.
Composition root that wires together state machine, cancellation, scheduling, and observability modules.
Source: packages/slingshot-orchestration-bullmq/src/adapter.ts
BullMQOrchestrationHealthCapability
Section titled “BullMQOrchestrationHealthCapability”BullMQ-backed Slingshot orchestration adapter.
Composition root that wires together state machine, cancellation, scheduling, and observability modules.
Source: packages/slingshot-orchestration-bullmq/src/adapter.ts
BullMQOrchestrationMetricsCapability
Section titled “BullMQOrchestrationMetricsCapability”BullMQ-backed Slingshot orchestration adapter.
Composition root that wires together state machine, cancellation, scheduling, and observability modules.
Source: packages/slingshot-orchestration-bullmq/src/adapter.ts
OrchestrationAdapterDisposedError
Section titled “OrchestrationAdapterDisposedError”BullMQ-backed Slingshot orchestration adapter.
Composition root that wires together state machine, cancellation, scheduling, and observability modules.
Source: packages/slingshot-orchestration-bullmq/src/adapter.ts