In Parts 1 and 2, every Cloud run started with you typing a command. That's fine for trying Cloud out but it isn't how a team works. A team needs every pull request tested automatically and a merge blocked when a flow fails.
This part turns Cloud into that. By the end, you'll know how to:
- Run Cloud from GitHub Actions on every pull request
- Show a Maestro Cloud check on the pull request and block merges when it fails
- Understand what happens when two uploads reach Cloud at the same time
- Stop runs for commits that no longer matter
- Keep secrets and test data working when the flows run on Maestro's machines
💡 Disclosure: Maestro gave me one month of free Maestro Cloud access (2 Android devices, 1 iOS device) for this series. They had no input on this article and everything here, including the limitations, is my own assessment.
Run Cloud From GitHub Actions
Running maestro cloud from your terminal is a good way to check that everything works. But the real goal is to have your tests run automatically every time someone opens a pull request. Maestro has an official GitHub Action that does exactly this: mobile-dev-inc/action-maestro-cloud.
Before the workflow can talk to Maestro Cloud, GitHub needs two values from your Maestro account. In your repository, go to Settings → Secrets and variables → Actions and add them:
| Name | Where to add it | Why |
|---|---|---|
MAESTRO_API_KEY |
Secrets tab | It's your password to Maestro Cloud, so it must stay hidden. |
MAESTRO_PROJECT_ID |
Variables tab | It only identifies your project. It isn't sensitive. |
⚠️ It's tempting to add both as secrets but don't. GitHub replaces every secret with***in the job log and this includes the project ID inside the Console link the job prints at the end. The link then looks like.../project/***/...and doesn't open. As a variable, the ID shows up and the link works.
Then save this as .github/workflows/maestro-cloud.yaml:
# .github/workflows/maestro-cloud.yaml
name: Maestro Cloud
on:
pull_request:
jobs:
test-android-cloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download the demo app
run: curl -fsSL -o app.apk https://github.com/webdriverio/native-demo-app/releases/download/v2.2.0/android.wdio.native.app.v2.2.0.apk
- name: Run flows on Maestro Cloud
uses: mobile-dev-inc/action-maestro-cloud@v3.1.0
with:
api-key: ${{ secrets.MAESTRO_API_KEY }}
project-id: ${{ vars.MAESTRO_PROJECT_ID }}
app-file: app.apk
workspace: flows
include-tags: smoke
env: |
APP_ID=com.wdiodemoappIf you followed Maestro in GitHub Actions, you'll notice this workflow is much shorter than maestro-android.yaml. There's no KVM step, no JDK, no Maestro install and no emulator to boot. That's because the tests no longer run on the GitHub runner. They run on Maestro Cloud's devices, so the job only has three steps:
- Check out the repository which contains your flows.
- Download the app.
- Send both to Maestro Cloud and wait for the result.
Here's what each input in the with: block does:
| Input | What it does | Value in this workflow |
|---|---|---|
api-key |
Logs in to your Maestro Cloud account. | The MAESTRO_API_KEY secret |
project-id |
Tells Cloud which project the run belongs to. | The MAESTRO_PROJECT_ID variable |
app-file |
The app to install on the Cloud devices. | app.apk, downloaded in step 2 |
workspace |
The folder that holds your flows. The default is .maestro, so you need this line when your folder has another name. |
flows |
include-tags |
Runs only the flows with these tags (comma-separated), like --include-tags on the command line. |
smoke, as in Article 3 |
env |
Environment variables for the flows, one KEY=value per line. |
APP_ID=com.wdiodemoapp |
Two more inputs are useful later, but this workflow doesn't use them:
timeout: how many minutes the action waits for the run to finish. The default is 30.async: start the run and finish the job right away, without waiting for the result.
💡 The Maestro Cloud GitHub Action (mobile-dev-inc/action-maestro-cloud, the last step of the workflow above) isn't a different way of running Maestro Cloud. Behind the scenes, it installs the Maestro CLI on the runner and runs the same maestro cloud command you typed by hand. So everything you set up before still applies:
- Your
config.yamlis read exactly as it is when you run the command yourself. - The device options from Maestro Cloud, Part 2 exist as inputs:
device-model,device-osanddevice-locale.
Version 3.1.0 also adds a priority input set to low, normal or high. When several uploads are waiting at the same time, it decides which one Cloud runs first. You'll see why that matters in Two Uploads at Once below.
💡 Tip: when the run finishes, you'll want to open its results in the Maestro Cloud Console. The action gives you the link to that page in a value called MAESTRO_CLOUD_CONSOLE_URL. To print it at the end of the job log so you can click it straight from the pull request, make two small changes:
- Give the Maestro step an
id(here,maestro), so other steps can refer to it. - Add a step after it that prints the link.
- name: Run flows on Maestro Cloud
id: maestro
uses: mobile-dev-inc/action-maestro-cloud@v3.1.0
with:
# ...same inputs as above...
- name: Show the Console link
if: always()
run: |
echo "Results: ${{ steps.maestro.outputs.MAESTRO_CLOUD_CONSOLE_URL }}"🚨 Warning: keep therun: |form. On one line,run: echo "Results: ..."is invalid YAML because of the colon and space afterResults. GitHub then rejects the whole workflow file and no job runs at all.
✅ If successful, opening a pull request starts the job and it passes in about two minutes. Ours took 1m 52s and 1m 4s of that was the one smoke flow. The last lines of the log show the flow result and the Console link.
💡 What about iOS? This workflow only tests the Android app but iOS works the same way. Only two inputs change:
app-file: the iOS simulator build (a.app) instead of the.apk. The demo app's release ships it zipped (ios.simulator.wdio.native.app.v2.2.0.zip), so unzip it in the download step first.env:APP_ID=org.wdiodemoappinstead ofcom.wdiodemoapp.
You don't need a Mac runner for iOS tests. The runner only sends the app and flows to Maestro Cloud and the tests run on Cloud's iOS simulators. So runs-on: ubuntu-latest works for iOS too. You'd only need a macOS runner to build the iOS app in the same job because Xcode only runs on macOS.
💡 With iOS, you may see this notice in the log:
'app-file' pattern matched 211 files; using .../wdiodemoapp.appIt's not an error. On disk, a .app is a folder with many files inside it. The action counts those files but it still uploads the whole .app which is what you want.
💡 Not on GitHub? Maestro has ready-made integrations for Bitrise, Bitrise, Bitbucket Pipelines, CircleCI and Expo EAS Workflows and everything else, including GitLab CI/CD, Jenkins and Azure DevOps, runs the same maestro cloud command.👍 Best practice: keep pull requests on one configuration and thesmoketag. Run the fullregressionsuite and the OS and locale matrix from Part 2 nightly with ascheduletrigger like the one in Maestro in GitHub Actions.
Get a Status Check on the Pull Request
Your pull request already shows a result: the GitHub Actions job passes or fails along with your flows. But that only tells you whether something failed. To see what failed, you still have to open the job log.
Maestro can add a second check to the pull request with the number of flows that passed and failed and a direct link to the results in the Console. To get it, install the Maestro Cloud GitHub App:
- Open github.com/apps/maestro-cloud-app. You install it from GitHub, not from the Maestro Console.
- Click Install and pick your account.
- Choose Only select repositories and select your repository. The app then can't see the rest of your account.
That's all. You don't need to change the workflow. To post a check, Maestro needs to know which pull request and commit the run belongs to. When the job runs on a pull request, the action reads that information from GitHub and passes it to Maestro for you. It also names the upload after the pull request's title, so you can find it easily in the Console.
💡 Runningmaestro cloudfrom your terminal instead? Then you pass that information yourself, with--branch,--repo-owner,--repo-name,--pull-request-idand--commit-sha.
✅ If successful, the next commit on the pull request shows two checks: your GitHub Actions job and one from the Maestro Cloud App named after your app ID and platform: Robin - com.wdiodemoapp (ANDROID). Don't look for a check called "Maestro Cloud". Both checks pass when every flow passes and both fail when any flow fails.
💡 Tip: click Details on the Robin check (or open the pull request's Checks tab) to see the results without leaving GitHub. The page shows the passed and failed count, then a table with each flow's name, status and run time. Each flow has an Inspect link that opens it in the Maestro Console and a Maestro Console link above the table opens the whole upload.

Block Merges When a Flow Fails
When a flow fails both checks turn red and the Robin check shows how many flows failed (ours said 1 / 1 Failed). To try it we pushed a commit with a broken flow:

⚠️ Watch out: a red check is only a warning. It doesn't stop anyone from merging. Look at the screenshot above: both checks failed and the Merge pull request button turned grey instead of green. But it's still enabled and GitHub still says "Merging can be performed automatically". Anyone can click it and merge the broken code.
To stop merges when tests fail, make the check required: go to Settings → Branches and add a branch protection rule for your main branch. Whether you can do this depends on your GitHub plan:
| Repository | Free plan | GitHub Pro or paid organization plan |
|---|---|---|
| Public | ✅ Available | ✅ Available |
| Private | ❌ Not available | ✅ Available |
💡 Should you set async: true? You don't need it for the Robin check. Here's what it changes:
Without async (default) |
With async: true |
|
|---|---|---|
| The GitHub Actions job | Waits for the results, then passes or fails with your flows | Finishes in seconds and passes as soon as the upload is accepted |
| Runner minutes | Used while the flows run | Barely any |
| Where to see the result | The job and the Robin check | Only the Robin check |
⚠️ Watch out: withasync: true, a green job doesn't mean your tests passed. It only means the app and flows were sent to Maestro Cloud. This happened to us: our nightly workflow usesasync: trueand one night all 8 jobs were green in GitHub. In the Console, one flow had failed on the Pixel tablet (we dig into that failure in Part 4, the next part of this series). So withasync: true, always look at the Robin check or the Console to see if your tests really passed.

Look at the times: every job finished in about 30 seconds. A single flow takes about a minute on Cloud (our smoke flow took 1m 4s), so these jobs can't have waited for the whole suite to finish.
Two Uploads at Once
What happens when two runs reach Cloud at the same time? Every maestro cloud command sends one upload: your app and flows, listed as one entry in the Console. Say two teammates open pull requests a minute apart and each one starts an upload. You don't get extra devices. Both uploads share the devices on your plan, so some flows have to wait. How they wait is harder to predict: we tried it twice and saw two different patterns.
Android: the second upload waited for the first. We started the same four-flow regression suite twice, two seconds apart, on the plan's two Android devices.

Both uploads arrived at 10:49 but the second one didn't get a device right away. Here's when each upload's flows actually started:
| Time | Device 1 | Device 2 |
|---|---|---|
| 10:49:37 | First upload, flow 1 | First upload, flow 2 |
| 10:50:44 | First upload, flow 3 | First upload, flow 4 |
| 10:51:52 | Second upload, flow 1 | Second upload, flow 2 |
| 10:53:02 | Second upload, flow 3 | Second upload, flow 4 |

Cloud didn't split the two devices between the uploads. The first upload got both devices and finished in 2m 32s, the same as when it ran alone. The second upload waited in the queue for over two minutes until every one of the first upload's flows had finished, then ran its own four. It took 4m 47s in total: the wait plus its own run.
iOS: the two uploads took turns. In another test, we sent a nine-flow suite twice, in the same second: once for an iPhone 11 and once for an iPhone 17. Both had to share the plan's single iOS device. This time, Cloud didn't finish one upload before starting the other. It switched back and forth between them, so both uploads' flows ran mixed together.
| Upload | Flows | Whole run |
|---|---|---|
| iPhone 11 / iOS 17.5 | 9 | 15m 26s |
| iPhone 17 / iOS 26.2 | 9 | 18m 4s |
Both finished within three minutes of each other. Neither got a head start.
One possible explanation: Cloud may queue individual flows in the order they arrive. The Android uploads were two seconds apart, so all of the first upload's flows were already in line. The iOS uploads arrived in the same second, so their flows lined up mixed together.
We only tried each case once and Maestro's docs don't say how Cloud decides which flow runs next. So treat these two patterns as examples, not rules. Either way, two things stay true:
- Sharing doesn't make the work smaller. The devices still run every flow from both uploads, so everything finishes at about the same time. The order only decides who waits. One after the other: the first upload gets its results early. Mixed together: both get them late.
- Expect slower results when pull requests overlap. If your team often opens several pull requests at the same time, a faster suite won't fix this. You need more devices. Part 4's Is It Worth It? covers how to decide.
⚠️ Caution: if your CI job stays open until Cloud's results come back, it keeps running while your flows wait for a device. Many CI services charge for every minute a job runs, even when it's only waiting. Settingasync: true(above) avoids paying for that wait, but then the job only tells you the upload worked. To see whether your flows passed, look at theRobin - <app id>check on the pull request instead.
Stop Runs That No Longer Matter
When you push a new commit to a pull request, the flows still running for the older commit are already out of date. Stop Previous Flows tells Cloud to cancel them, so your devices move straight on to the new commit. On a plan billed per device, you only have a few devices, so you don't want them busy testing code you've already replaced.
It only cancels uploads of the same app and platform, from the same branch. Say you push two commits to feature-login a minute apart: Cloud cancels the first commit's upload. A teammate's upload from feature-search keeps running. You don't need to set anything up: the GitHub Action tells Cloud which branch each upload came from.
To find it, go to Console → Settings → General, under Configuration. It applies to your whole organization and only an admin can change it.
⚠️ Watch out: check whether the setting is on before you rely on either behavior. We found it switched on without remembering turning it on and only noticed when it cancelled our nightly runs (see the 🚨 warning below).

To test it, we pushed two commits to the same pull request, 26 seconds apart. The first upload's flow was cancelled 23 seconds after it started and the second ran to the end:

Two things on GitHub look like problems, but aren't:
- The older commit's job failed. The CLI printed
All flows were canceledand the job ended with a red ❌, even though no test failed. Only the newest commit's checks show on the pull request, so you'll only see this in the commit history. - The older commit's Robin check never finished. It stayed on Pending. This is harmless for the same reason, but don't wait for it.
🚨 Warning: Stop Previous Flows can't tell an outdated upload from one you still want. It cancels any older upload of the same app from the same branch, and that can wipe out a run that tests several devices at once. Our nightly workflow sends one upload per device, all from main, a few seconds apart. Cloud treated each new upload like a newer commit, so it stopped the ones still waiting for a device. On the third nightly run, only one of our four iOS uploads ran. The other three showed 9 Stopped: all nine flows canceled before they started.
A Stopped status isn't a failure. Nothing in your tests went wrong. Cloud canceled the run. So if every flow in an upload shows Stopped and another upload sent at the same time passed, check this setting first. Open one of the stopped flows: if it says Older runs stopped by new upload, Stop Previous Flows canceled it.
The setting only compares uploads on the same branch, so a matrix can avoid it by giving each upload its own branch name. The action has a branch input for this. Add one line to the matrix job's action step:
branch: nightly-${{ matrix.name }} # one branch name per deviceWe ran the same eight-device matrix again with this line and with Stop Previous Flows on. This time, all eight uploads finished with every flow passing. While a device was busy, the newer uploads waited as Pending instead of being stopped.

💡 You don't need to create these branches in Git. Cloud only uses the name to group uploads, sonightly-ios-iphone11can be any label you like. Your code still comes frommain.
👍 Best practice:
| Your setup | Stop Previous Flows |
|---|---|
| Pull request checks only | On: outdated commits stop using your devices |
| A device or OS matrix with the same branch for every upload | Off, or the matrix cancels itself |
| Both | On and give each matrix upload its own branch |
⚠️ Watch out: only change the branch on the nightly matrix. Leave the pull request workflow alone or the Robin check won't link to the pull request.
Secrets and Test Data
Article 3 kept passwords and API keys out of the workflow file by storing them as GitHub secrets. Do the same for your flow files: never type a password into a flow. Pass it as an environment variable when you start the run and have the flow reference it by name:
maestro cloud --project-id <id> --app-file app.apk --flows flows/ \
-e USERNAME=$TEST_USERNAME -e PASSWORD=$TEST_PASSWORD- inputText: ${USERNAME}
- inputText: ${PASSWORD}In the GitHub Action, the same pair goes in the multi-line env input, filled from repository secrets (USERNAME=${{ secrets.TEST_USERNAME }}).
⚠️ Watch out: keeping secrets out of your flow files doesn't keep them out of Cloud. Every -e value, including ones filled from GitHub secrets is listed on the upload page and hovering over a variable's name shows its value in plain text. The Download artifacts files contain typed values too and View Workspace shows your uploaded flow files (Part 1 covers all three). Anyone with access to your Cloud project can see them, so use test accounts that exist only for testing.⚠️ Important: in Article 3, the "prepare test data" step and your flows ran on the same CI machine. On Cloud, they split up. The data step still runs on your CI machine but your flows run on Maestro's devices, outside your network. So anything a flow calls, such as an API or a test backend has to be reachable from the internet. A backend onlocalhostor your company network won't work unless you let Cloud in (see the next section). Theapi_loginflow from Beyond the Basics, Part 2 calls a public API, so it worked on Cloud as is, on both Android and iOS.
When Your Backend Is Behind a Firewall
If your test backend only accepts traffic from known addresses, Cloud's IP allowlist is the fix. Maestro Cloud connects from a fixed set of IP addresses and you add them to your firewall or access control lists:
207.254.42.234
34.127.79.8
35.247.62.137
34.83.16.33There's nothing to switch on in Maestro; the work is on your network's side, usually by whoever owns the firewall. It's included in the Cloud plan.
⚠️ Watch out: Maestro says these addresses are static but may add more in future. Copy the current list from the IP allowlist docs rather than from this article and ask Maestro support to add you to their mailing list for changes.
Quick-Reference
| Need | Command / setting |
|---|---|
| GitHub Action | mobile-dev-inc/action-maestro-cloud@v3.1.0 |
| Project ID in the Action | Repository variable: ${{ vars.MAESTRO_PROJECT_ID }} |
| Flows folder in the Action | workspace: flows |
| Console link in CI | steps.<id>.outputs.MAESTRO_CLOUD_CONSOLE_URL (use run: |) |
| PR status check | Install the Maestro Cloud GitHub App; the check is named Robin - <app id> (<PLATFORM>) |
| Block merges on failure | Mark the check as required in branch protection (private repos: GitHub Pro or a paid plan) |
| Don't wait for results | --async (CLI) / async: true (Action) |
| Cancel outdated PR runs | Console → Settings → General → Stop Previous Flows |
| Pass secrets | -e KEY=value (CLI) / env: (Action) |
| Firewalled backend | Allowlist Maestro's IPs (see docs for the current list) |
What's Next?
Cloud now runs on every pull request and a failing flow blocks the merge. But a pull request check only tells the person who opened it. When the nightly run fails, nobody is watching.
In Maestro Cloud, Part 4, the last part of the series, you'll send results to Slack, email or your own services, dig into failures from the Console and decide whether Cloud is worth $250 per device per month for your team.
Discussion