# runFlow

The `runFlow` the command allows you to run another test flow or sub-flow from the current flow.

This helps avoid repetition across your tests. For example, you can write a test for **Login** and then reference that test whenever your flow requires sign-in.&#x20;

Not only does this provide less copy and pasting between flows, but it also means you have a single test flow to amend should the login user journey change in your app.

## Examples

To run another flow configured in Moropo

```yaml
- runFlow:
    file: My Login Flow.yaml   # name of the test in Moropo + .yaml
```

Use within your script

```yaml
- launchApp
...
- runFlow:
    file: login.yaml
...
```

Run in-line commands

```yaml
- runFlow:
    commands:
      - tapOn:
          text: "some text"
      - tapOn:
          text: "other text"
```

Run in-line commands (iOS only)

```yaml
- runFlow:
    when:
      platform: iOS
    commands:
        - tapOn:
            text: "some ios specific text"
        - tapOn:
            text: "other ios specific text"
```

Run in-line commands (Android only)

```yaml
- runFlow:
    when:
      platform: android
    commands:
      - tapOn:
          text: "some android specific text"
      - tapOn:
          text: "other android specific text"
```

## Passing environment variables

```yaml
- runFlow: 
    file: login.yaml
    env:
      SOME_KEY: "my value"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moropo.com/creating-tests/commands/runflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
