Skip to content

@lastshotlabs/slingshot-orchestration-bullmq

npm install @lastshotlabs/slingshot-orchestration-bullmq

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): ErrorClassification

Source: packages/slingshot-orchestration-bullmq/src/errorClassification.ts

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 & BullMQOrchestrationHealthCapability

Source: packages/slingshot-orchestration-bullmq/src/adapter.ts

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; }): void

Source: packages/slingshot-orchestration-bullmq/src/taskWorker.ts

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

Map BullMQ job states onto the portable orchestration run status enum.

function mapBullMQStatus(state: JobState | 'paused' | 'unknown'): RunStatus

Source: packages/slingshot-orchestration-bullmq/src/statusMap.ts

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).

FieldDescription
removeOnCompleteAgeSeconds to retain completed jobs before removal (default 3600).
removeOnCompleteCountMaximum number of completed jobs retained per queue (default 1000).
removeOnFailAgeSeconds to retain failed jobs before removal (default 86400).
removeOnFailCountMaximum number of failed jobs retained per queue (optional).

Source: packages/slingshot-orchestration-bullmq/src/validation.ts

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

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).

FieldDescription
caPEM-encoded CA certificate used to verify the Redis server certificate.
certPEM-encoded client certificate for mTLS authentication with Redis.
keyPEM-encoded client private key for mTLS authentication with Redis.
rejectUnauthorizedWhether to reject connections with unverified TLS certificates. Default true.

Source: packages/slingshot-orchestration-bullmq/src/validation.ts

Errors thrown by the BullMQ orchestration adapter.

Source: packages/slingshot-orchestration-bullmq/src/errors.ts

Errors thrown by the BullMQ orchestration adapter.

Source: packages/slingshot-orchestration-bullmq/src/errors.ts

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

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

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

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

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

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

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

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