# Crew workflows: multi-step runs across restarts

> Crew workflows chain agent steps such as send, wait for the turn, wait for a signal or watch a pull request, and the engine keeps them across restarts.

- Canonical URL: https://getedith.pro/docs/agents/crew/workflows
- Updated: 2026-12-03

A workflow is a list of steps the agents engine runs in order: send a message to a thread, wait for its turn, wait for a signal, sleep or watch a pull request. The engine keeps each run across restarts, so a workflow that waits overnight for your approval is still waiting after a reboot.

## Use workflows in the app

1. On the Crew page, switch to **Threads**.
2. Press **Workflows** at the bottom of the sidebar.
3. Press **New workflow** and paste the definition into **Workflow JSON**, then press **Save**. See [Write a definition](#write-a-definition) for the format.
4. Right-click the workflow and choose **Run…**. Add **Input JSON (optional)** if the definition reads input, then press **Run**.

Selecting a workflow shows its **Steps**, its **Triggers** with **Copy webhook path**, and its **Runs**. Runs that wait on you are marked **Needs you**. Open one, fill in the **Signal name** and an optional payload under **Send a signal**, and press **Send**. **Cancel run** stops a run. Right-click a workflow for **Edit…**, **Copy definition** and **Delete…**.

## Write a definition

A definition is JSON with a `name`, an optional `description` and a list of `steps`. Every step has a `type` and a `name`.

```json
{
  "name": "fix-and-ship",
  "description": "Fix an issue, wait for review, then open a pull request",
  "steps": [
    {
      "type": "send",
      "name": "fix",
      "provider": "codex",
      "cwd": "/Users/me/code/app",
      "text": "Fix {{input.issue}} and add a test"
    },
    {
      "type": "wait_turn",
      "name": "fixed",
      "thread": "{{steps.fix.thread_id}}"
    },
    { "type": "wait_signal", "name": "review", "signal": "approved" },
    {
      "type": "send",
      "name": "ship",
      "thread": "{{steps.fix.thread_id}}",
      "text": "Commit and open a pull request"
    }
  ]
}
```

Text fields can use `{{input.<key>}}` for the run's input and `{{steps.<name>.<field>}}` for an earlier step's output. A `send` step without a `thread` starts a new thread and reports its `thread_id`.

### Step types

| Type          | Fields                                                                 | What it does                                                                                       |
| ------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `send`        | `text`, optional `thread`, `provider`, `cwd`, `title`, `output_schema` | Send a message to a thread, or start a new one                                                     |
| `wait_turn`   | `thread`, optional `timeout_ms`                                        | Wait until that thread's turn ends                                                                 |
| `wait_signal` | `signal`, optional `channel`, `timeout_ms`                             | Wait until someone sends the named signal                                                          |
| `ask`         | `text`, optional `kind`, `schema`, `timeout_ms`                        | Ask a person a question and wait for the answer                                                    |
| `sleep`       | `ms`                                                                   | Wait a fixed time                                                                                  |
| `pr_watch`    | `until`, optional `params`, `poll_ms`, `timeout_ms`                    | Watch a pull request until it is `merged`, `closed`, `checks_passed`, `checks_failed` or `changed` |
| `store_set`   | `key`, `value`                                                         | Keep a value between runs                                                                          |

### Start runs on their own

A definition can carry `triggers` that start runs without you: `every` with `every_ms`, `daily` with `time_of_day` and optional `weekdays`, or `webhook` with a `name`. List them with:

```sh
ed crew workflows hooks
ed crew workflows hooks fix-and-ship --json
```

A webhook path holds its hook's secret, so share it only with the sender. For a single prompt on a timer, a [schedule](https://getedith.pro/docs/agents/crew/schedules) is simpler.

## From the terminal

Everything above also works from the terminal, which suits scripts.

### Register and start a workflow

```sh
ed crew workflows register fix-and-ship.json
ed crew workflows start fix-and-ship --input '{"issue":"the login redirect"}' --key login-fix
ed crew workflows start --file nightly.json --wait
```

`register` adds a definition, or replaces one with the same name. Runs already started keep the steps they started with.

`start` begins a run. Starting again with the same `--key` returns the same run instead of a second one, so a retried script never duplicates work. `--file` runs a definition without registering it. With `--wait` the command waits and exits 0 when the run completes, 1 when it fails, pauses or is cancelled, and 2 when it waits for a signal.

### Watch runs

```terminal
$ ed crew workflows ls
$ ed crew workflows ls --status waiting
$ ed crew workflows show run_01
$ ed crew workflows wait run_01 --timeout 600
```

`ls` lists runs newest first with what a live run waits on. `show` prints every step with its state, and the outputs once the run completes.

### Answer a waiting run

```sh
ed crew workflows questions
ed crew workflows signal run_01 approved
ed crew workflows signal run_01 choice '{"pick":"b"}'
```

`questions` lists runs waiting for a signal and the signal each one needs. `signal` delivers it, with an optional JSON value. A signal sent before the run reaches its wait step is kept until it does.

### Resume or cancel a run

A run pauses when an agent step fails. A paused run retries on its own, and `resume` retries the failed step now:

```sh
ed crew workflows resume run_01
ed crew workflows cancel run_01
```

`cancel` stops a running, waiting or paused run. A run that already ended is shown and left as it is.

### Manage definitions

```sh
ed crew workflows defs
ed crew workflows def fix-and-ship --json > fix-and-ship.json
ed crew workflows unregister fix-and-ship
```

`unregister` removes the definition and its triggers. Runs already started keep going.

## Where to go next

- [Schedules](https://getedith.pro/docs/agents/crew/schedules)
- [Threads](https://getedith.pro/docs/agents/crew/threads)
- [`ed crew workflows`](https://getedith.pro/docs/agents/crew/cli/workflows)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
