# 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/de/reference/steps/run-flow

## Auf einen Blick

| Eigenschaft | Wert |
| --- | --- |
| **Schrittname** | `run-flow` |
| **Ressource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palettengruppe, Kategorie** | control, logic |
| **Credits** | **0** Credits bei jedem Erfolg |
| **Externe Wirkung** | ja: Er ändert etwas außerhalb von Lumen, deshalb fragt ein Wiederholungsversuch vorher nach, und ein Test zeigt, was er tun würde, statt es zu tun. |
| **Die Installation muss bereitstellen** | nichts |

## Eingaben

| Eigenschaft | Wert |
| --- | --- |
| **Braucht** | nichts |
| **Liefert** | `fields` |
| **Arbeitet auf** | item: einem Dokument nach dem anderen |

Braucht und Liefert sind Datentypen (file, text, fields, email). Der Editor bietet einen Schritt nur dort an, wo das, was er braucht, schon auf dem Pfad liegt. Siehe [Dokumente und Daten](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#documents-and-data).

## Ausgaben

Ein späterer Knoten verweist auf eine Ausgabe als `{nodeId.field}` in einem Text oder als `nodeId.field` in einer Bedingung.

| Ausgabe | Typ |
| --- | --- |
| `childRun` | string |
| `flow` | string |
| `status` | string |
| `outcome` | string |
| `error` | string |
| `timedOut` | boolean |
| `output` | object |

## Einstellungen

Wird unter `config:` im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie `{nodeId.field}` enthalten.

| Einstellung | Typ | Standardwert | Beschreibung |
| --- | --- | --- | --- |
| `flow` (erforderlich) | 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) |

Das vollständige JSON Schema dieser Einstellungen: [run-flow.schema.json](https://docs.go-lumen.ai/schemas/steps/run-flow.schema.json).

## Beispiel

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

## Im Flow verwenden

Ein Knoten, der `run-flow` ausführt, steht unter `spec.nodes` eines [Flow](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#the-flow-as-yaml). Geben Sie ihm eine beliebige id und nennen Sie in next die ids der nächsten Knoten.

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