# Run another flow and wait

> Starts another flow of this workspace on the same documents and waits until it finishes. Then you can go on by what it did, such as its status or the fields it found. The other flow keeps its own settings, connections and cost.

Source: https://docs.go-lumen.ai/reference/steps/run-flow

## At a glance

| Property | Value |
| --- | --- |
| **Step name** | `run-flow` |
| **Resource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palette group, category** | control, logic |
| **Credits** | **0** credits each time it succeeds |
| **Side effects** | yes: It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it. |
| **Installation must provide** | nothing |

## Inputs

| Property | Value |
| --- | --- |
| **Needs** | nothing |
| **Produces** | `fields` |
| **Works on** | item: one document at a time |

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See [Documents and data](https://docs.go-lumen.ai/concepts/how-flows-run.md#documents-and-data).

## Outputs

A later node references an output as `{nodeId.field}` in text, or `nodeId.field` in a condition.

| Output | Type |
| --- | --- |
| `childRun` | string |
| `flow` | string |
| `status` | string |
| `outcome` | string |
| `error` | string |
| `timedOut` | boolean |
| `output` | object |

## Settings

Set under `config:` on the flow node. Text settings may contain `{nodeId.field}` placeholders.

| Setting | Type | Default | Description |
| --- | --- | --- | --- |
| `flow` (required) | string |  | One of this workspace's flows that starts with 'Another flow starts it'. The step starts it on the same documents and waits for it to finish. (minLength 1; maxLength 253) |
| `timeoutHours` | integer | `168` | TimeoutHours is how long to wait for the child; unset is 168 (7 days). (minimum 1; maximum 720) |
| `onTimeout` | string | `"fail"` | OnTimeout is what the step does when the child is not done in time. (one of fail, continue) |
| `onFailure` | string | `"fail"` | OnFailure is what the step does when the child fails. (one of fail, continue) |

The full JSON Schema of these settings: [run-flow.schema.json](https://docs.go-lumen.ai/schemas/steps/run-flow.schema.json).

## Example

Hand an email to the price list flow

```yaml title="config"
flow: price-list-update
timeoutHours: 72
```

## Use it in a flow

A node that runs `run-flow` goes under `spec.nodes` of a [Flow](https://docs.go-lumen.ai/concepts/how-flows-run.md#the-flow-as-yaml). Give it any id, and list the next node ids in next.

```yaml title="flow.yaml (spec.nodes)"
- id: run-flow
  stepRef: {name: run-flow}
  config:
    flow: price-list-update
    timeoutHours: 72
```
