Skip to content

@lastshotlabs/slingshot-orchestration-engine

npm install @lastshotlabs/slingshot-orchestration-engine

Generate a sortable public orchestration run ID.

The format is run_ plus a Crockford-style timestamp/random suffix so adapters can use the same externally-visible identifier even when the underlying engine keeps its own internal job ID.

function createCachedRunHandle<TOutput>(id: string, loader: () => Promise<TOutput>,): RunHandle<TOutput>

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

Minimal identity of the task or workflow being deduped.

function createIdempotencyScope(target: IdempotencyTarget, options: Pick<RunOptions, 'idempotencyKey' | 'tenantId'>,): string | undefined

Source: packages/slingshot-orchestration-engine/src/idempotency.ts

Create the in-process orchestration adapter.

This adapter is the lightest execution mode: no external infrastructure, no durability across process restarts, and full support for observability/progress within the running process.

function createMemoryAdapter(options: { concurrency?: number; eventSink?: OrchestrationEventSink; maxPayloadBytes?: number; logger?: import('@lastshotlabs/slingshot-core').Logger; /** * Pre-built `HookServices` instance. When provided, the adapter threads it into * workflow `onStart`/`onComplete`/`onFail` hooks and `TaskContext.services`. * Construct via `buildHookServices()` from `@lastshotlabs/slingshot-core` at the * adapter's call site (typically inside the orchestration plugin's * `setupMiddleware`, where `app`/`pluginState`/`bus` are all in scope). * * Omitting this field means hooks see `services: undefined` — appropriate for * tests, standalone scripts, or any setup where the framework state isn't * reachable. */ hookServices?: import('@lastshotlabs/slingshot-core').HookServices; } = {},): OrchestrationAdapter & ObservabilityCapability & SignalCapability & ScheduleCapability &

Source: packages/slingshot-orchestration-engine/src/adapters/memory.ts

Build the portable orchestration runtime from a concrete adapter plus registered task and workflow definitions.

This composition root is intentionally framework-agnostic. It can run in plain scripts, tests, workers, or inside the Slingshot plugin wrapper.

function createOrchestrationRuntime(options: OrchestrationRuntimeOptions,): OrchestrationRuntime

Source: packages/slingshot-orchestration-engine/src/runtime.ts

Create the SQLite-backed orchestration adapter.

This adapter reuses the shared task/workflow runners from the core package while persisting run and step state to SQLite so pending work can resume after restart.

function createSqliteAdapter(options: { path: string; concurrency?: number; eventSink?: OrchestrationEventSink; maxPayloadBytes?: number; logger?: import('@lastshotlabs/slingshot-core').Logger; /** Pre-built `HookServices` for in-process workflow hooks and task contexts. See `createMemoryAdapter` for the same field. */ hookServices?: import('@lastshotlabs/slingshot-core').HookServices; }): OrchestrationAdapter & ObservabilityCapability &

Source: packages/slingshot-orchestration-engine/src/adapters/sqlite.ts

Validate that a public orchestration identifier uses kebab-case.

function defineTask<TInput, TOutput>(config: TaskDefinition<TInput, TOutput>,): ResolvedTask<TInput, TOutput>

Source: packages/slingshot-orchestration-engine/src/defineTask.ts

Reference a task inside a workflow by object or public name.

Prefer passing the resolved task object when authoring nearby code so refactors stay type-safe. String names remain useful for cross-module composition.

function defineWorkflow<TInput, TOutput>(config: WorkflowDefinition<TInput, TOutput>,): ResolvedWorkflow<TInput, TOutput>

Source: packages/slingshot-orchestration-engine/src/defineWorkflow.ts

Generate a sortable public orchestration run ID.

The format is run_ plus a Crockford-style timestamp/random suffix so adapters can use the same externally-visible identifier even when the underlying engine keeps its own internal job ID.

function generateRunId(): string

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

Reference a task inside a workflow by object or public name.

Prefer passing the resolved task object when authoring nearby code so refactors stay type-safe. String names remain useful for cross-module composition.

function parallel<TWorkflowInput = unknown>(steps: StepEntry<TWorkflowInput>[],): ParallelEntry<TWorkflowInput>

Source: packages/slingshot-orchestration-engine/src/defineWorkflow.ts

Reference a task inside a workflow by object or public name.

Prefer passing the resolved task object when authoring nearby code so refactors stay type-safe. String names remain useful for cross-module composition.

function sleep<TWorkflowInput = unknown>(name: string, duration: | number | ((ctx: { workflowInput: TWorkflowInput; results: Record<string, unknown> }) => number),): SleepEntry<TWorkflowInput>

Source: packages/slingshot-orchestration-engine/src/defineWorkflow.ts

Reference a task inside a workflow by object or public name.

Prefer passing the resolved task object when authoring nearby code so refactors stay type-safe. String names remain useful for cross-module composition.

function step<TWorkflowInput = unknown>(name: string, taskOrName: string | AnyResolvedTask, options?: StepOptions<TWorkflowInput>,): StepEntry<TWorkflowInput>

Source: packages/slingshot-orchestration-engine/src/defineWorkflow.ts

Reference a task inside a workflow by object or public name.

Prefer passing the resolved task object when authoring nearby code so refactors stay type-safe. String names remain useful for cross-module composition.

function stepResult<TResult = unknown>(results: Record<string, unknown>, name: string, task?: AnyResolvedTask,): TResult | undefined; export function stepResult<TResult = unknown>( results: Record<string, unknown>, name: string, ): TResult | undefined

Source: packages/slingshot-orchestration-engine/src/defineWorkflow.ts

Error type used by the orchestration runtime, adapters, and plugin helpers.

Consumers should branch on code for durable error handling instead of parsing the message text.

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

Error type used by the orchestration runtime, adapters, and plugin helpers.

Consumers should branch on code for durable error handling instead of parsing the message text.

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

Error type used by the orchestration runtime, adapters, and plugin helpers.

Consumers should branch on code for durable error handling instead of parsing the message text.

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

Error type used by the orchestration runtime, adapters, and plugin helpers.

Consumers should branch on code for durable error handling instead of parsing the message text.

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

Thrown when a workflow lifecycle hook (onStart, onComplete, or onFail) raises and continueOnHookError is not set on the hook configuration. The workflow is failed with a hookFailed failure step.

Source: packages/slingshot-orchestration-engine/src/engine/workflowRunner.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts

Retry policy shared by tasks and step-level overrides.

Source: packages/slingshot-orchestration-engine/src/types.ts