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

POST
/infra/workflows/blueprints
workflows:write0.0000053 tokens

Define a workflow DAG on top of Infra Jobs. payload_template supports {{input.*}}, {{steps..output}}, {{execution.id}}, and {{failure.*}} placeholders. Workflow steps may use immediate, delayed, queue, or pull jobs.

curl
curl -X POST https://api.saasignal.saastemly.com/infra/workflows/blueprints \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name":"example","steps":[]}'
json — 200 OK
{ "status": "ok" }
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.
Body field
Type
Description
name required
string
1–256 chars
description
string
max 1000 chars
steps required
array
1–50 items
max_duration_sec
integer
range ≥1 .. ≤86400
Error responses
400 Bad request
401 Unauthorized
402 Insufficient tokens
429 Rate limited

List Workflow Blueprints

GET
/infra/workflows/blueprints
workflows:read0.0000008 tokens

List workflow blueprints for the current project.

curl
curl https://api.saasignal.saastemly.com/infra/workflows/blueprints \
  -H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
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.
Query param
Type
Description
limit
integer
range ≥1 .. ≤100default 25
cursor
string
Error responses
401 Unauthorized
402 Insufficient tokens
429 Rate limited

Trigger Workflow

POST
/infra/workflows/blueprints/{blueprint_id}/trigger
workflows:write0.0000053 tokens plus standard job-creation charges for each scheduled step

Instantiate a blueprint into a live workflow execution and queue every eligible starting step.

curl
curl -X POST https://api.saasignal.saastemly.com/infra/workflows/blueprints/{blueprint_id}/trigger \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{}'
json — 200 OK
{ "status": "ok" }
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.
Path param
Type
Description
blueprint_id required
string
1–256 chars
Body field
Type
Description
input_data
object
idempotency_key
string
max 128 chars
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
429 Rate limited

Get Workflow Execution

GET
/infra/workflows/executions/{execution_id}
workflows:read0.0000008 tokens

Retrieve workflow execution status, step state, and accumulated outputs.

curl
curl https://api.saasignal.saastemly.com/infra/workflows/executions/{execution_id} \
  -H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
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.
Path param
Type
Description
execution_id required
string
1–256 chars
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
429 Rate limited

Cancel Workflow Execution

POST
/infra/workflows/executions/{execution_id}/cancel
workflows:write0.0000053 tokens

Stop queuing any additional workflow steps. Already running jobs are allowed to finish.

curl
curl -X POST https://api.saasignal.saastemly.com/infra/workflows/executions/{execution_id}/cancel \
  -H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
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.
Path param
Type
Description
execution_id required
string
1–256 chars
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
409 Conflict
429 Rate limited

Resume Workflow Execution

POST
/infra/workflows/executions/{execution_id}/resume
workflows:write0.0000053 tokens plus standard job-creation charges for any re-queued steps

Resume a paused, failed, or cancelled workflow. Provide step_id to retry a failed step, and optionally override_output to mark that step complete with supplied data instead of re-running it.

curl
curl -X POST https://api.saasignal.saastemly.com/infra/workflows/executions/{execution_id}/resume \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{}'
json — 200 OK
{ "status": "ok" }
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.
Path param
Type
Description
execution_id required
string
1–256 chars
Body field
Type
Description
step_id
string
1–128 chars
override_output
object
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
409 Conflict
429 Rate limited