run_flow
Execute ordered batches of UI automation steps (tap, type, launch app) in one server-side round-trip. Returns a single final screenshot, reducing tokens and latency. Steps stop on first error.
Instructions
Run an ordered batch of tool calls server-side in ONE round-trip.
steps is a JSON list of {"tool": "", "args": {...}} — the same tool
names execute_tool exposes (tap, tap_element, type_text, launch_app, etc.).
Steps run in order and stop at the first error. Returns a JSON object with
per-step results and a SINGLE final screenshot (not one per step) — far
fewer tokens/round-trips than calling each tool separately. Steps do NOT
auto-settle between UI actions; if a step needs the screen to update before
the next one reads it, insert an explicit {"tool":"wait","args":{...}} step.
Example: run_flow("SERIAL", '[{"tool":"launch_app","args":{"package":"com.android.settings"}}, {"tool":"find_on_screen","args":{"text":"Wi-Fi"}}, {"tool":"tap","args":{"x":540,"y":300}}]')
Security: fail-closed allow-list — only vetted read/UI tools may run inside
a flow. Anything else (raw shell, run_skill, or any unknown tool) makes
the whole flow be refused before any step runs, since a batch is exactly
where an injected instruction would smuggle a shell command. Max 50 steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | ||
| device | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |