Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Expo EAS Workflows

Run Maestro Flows on Maestro Cloud from EAS Workflows with the maestro-cloud pre-packaged job. Set up the API key, Project ID, and build jobs for Android and iOS.

EAS Workflows includes a pre-packaged maestro-cloud job. It takes the app built by an EAS build job, uploads it with your Flows to Maestro Cloud, and runs them on Maestro Cloud devices.

For Expo's full reference, see Pre-packaged jobs in the Expo documentation.

Maestro Cloud Plan required.

The maestro-cloud job requires a Maestro Cloud account on the Maestro Cloud Plan.

Prerequisites

  • Maestro Cloud Plan: Required for the maestro-cloud job.

  • API key: Get your API key in the Maestro Dashboard Settings.

  • Project ID: Open the Settings menu in the Maestro Dashboard and select the project to see its ID.

  • A project configured for EAS Build: Your eas.json must contain the build profile the workflow uses. See Configure EAS Build in the Expo documentation.

Integration steps

1

Store the API key in EAS

The maestro-cloud job reads the API key from the MAESTRO_CLOUD_API_KEY environment variable by default. You can also pass it with the maestro_api_key parameter.

  1. In the Expo dashboard, open your project's Environment variables page.

  2. Add a variable named MAESTRO_CLOUD_API_KEY with your Maestro Cloud API key as the value.

  3. Set its visibility to Secret. Secret variables are not readable outside of the EAS servers and are obfuscated in EAS Workflows job logs.

  4. Add it to the environment the job runs in. The maestro-cloud job uses the preview environment unless you set environment on the job.

2

Add a build profile for testing

Maestro needs an .apk for Android and a simulator .app for iOS. In eas.json, add a build profile that produces both:

{
  "build": {
    "e2e-test": {
      "withoutCredentials": true,
      "ios": {
        "simulator": true
      },
      "android": {
        "buildType": "apk"
      }
    }
  }
}

Maestro Cloud runs Android apps from ARM APKs. Check the Build your app for the cloud guide for the binary requirements.

3

Organize your Flows

Add your Flow files to a single directory in your repository, for example .maestro/ at the same level as eas.json.

<root>
├── eas.json
├── .maestro/
│   ├── subflows/
│   │   └── LoginSubflow.yaml
│   ├── Login.yaml
│   └── Search.yaml

Subflows

4

Create the workflow

Create a .eas/workflows/ directory at the root of your project and add a workflow file. A build job produces the app, and the maestro-cloud job reads its ID from the build_id output with ${{ needs.<build_job_id>.outputs.build_id }}. The needs keyword makes the maestro-cloud job wait until the build job succeeds.

This workflow builds Android and iOS on every pull request and runs the Flows in .maestro/ on Maestro Cloud.

# .eas/workflows/maestro-cloud.yml
name: Maestro Cloud tests

on:
  pull_request:
    branches: ['*']

jobs:
  build_android:
    name: Build Android
    type: build
    params:
      platform: android
      profile: e2e-test

  build_ios:
    name: Build iOS
    type: build
    params:
      platform: ios
      profile: e2e-test

  maestro_cloud_android:
    name: Maestro Cloud (Android)
    needs: [build_android]
    type: maestro-cloud
    environment: preview
    params:
      build_id: ${{ needs.build_android.outputs.build_id }}
      maestro_project_id: <YOUR_PROJECT_ID>
      flows: ./.maestro
      device_model: pixel_6
      device_os: android-34

  maestro_cloud_ios:
    name: Maestro Cloud (iOS)
    needs: [build_ios]
    type: maestro-cloud
    environment: preview
    params:
      build_id: ${{ needs.build_ios.outputs.build_id }}
      maestro_project_id: <YOUR_PROJECT_ID>
      flows: ./.maestro
      device_model: iPhone-17-Pro
      device_os: iOS-26-2

Replace <YOUR_PROJECT_ID> with your Maestro Project ID.

5

Run the workflow

The workflow above runs automatically when someone opens a pull request. You can also start a workflow manually with the EAS CLI:

eas workflow:run .eas/workflows/maestro-cloud.yml

The maestro-cloud job

The maestro-cloud job uploads the build and your Flows to Maestro Cloud. Most parameters map to a maestro cloud option.

jobs:
  run_maestro_tests:
    type: maestro-cloud
    environment: production | preview | development # optional, defaults to preview
    image: string # optional
    params:
      build_id: string # required
      maestro_project_id: string # required
      flows: string # required
      maestro_api_key: string # optional, defaults to $MAESTRO_CLOUD_API_KEY
      include_tags: string | string[] # optional
      exclude_tags: string | string[] # optional
      maestro_version: string # optional
      maestro_config: string # optional
      device_locale: string # optional
      device_model: string # optional
      device_os: string # optional
      skip_build_check: boolean # optional, defaults to false
      name: string # optional
      branch: string # optional
      async: boolean # optional
    hooks:
      after_checkout: step[] # optional
      before_maestro_cloud: step[] # optional
      after_maestro_cloud: step[] # optional

Parameters

Parameter
Required
Description

build_id

Yes

ID of the build to test. Example: ${{ needs.build_android.outputs.build_id }}.

maestro_project_id

Yes

Your Maestro Project ID. Maps to --project-id.

flows

Yes

Path to a Flow file or a directory of Flows. Maps to --flows.

maestro_api_key

No

Your Maestro Cloud API key. Defaults to the MAESTRO_CLOUD_API_KEY environment variable. Maps to --api-key.

include_tags

No

Only run Flows with these tags. Maps to --include-tags. Example: "pull,push".

exclude_tags

No

Skip Flows with these tags. Maps to --exclude-tags. Example: "disabled".

maestro_version

No

Maestro CLI version to use. Defaults to the version preinstalled on the image, or the latest version if none is found. Set to latest to always install the newest version.

maestro_config

No

Path to a Maestro config.yaml file. Maps to --config. Example: .maestro/config.yaml.

device_locale

No

Device locale. Maps to --device-locale. Example: de_DE.

device_model

No

Device model to run against. Maps to --device-model. Example: pixel_6, iPhone-17-Pro.

device_os

No

OS version to run against. Maps to --device-os. Example: android-34, iOS-26-2.

skip_build_check

No

Skip the check that an iOS build is a simulator build. Defaults to false.

name

No

Name of the upload. Maps to --name.

branch

No

Branch the upload originated from. When the workflow run is triggered from GitHub, EAS uses the run's branch by default. Maps to --branch.

async

No

Exit after the upload without waiting for results. When true, the job status only shows whether the upload succeeded. Maps to --async.

Hooks

  • after_checkout: steps to run after the job checks out your project.

  • before_maestro_cloud: steps to run before the Maestro Cloud upload.

  • after_maestro_cloud: steps to run after the Maestro Cloud upload.

Outputs

A later job that lists the maestro-cloud job in needs or after can read these outputs, for example with ${{ after.maestro_cloud_android.outputs.maestro_cloud_url }}.

Output
Description

maestro_cloud_url

URL of the upload results page in Maestro Cloud.

total_flows_count

Number of Flows that ran.

successful_flows_count

Number of Flows with status SUCCESS or WARNING.

failed_flows_count

Number of Flows with status ERROR or STOPPED.

successful_flow_names_json

JSON array with the names of the successful Flows.

failed_flow_names_json

JSON array with the names of the failed Flows.

With async: true, only maestro_cloud_url is guaranteed to be valid. The other outputs can be empty because the job does not wait for the Flows to run.

This example sends the Flow counts to Slack after the Maestro Cloud run. It uses the EAS slack job, which reads a webhook URL from the SLACK_WEBHOOK_URL environment variable.

after runs the notify job once maestro_test finishes, whether the Flows pass or fail. Add SLACK_WEBHOOK_URL to the environment the notify job uses.

Pass variables to your Flows

The maestro-cloud job passes environment variables that start with MAESTRO_ to your Flows. Set them with env on the job. See Accessing shell variables for details.

Find device models and OS versions

The device_model and device_os values for the maestro-cloud job are the same values the maestro cloud command accepts. To list them, run:

The command lists the devices available on Maestro Cloud, grouped by platform. For more details, see Configure the OS.

View results

  • Maestro Cloud dashboard: Each maestro-cloud run creates an upload in the Maestro Dashboard. The maestro_cloud_url output links to its results page.

  • EAS workflow run: Each job shows its status and logs in the EAS dashboard. Without async, a maestro-cloud job fails when Flows fail.

Troubleshooting

  • Missing API key: Set the maestro_api_key parameter or the MAESTRO_CLOUD_API_KEY environment variable. Check that the variable exists in the environment the job runs in, which is preview unless you set environment.

  • iOS build check fails: Unless skip_build_check is true, the job checks that an iOS build is a simulator build. Use a build profile with "ios": { "simulator": true }.

  • Unsupported device: Run maestro list-cloud-devices and use a device_model and device_os value from its output.

  • Job passes but Flows failed: With async: true, the job status only reflects the upload. Check the results in the Maestro Dashboard, or remove async to make the job wait for the Flows.

Next steps

Now that your CI pipeline is connected, consider optimizing your cloud runs:

Last updated