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.
Prerequisites
Maestro Cloud Plan: Required for the
maestro-cloudjob.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
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.
In the Expo dashboard, open your project's Environment variables page.
Add a variable named
MAESTRO_CLOUD_API_KEYwith your Maestro Cloud API key as the value.Set its visibility to Secret. Secret variables are not readable outside of the EAS servers and are obfuscated in EAS Workflows job logs.
Add it to the environment the job runs in. The
maestro-cloudjob uses thepreviewenvironment unless you setenvironmenton the job.
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-2Replace <YOUR_PROJECT_ID> with your Maestro Project ID.
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[] # optionalParameters
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 }}.
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.
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-cloudrun creates an upload in the Maestro Dashboard. Themaestro_cloud_urloutput links to its results page.EAS workflow run: Each job shows its status and logs in the EAS dashboard. Without
async, amaestro-cloudjob fails when Flows fail.
Troubleshooting
Missing API key: Set the
maestro_api_keyparameter or theMAESTRO_CLOUD_API_KEYenvironment variable. Check that the variable exists in the environment the job runs in, which ispreviewunless you setenvironment.iOS build check fails: Unless
skip_build_checkistrue, 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-devicesand use adevice_modelanddevice_osvalue 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 removeasyncto make the job wait for the Flows.
Next steps
Now that your CI pipeline is connected, consider optimizing your cloud runs:
Configure the operating system for your runs to match your application and dependency requirements.
Define locales and time zones to ensure consistent behavior across environments and regions.
Explore all the subcommand options for
cloud.
Last updated