Automatically rerun failed Maestro flows
Automatically retry failed Maestro flows on BrowserStack App Automate to distinguish real bugs from flaky failures and get more reliable build results.
Flaky flows cause intermittent failures and pipeline delays by forcing manual reruns.
BrowserStack’s App Automate solves this by automatically rerunning failed Maestro flows, which distinguishes real bugs from transient issues to improve build reliability, reduce manual effort, and accelerate CI/CD pipelines.
Automatic reruns for Maestro flows are supported for both Android and iOS apps.
Benefits of rerunning failed flows
Enabling automatic reruns for your Maestro flows on App Automate provides the following key advantages:
- Identify flaky flows and improve feedback reliability: automatically rerunning a failed flow helps confirm if a failure is persistent, a real bug, or intermittent, a flaky flow. This reduces the noise from transient failures, so your team can act on real issues faster.
- Improve build stability: successfully rerunning flows that fail due to temporary issues, like network glitches, prevents your entire CI/CD pipeline from being marked as failed unnecessarily.
- Reduce manual effort and save time: eliminates the need for developers and QA engineers to manually investigate and retrigger builds, so they can focus on writing code and finding critical bugs.
Enable reruns using REST API
You can enable the automatic rerun capability by passing the following parameters in your test execution API call:
| Parameter | Type | Required/Optional | Description | Default |
|---|---|---|---|---|
retryTestsOnFailure |
Boolean | Required | Set to true to enable automatic reruns for failed flows. |
N/A |
testIterations |
Integer | Optional | The maximum number of retry attempts for a single failed flow, up to a maximum of 5. Reruns stop as soon as the flow passes. | 1 |
Set retryTestsOnFailure to true to rerun only the flow that fails. The build continues to execute other flows, and only the failing flow is added to the rerun queue. You can optionally specify testIterations to control the number of retries.
By default, a failed flow is retried once, and you can increase this to a maximum of 5 retries, similar to the existing Espresso implementation, for both Android and iOS.
Use the following cURL request:
View rerun results
After your build completes, go to the App Automate dashboard to view all flow executions, including any reruns.
A flow that passes on a rerun is annotated passed on retry N, where N is the attempt that succeeded, and is flagged as flaky. The final status of the flow, and the build, passes if any attempt passes.
You can expand the flow result to view the logs and metadata for each individual attempt, so you can debug why a flow failed initially before passing.
For information on the supported APIs, refer to our REST API reference page.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!