Batching
Use batch to run multiple commands in a single daemon request.
This is useful for agent workflows that already know the next sequence of actions and want to reduce orchestration overhead.
CLI examples
From a file:
Inline for small payloads:
Step payload format
batch accepts a JSON array of steps:
Notes:
positionalsis optional (defaults to[]).flagsis optional (defaults to{}).- nested
batchandreplaysteps are rejected. --on-error stopis the supported behavior.
Response shape
Success:
Failure:
Agent best practices
- Batch only one related screen flow at a time.
- After mutating steps (
open,click,fill,swipe), add a sync guard (wait,is exists) before critical reads. - Treat prior refs/snapshots as stale after UI changes.
- Prefer
--steps-fileover inline JSON. - Keep batches moderate (about 5-20 steps).
- Replan from the failing step using
details.stepanddetails.partialResults.
Stale accessibility tree risk
Rapid UI changes can outpace accessibility tree updates. Mitigate by inserting explicit waits and splitting long workflows into phases:
- navigate
- verify/extract
- cleanup
