> For the complete documentation index, see [llms.txt](https://docs.runway.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.runway.team/api/configuration-as-code/examples.md). Agents can also search and read this documentation through its [MCP server](https://docs.runway.team/~gitbook/mcp).

# Examples

These examples walk through common changes, like creating an app, adding a destination, or setting up your CI to plan and apply the file. Each one is shown as a change to an exported file: lines starting with `+` are added, lines starting with `-` are removed, and the rest show where the change goes.

Once you've made a change:

1. [Plan](https://docs.runway.team/api/configuration-as-code#plan) the file
2. Review the changes
3. [Apply](https://docs.runway.team/api/configuration-as-code#apply) the plan through the public API or MCP

For what each field does, see the [File reference](https://docs.runway.team/api/configuration-as-code/file-reference).

### Examples

* [Create an app](#create-an-app)
* [Add a destination](#add-a-destination)
* [Remove a destination](#remove-a-destination)
* [Add a step](#add-a-step)
* [Remove or move a step](#remove-or-move-a-step)
* [Connect an integration](#connect-an-integration)
* [Customize an automation only for hotfixes](#customize-an-automation-only-for-hotfixes)
* [Send a notification to another channel for one step](#send-a-notification-to-another-channel-for-one-step)
* [CI/CD pipeline](#ci-cd-pipeline)
* [Spot changes made in Runway](#spot-changes-made-in-runway)

### Create an app

The easiest way to create an app is to start from one that's already set up the way you want. [Export](https://docs.runway.team/api/configuration-as-code#export) it, remove `app.id`, and give the new app its name:

```diff
 version: 2

 app:
-  id: acme-ios
-  name: Acme
+  name: Acme Beta
   appGroup: Consumer apps
```

The new app gets everything else in the file: its destinations, integrations, steps, automations, notifications and so on. Keys from the export, like `$ci`, become the new app's keys too.

{% hint style="info" %}
Check notification mentions and checklist owners before planning. People who will not be members of the new app can't be mentioned or own items there.
{% endhint %}

{% hint style="info" %}
Integrations must already be connected via Runway's UI prior to referencing an integration with Configuration as code. Review [Connect an integration](#connect-an-integration) for more details.
{% endhint %}

Plan the file, then apply it. Once the apply finishes, the plan's `appId` is the new app's ID.

{% hint style="warning" %}
If applying fails partway, the new app stays. **Apply the same plan again** to finish it. Don't plan the file again without an app ID, or you'll create a second app: add `app.id` with the new app's ID first.
{% endhint %}

**Starting from scratch**

Without an app to start from, write the file yourself. A new app starts with no steps, so the file lists every step, the destinations each one serves, and the order they show in. The app's platform comes from its destinations. This is the smallest iOS app:

```yaml
version: 2

app:
  name: Acme

destinations:
  $main:
    name: iOS
    platform: ios
    appStoreType: AppStoreConnect

flightpath:
  steps:
    $kickoff:
      name: Kickoff
      archetype: kickoff
      destinations: [$main]
    $ci:
      name: CI
      archetype: releaseCandidate
      destinations: [$main]
    $screenshots:
      name: Screenshots
      archetype: screenshots
      destinations: [$main]
    $metadata:
      name: Metadata
      archetype: metadata
      destinations: [$main]
    $submission:
      name: Submission
      archetype: submission
      destinations: [$main]
    $review:
      name: Review
      archetype: storeReview
      destinations: [$main]
    $release:
      name: Release
      archetype: takeoff
      destinations: [$main]
      upstreamCIStep: $ci
    $rollout:
      name: Rollout
      archetype: rollout
      destinations: [$main]
      settings:
        sourceStepConfigId: $release
  stepGraph:
    - groups:
        - steps: [$kickoff]
    - groups:
        - steps: [$ci]
    - groups:
        - steps: [$screenshots]
        - steps: [$metadata]
    - groups:
        - steps: [$submission]
        - steps: [$review]
        - steps: [$release]
        - steps: [$rollout]
```

For an Android app, change the destination:

```diff
 destinations:
   $main:
-    name: iOS
-    platform: ios
-    appStoreType: AppStoreConnect
+    name: Android
+    platform: android
+    appStoreType: GooglePlay
```

For an app with both, start with one platform and add the other in the same file. Reference [Add a destination](#add-a-destination) for more details.

Any configurations the file leaves out will receive Runway's defaults for a new app. You can add integrations, automations, notifications and more to the same file, or apply them later with `app.id` set.

### Add a destination

Add the destination, a step of each type it needs, and add it to the shared steps that should serve it, like kickoff and CI. This adds Android to an existing iOS Flightpath:

```diff
 destinations:
   $ios:
     name: iOS
     platform: ios
     appStoreType: AppStoreConnect
+  $android:
+    name: Android
+    platform: android
+    appStoreType: GooglePlay

 integrations:
+  $google_play:
+    type: google
+    provider: google:acme
+    settings:
+      packageName: com.acme.app

 flightpath:
   steps:
     $kickoff:
       name: Kickoff
       archetype: kickoff
       destinations:
         - $ios
+        - $android
     $ci:
       name: CI
       archetype: releaseCandidate
       destinations:
         - $ios
+        - $android
+    $submission_android:
+      name: Submission (Android)
+      archetype: submission
+      destinations: [$android]
+    $review_android:
+      name: Review (Android)
+      archetype: storeReview
+      destinations: [$android]
+    $release_android:
+      name: Release (Android)
+      archetype: takeoff
+      destinations: [$android]
+      integrations: [$google_play]
+      upstreamCIStep: $ci
+    $rollout_android:
+      name: Rollout (Android)
+      archetype: rollout
+      destinations: [$android]
+      settings:
+        sourceStepConfigId: $release_android
   stepGraph:
     - groups:
-        - steps: [$submission]
-        - steps: [$review]
-        - steps: [$release]
-        - steps: [$rollout]
+        - steps: [$submission, $submission_android]
+        - steps: [$review, $review_android]
+        - steps: [$release, $release_android]
+        - steps: [$rollout, $rollout_android]
```

* The release step's store integration must match the destination's `appStoreType`. To find a provider's value, export an app that already uses it.
* If the destination is missing a step type it needs, the plan will error and tell you which step type is missing.
* New steps need a `tagConfig` and `branchConfig` when the other steps of their type have one. Copy them from those steps.

### Remove a destination

Remove the destination, the steps that only serve it, and its place in the shared steps and the step graph. This undoes the example above, shortened to the release step: remove the other Android steps the same way.

```diff
 destinations:
   $ios:
     name: iOS
     platform: ios
     appStoreType: AppStoreConnect
-  $android:
-    name: Android
-    platform: android
-    appStoreType: GooglePlay

 flightpath:
   steps:
     $ci:
       name: CI
       archetype: releaseCandidate
       destinations:
         - $ios
-        - $android
-    $release_android:
-      name: Release (Android)
-      archetype: takeoff
-      destinations:
-        - $android
   stepGraph:
     - groups:
-        - steps: [$release, $release_android]
+        - steps: [$release]
```

A shared step can't be left with no destination: remove it too, or give it another one.

### Add a step

CI, beta testing, regression testing and approvals steps can be added to an existing app. This adds a beta testing step that uses the CI step's builds:

```diff
 flightpath:
   steps:
     $ci:
       name: CI
       archetype: releaseCandidate
       destinations:
         - $ios
+    $alpha:
+      name: Internal alpha
+      archetype: betaTesting
+      destinations: [$ios]
+      upstreamCIStep: $ci
   stepGraph:
     - groups:
-        - steps: [$ci]
+        - steps: [$ci]
+        - steps: [$alpha]
```

Set the new step's `settings` on a later apply, once it exists.

### Remove or move a step

Remove the step from `flightpath.steps` and from `stepGraph`, and anything that points at it in the same file, like another step's `upstreamCIStep` or an automation's `requiredSteps`:

```diff
 flightpath:
   steps:
-    $alpha:
-      name: Internal alpha
-      archetype: betaTesting
-      destinations:
-        - $ios
-      upstreamCIStep: $ci
   stepGraph:
     - groups:
         - steps: [$ci]
-        - steps: [$alpha]
```

The step's checklist items, automations and notification overrides are removed with it. To reorder steps instead, move CI, beta testing, regression testing or approvals steps within `stepGraph`. Other steps stay where they are.

### Connect an integration

This connects GitHub Actions as the CI step's build system:

1. If the provider isn't connected yet, connect it in Runway first, under **Organization settings → Integrations**.
2. On the same page, open the provider and copy its **Provider ID**.
3. Add the integration with its `type`, the provider ID and its settings, and list it on the steps that use it.

```diff
 integrations:
   $github:
     type: github
     provider: github:4242
     settings:
       repoName: acme-mobile
+  $github_ci:
+    type: github-ci
+    provider: github:4242
+    settings:
+      repoName: acme-mobile
+      workflowId: "1002"

 flightpath:
   steps:
     $ci:
       name: CI
       archetype: releaseCandidate
       integrations:
         - $github
+        - $github_ci
```

Your editor's autocomplete lists each integration type's settings, and planning tells you which ones are required. For values that are IDs, like `workflowId`, the easiest way to find them is to set the integration up once in Runway and export the app.

To switch providers, remove the old integration and add the new one in the same file. Certain integrations, such as version control, only allow you to connect and configure one type.&#x20;

### Customize an automation only for hotfixes

This releases two days after submission for most release types, but releases hotfixes as soon as they pass review:

```diff
 automations:
   steps:
     $release:
       AutoRelease:
-        enabled: false
+        enabled: true
+        relativeTimeTrigger:
+          timing: after
+          relativeDays: 2
+          lifecycleEventType: submit
+        overrides:
+          hotfix:
+            enabled: true
+            completedStepsTrigger:
+              hasCustomRequiredSteps: true
+              requiredSteps: [$review]
```

A trigger set to `null` is turned off. For `timing: onTime`, leave out the `relative*` offsets.

{% hint style="info" %}
Overrides are written whole: anything an override leaves out is off or follows the automation, not what the override had before. To go back to the automation's own values for hotfixes, remove the `hotfix` override.
{% endhint %}

### Send a notification to another channel for one step

This sends "New build available" to a different channel for the beta testing step, and turns it off for the CI step:

```diff
 notifications:
   BUILD_AVAIL:
     enabled: true
     comms:
       channels:
         - C0RELEASES
+    overrides:
+      $beta:
+        comms:
+          channels: [C0BETA]
+      $ci:
+        enabled: false
```

{% hint style="warning" %}
Writing `overrides` replaces all of that notification's overrides, so list every step that should have the override.&#x20;
{% endhint %}

### CI/CD pipeline

Keep your configuration file in your repository, as `runway.yaml`, and let your CI plan and apply it, so every change to your app's setup goes through a pull request.&#x20;

This GitHub Actions workflow plans the file on every pull request that changes it, so you can review the changes in the job's log, and apply those changes once the pull request is merged. Save it as `.github/workflows/runway.yml`, add your API key as the `RUNWAY_API_KEY` secret, and set your organization ID as the `RUNWAY_ORG_ID` variable.

```yaml
name: Runway config
on:
  pull_request:
    paths: [runway.yaml]
  push:
    branches: [main]
    paths: [runway.yaml]

# One plan or apply at a time, so runs don't make each other's plans out of date
concurrency: runway-config

jobs:
  runway:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Plan
        id: plan
        run: |
          curl -sf -X POST "https://api.runway.team/v1/org/${{ vars.RUNWAY_ORG_ID }}/config-file/plan" \
            -H "X-API-KEY: ${{ secrets.RUNWAY_API_KEY }}" -H "Content-Type: application/x-yaml" \
            --data-binary @runway.yaml -o plan.json
          jq '.changes' plan.json
          echo "id=$(jq -r '.planId // empty' plan.json)" >> "$GITHUB_OUTPUT"
      - name: Apply
        if: github.event_name == 'push' && steps.plan.outputs.id != ''
        run: |
          curl -sf -X POST "https://api.runway.team/v1/org/${{ vars.RUNWAY_ORG_ID }}/config-file/apply?planId=${{ steps.plan.outputs.id }}" \
            -H "X-API-KEY: ${{ secrets.RUNWAY_API_KEY }}" -H "Content-Type: application/x-yaml" \
            --data-binary @runway.yaml
          for i in $(seq 1 60); do
            STATUS=$(curl -sf "https://api.runway.team/v1/org/${{ vars.RUNWAY_ORG_ID }}/config-file/plan/${{ steps.plan.outputs.id }}" \
              -H "X-API-KEY: ${{ secrets.RUNWAY_API_KEY }}" | tee result.json | jq -r '.status')
            [ "$STATUS" = applied ] && exit 0
            [ "$STATUS" = failed ] && { jq . result.json; exit 1; }
            sleep 5
          done
          exit 1
```

{% hint style="info" %}
If someone changes the app in Runway between the plan and the apply, applying is refused with a `409`. Re-run the job: the new plan includes their change, so you'll see if your file undoes it.
{% endhint %}

#### Spot changes made in Runway

There are two ways to see the changes made:&#x20;

1. Export the app and diff it with the file in your repository.&#x20;
2. Plan the file: any change in the plan will show the difference between the file and the app.
