Skip to main content
A workflow is a JavaScript program that runs agent steps and gate steps in order. A stored workflow has an flw_ id, but commands address it by its name. Each start makes a workflow run with an flr_ id. For the steps, see Run a workflow.

States

A workflow run has one status. Each step has a state derived from timestamps. It is not stored. A retired workflow cannot start. Its past runs still show and in-flight runs still finish.

Fields

The workflow run, from GET /api/v1/workflows/runs/:workflowRunId:
string
required
Workflow run id, flr_ plus 16 characters.
string
required
Always workflow_run.
string
required
Name of the workflow it runs.
string
required
running, completed, failed or stalled.
object
required
The inputs it started with.
string
Closing summary. Null until the program sets one.
object
The task it is tied to, with id and title. Null when there is none.
object
Open question with id, prompt, options and askedAt. Null when nothing waits on a person.
object
A wait on a branch’s pull request checks, with branch, deadlineAt and checks. Null when not waiting.
string
required
ISO 8601.
string
ISO 8601. Null while running or stalled.
object[]
required
One row per dispatched step, in order.
POST /api/v1/workflows/runs returns the same object with taskId in place of task, and no steps. The workflow, from GET /api/v1/workflows/records/:name:
string
required
Workflow id, flw_ prefix.
string
required
meta.name from the program, lower_snake_case.
string
required
meta.title.
string
meta.description. Null when unset.
object[]
required
Declared inputs, each with key, label, kind and required.
string
required
ask or full. The default for each run.
string
required
The program text.
integer
required
Starts at 1. Each update adds 1.
object
Author agent, with id, name and handle. Null when a person created it.
string
Retire time. Null while live.
string
required
ISO 8601.
string
required
ISO 8601.
workflow list rows also cover built-in programs. Those rows have a null id and version. Each row adds lastRun and runCount.

CLI

API

toolPermissionMode null means the workflow’s default. A stored workflow’s steps default to its author agent. With no author, they default to the agent that started it.

Errors

An unknown workflow name or run id returns 404 resource_not_found. See API errors for the shared codes.

Limits

  • A program’s source is at most 200,000 characters.
  • A workflow name is at most 128 characters.
  • A program declares at most 32 inputs.
  • A gate step’s timeout is 1 to 3,600 seconds.
  • A step result is resent up to 3 times before the run stalls.
  • A list page holds 1 to 100 runs, 25 by default.

Run a workflow

Start a workflow and watch each step.

Run

The run each step dispatches.

Automation

Start a workflow from a GitHub event.

Question

How a stalled or parked workflow asks a person.