# Where It Runs

> Where the engine is launched and where steps run: your cloud account, local containers, GitHub or GitLab runners.

Web page: https://docs.cadence.ci/en/how-it-works/where-it-runs

A pipeline has two parts that can run in different places: the **engine you launch**, which runs the program from its entrypoint, and the **steps it dispatches**, which run in containers on runners. You choose both, and you can change them without rewriting the pipeline.

```mermaid
flowchart LR
  subgraph launch["Where you launch the engine"]
    laptop["Your machine"]
    gha["GitHub Actions job"]
    glc["GitLab CI job"]
  end

  location{"work_location"}
  cadence(("Cadence.CI"))
  cloud["Instances in your cloud account"]
  compose["Containers next to the engine<br/>Podman or Docker Compose"]

  launch --> location
  location -->|"api (default)"| cadence
  cadence -->|starts and stops| cloud
  location -->|compose| compose
```

With `api`, the default, the engine asks Cadence.CI for a machine for each step, and Cadence.CI starts it in your cloud account, then stops it when the step ends. With `compose`, the steps start as containers on the same machine as the engine.

## Choose Where Steps Run

| Steps run in | How | Good for | Plan |
|---|---|---|---|
| Instances in your cloud account, with a [supported provider](https://docs.cadence.ci/en/how-it-works/clouds.md#supported-cloud-providers) | Default `api` location, cloud account connected in **Clouds** | Production pipelines: the right machine for each step, ARM or x86, at your provider's rates | Access (free) and above |
| Containers on your machine | `--work_location compose` | Trying a pipeline, debugging a step | Access (free) and above |
| Containers in a GitHub or GitLab runner | Reusable workflow or CI/CD component with local distribution | Keeping the runners you already pay for | Access (free) and above |

With `api`, each step declares what it needs (`cpu`, `memory`, `storage`, `arch`) and gets the smallest instance that fits; see [How Instance Selection Works](https://docs.cadence.ci/en/console/clouds.md#how-the-match-happens). With `compose`, a step can only use what the host offers: its architecture and its memory.

## Choose Where You Launch

| Launch from | How |
|---|---|
| Your machine | `melodium run --api-report .melodium-ci/Compo.toml ...` |
| GitHub Actions | [Reusable workflows](https://docs.cadence.ci/en/github/run-on-github.md) |
| GitLab CI | [CI/CD components](https://docs.cadence.ci/en/gitlab/run-on-gitlab.md) |
| Any machine or container that runs Mélodium | `melodium run --api-report .melodium-ci/Compo.toml ...` |

Wherever it is launched, a run appears in the console when the command includes `--api-report` and the `MELODIUM_API_TOKEN` environment variable holds a run token.

## Going Further

- [Quickstart](https://docs.cadence.ci/en/quickstart.md): run the CI/CD template on your cloud account.
- [What Goes Through Cadence.CI](https://docs.cadence.ci/en/how-it-works/data-flows.md): what Cadence.CI receives, and what stays on your side.
- [Connect a Cloud](https://docs.cadence.ci/en/console/clouds.md).
- [Distribute](https://doc.melodium.tech/book/en/release/distribute.html), in the Mélodium Language Book: how an engine hands work to another.
