Search docs ⌘K
esc
Type to search across all documentation pages
Workflows

Workflows

State-machine orchestration on top of Infra Jobs. Workflows turn individual jobs into resumable DAGs with dependency tracking, catch steps, and explicit execution state.

Coordinator, not compute: A workflow stores graph state and queues eligible jobs, but your handlers still do the actual business logic. Pause, inspect, and resume failed runs without rebuilding the whole operation.
Workflow concept
What it does
Example
depends_on
Waits for upstream steps before a step can run
Ship only after payment and inventory both succeed
catch
Routes failure into a compensating step
Refund if shipment booking fails
resume
Re-queues or overrides a failed step
Inject a manual review result and continue

Create Workflow Blueprint

GET
typescript
const blueprint = await ss.infra.workflows.createBlueprint({
  name: 'order-fulfillment',
  steps: [
    {
      id: 'charge',
      job_trigger: { trigger: { type: 'queue', queue: 'payments' } },
      payload_template: { order_id: '{{input.order_id}}' },
    },
    {
      id: 'ship',
      depends_on: ['charge'],
      job_trigger: { trigger: { type: 'queue', queue: 'shipping' } },
      payload_template: {
        order_id: '{{input.order_id}}',
        charge_id: '{{steps.charge.output.charge_id}}',
      },
    },
  ],
})
  1. Open Dashboard → Workflows and select your project
  2. Fill in the blueprint name, optional description, and step JSON
  3. Click Create blueprint to save it and seed the trigger panel
This dashboard is project-scoped. Use Admin v2 when you need cross-project workflow observability.

List Workflow Blueprints

GET
typescript
const { blueprints } = await ss.infra.workflows.listBlueprints({ limit: 20 })
  1. Open Dashboard → Workflows and select your project
  2. Review the Blueprint catalog on the right side of the page
  3. Use Refresh blueprints or Load more to page through the project list
The dashboard lists only the current project. Admin v2 remains the better surface for fleet-wide visibility.

Trigger Workflow

GET
typescript
const run = await ss.infra.workflows.trigger('wf_01JNXS...', {
  input_data: { order_id: 'ord_123' },
  idempotency_key: 'order-ord_123',
})
  1. Open Dashboard → Workflows and select your project
  2. Choose or paste a blueprint ID in the Trigger execution card
  3. Optionally add input data and an idempotency key, then click Trigger
The dashboard auto-loads the execution detail after a successful trigger so you can inspect steps immediately.

Get Workflow Execution

GET
typescript
const execution = await ss.infra.workflows.getExecution('wfexec_01JNXS...')
// execution.status, execution.steps, execution.result
  1. Open Dashboard → Workflows and select your project
  2. Paste the execution ID into Execution controls
  3. Click Inspect to load step states, payloads, and timestamps
This is a project-scoped inspector. Use Admin v2 for broader operational monitoring.

Cancel Workflow Execution

GET
typescript
await ss.infra.workflows.cancel('wfexec_01JNXS...')
  1. Open Dashboard → Workflows and select your project
  2. Load the execution in Execution controls
  3. Click Cancel to stop future dependent steps from being queued
Already-running jobs are allowed to finish; cancel only stops future scheduling.

Resume Workflow Execution

GET
typescript
await ss.infra.workflows.resume('wfexec_01JNXS...', {
  step_id: 'manual-review',
  override_output: { approved: true, reviewer: 'ops-1' },
})
  1. Open Dashboard → Workflows and select your project
  2. Load the execution, then optionally fill in a failed step ID and override output JSON
  3. Click Resume to retry or unblock the graph
Override output is useful for manual recovery when you want to mark a failed step complete without rerunning it.