Skip to content

@lastshotlabs/slingshot-orchestration-temporal

npm install @lastshotlabs/slingshot-orchestration-temporal

Encode a single Slingshot run tag into a Temporal-safe visibility token.

function buildSearchAttributes(kind: 'task' | 'workflow', name: string, opts?: Pick<RunOptions, 'tenantId' | 'priority' | 'tags'>,): Record<string, string[] | number[]>

Source: packages/slingshot-orchestration-temporal/src/searchAttributes.ts

Encode a single Slingshot run tag into a Temporal-safe visibility token.

function buildVisibilityQuery(filter?: RunFilter): string | undefined

Source: packages/slingshot-orchestration-temporal/src/searchAttributes.ts

Per-workflow concurrency cap for in-flight maybeQueryState polls. Two concurrent callers (e.g. getRun and an onProgress poll tick) both racing against a hung Temporal cluster previously stacked 60+ pending queries per workflow — this Map collapses concurrent calls to a single in-flight query per runId.

function createTemporalOrchestrationAdapter(rawOptions: TemporalOrchestrationAdapterOptions & { structuredLogger?: Logger; logger?: Logger; },): OrchestrationAdapter & SignalCapability & ScheduleCapability & ObservabilityCapability & ProgressCapability & TemporalOrchestrationHealthCapability

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

Running Temporal worker group created for a Slingshot orchestration definition set.

async function createTemporalOrchestrationWorker(rawOptions: TemporalOrchestrationWorkerOptions,): Promise<TemporalOrchestrationWorkerSupervisor>

Source: packages/slingshot-orchestration-temporal/src/worker.ts

Derive the Temporal workflow ID used for a portable run.

When an idempotency key is present the result is deterministic across retries for the same task/workflow name and tenant. Without one, a fresh public run ID is generated.

function deriveTemporalRunId(options: { kind: 'task' | 'workflow'; name: string; tenantId?: string; idempotencyKey?: string; }): string

Source: packages/slingshot-orchestration-temporal/src/ids.ts

Encode a single Slingshot run tag into a Temporal-safe visibility token.

function encodeTag(key: string, value: string): string

Source: packages/slingshot-orchestration-temporal/src/searchAttributes.ts

Encode a single Slingshot run tag into a Temporal-safe visibility token.

function encodeTags(tags?: Record<string, string>): string[]

Source: packages/slingshot-orchestration-temporal/src/searchAttributes.ts

Generate a temporary definitions module that re-exports a set of handlers files so the Temporal worker can import them through a single module path.

async function generateDirectoryDefinitionsModule(options: { outDir: string; files: readonly string[]; }): Promise<string>

Source: packages/slingshot-orchestration-temporal/src/workflowModuleGenerator.ts

Base error for Temporal-specific orchestration failures.

Adds an adapter field so consumers can identify which adapter backend produced the error when multiple orchestration adapters are in use.

function mapTemporalFailure(prefix: string, error: unknown): OrchestrationError

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

Map Temporal workflow execution states onto the portable orchestration run status enum.

function mapTemporalStatus(statusName: string | undefined): RunStatus

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

Validation schema for manifest-style Temporal connection settings.

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

Validation schema for manifest-style Temporal connection settings.

FieldDescription
addressTemporal server host:port address.
defaultActivityTaskQueueDefault task queue for activity tasks when not specified per-activity.
namespaceTemporal namespace to connect to. Defaults to the server default namespace.
tlsTLS configuration for securing the Temporal connection.
workflowTaskQueueTask queue used for dispatching workflow tasks.

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

Validation schema for manifest-style Temporal connection settings.

FieldDescription
buildIdBuild identifier used for Temporal worker versioning.
connectionTemporal NativeConnection or Connection instance for the worker.
defaultActivityTaskQueueDefault task queue for activity tasks when not specified per-activity.
definitionsModulePathAbsolute or resolvable path to the module exporting task and workflow definitions.
eventSinkEvent sink for forwarding worker lifecycle events to the application event bus.
generatedWorkflowsDirDirectory containing generated Temporal workflow bundles.
identityHuman-readable identity string reported to the Temporal server for this worker.
maxConcurrentActivityTaskExecutionsMaximum number of activity tasks executed concurrently by this worker.
maxConcurrentWorkflowTaskExecutionsMaximum number of workflow tasks executed concurrently by this worker.
namespaceTemporal namespace the worker connects to.
ownsConnectionWhen true the worker will close the connection on shutdown.
taskNamesExplicit list of task names to register. When omitted all exported tasks are used.
workflowTaskQueueTask queue the worker polls for workflow tasks.

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

Convert an unknown thrown value into the portable orchestration RunError shape.

function toRunError(error: unknown): RunError

Source: packages/slingshot-orchestration-temporal/src/runError.ts

Base error for Temporal-specific orchestration failures.

Adds an adapter field so consumers can identify which adapter backend produced the error when multiple orchestration adapters are in use.

function wrapTemporalError(message: string, error: unknown): OrchestrationError

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

Base error for Temporal-specific orchestration failures.

Adds an adapter field so consumers can identify which adapter backend produced the error when multiple orchestration adapters are in use.

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

Base error for Temporal-specific orchestration failures.

Adds an adapter field so consumers can identify which adapter backend produced the error when multiple orchestration adapters are in use.

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

Per-workflow concurrency cap for in-flight maybeQueryState polls. Two concurrent callers (e.g. getRun and an onProgress poll tick) both racing against a hung Temporal cluster previously stacked 60+ pending queries per workflow — this Map collapses concurrent calls to a single in-flight query per runId.

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

Validation schema for manifest-style Temporal connection settings.

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

Validation schema for manifest-style Temporal connection settings.

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

Validation schema for manifest-style Temporal connection settings.

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