Skip to main content

Workflow step reference

A workflow is made of steps run in order. When you insert a step in the editor, the table below matches the menu items. Use this page to look up parameters — you do not need to read it cover to cover.

Common concepts
  • Save to variable (saveAs): store a step’s result under a name; later steps reference it with {{name}} or read from previous step
  • Variable pool: the editor toolbar shows flow config and step results; after a trial run you can see actual values
  • Skip condition: skip this step when the condition is met
  • Failure handling: on failure, jump to another step or run a recovery action
Environment & licensing

Whether steps succeed depends on Prerequisites & licensing: USB device license, automation IPA environment (most UI steps), Bluetooth/OTG (ble_* steps). If a trial run fails, check environment first, then parameters.

1. Environment & App

Step opNameDescriptionMain parameters
device_auth_okDevice license checkCheck USB / screen license; also runs automatically before the flow startstype: 1=USB license, 2=screen license
ensure_auto_envStart automation environmentStart device automation service and poll until ready
open_appOpen appLaunch app by Bundle IDbundleId; optional resetUsb
homeGo homeSimulate Home key

2. Wait & logging

Step opNameDescriptionMain parameters
waitWaitFixed delay in millisecondsduration (ms)
logLog messageOutput to run logmessage or messageFromVar

3. UI & gestures (automation environment required)

Step opNameDescriptionMain parameters
fetch_nodesNode captureDump UI tree and parse into node listmatch.dumpXml filter; saveAs
vlm_locateVLM · visual locateVision LLM locates element coordinates on screenshotintent (Chinese description); saveAs; optional imageFromParam
capture_screen_no_autoNon-automation screenshotBridge full-screen capturesaveAs
capture_screen_autoAutomation screenshotAgent full-screen capture; requires ensure_auto_envsaveAs
click_pointTapCoordinate tapx,y or fromParam
swipe_to_pointSwipeSwipe from start to endstartX,startY,endX,endY,duration
long_click_pointLong pressLong press at coordinatesx,y,duration
double_click_pointDouble tapDouble tap at coordinatesx,y
multi_touchMulti-touchMulti-finger pathsfingers array
input_textType textType into focused controlcontent

Screenshot & OCR steps

Step opWhen to use
capture_screen_no_autoFull-screen capture without automation
capture_screen_autoFull-screen capture with automation
ocr_screen_no_autoOCR without automation
ocr_screen_autoOCR with automation

Names match AI chat — you can say “non-automation screenshot”, “automation OCR”, etc.

OCR engine types (ocrType)

ocrTypeDescription
paddleOcrNcnnV5 (default)Local NCNN; balanced speed and accuracy
v5 / paddleOcrOnnxV5ONNX v5
v4 / paddleOcrOnnxV4ONNX v4
ocrLiteOcrLite

On the same device, each ocrType is cached separately; after a formal task ends the engine is released, so the next OCR may re-init (first packet slightly slower is normal). Editor OCR preview keeps the engine loaded for continuous debugging.

Optional parameters: padding, maxSideLen, region (recognition area).

Default fetch_nodes dumpXml filter

When match.dumpXml is not configured:

  • visibleFilter=1, labelFilter=1, boundsFilter=1
  • maxDepth=50
  • excludedAttributes=visible,selected,enable,accessible
  • maxChildCount=200

For VLM semantic locate, use the dedicated vlm_locate step (menu VLM · visual locate), not mixed into fetch_nodes.

vlm_locate

ParameterDescription
intentChinese description of target, e.g. “settings button top-right”
saveAsWrite coordinates and other results
imageFromParamOptional; reference previous screenshot; empty = capture live

Configure the VLM model first in Config & data directories (vlm_config.json).

4. Connection recovery

Step opNameDescriptionMain parameters
reset_usb_connReset USBSoftware usbmuxd reset
reconnect_usbUSB reconnect flashSame as unplug/replug cable; Windows onlyAfter run, suggest wait 5–10 seconds

Use when automation won’t start, app won’t open, or other connection issues.

5. Photo album

Step opNameDescriptionMain parameters
album_request_authRequest album permissionTrigger album permission dialog
album_delete_photosClear photosDelete all photos in album (irreversible)
album_delete_videosClear videosDelete all videos in album
album_insert_img_folderImport imagesScan local folder and write images to device albumfolderPath (absolute path)
album_insert_video_folderImport videosScan local folder and write videos to device albumfolderPath
warning

Album clear operations are irreversible — confirm device and paths before trial run.

6. IME input method

Each IME step auto-checks input method availability (equivalent to ime_ok).

Step opNameDescription
ime_okCheck availableCheck IME ready (legacy flows; can omit in new flows)
ime_inputType textInput via IME
ime_pastePasteEmpty content uses clipboard
ime_press_delDelete keySimulate backspace
ime_press_enterEnterSimulate Enter
ime_copy_to_clipboardCopy to clipboardCopy input field content
ime_get_textRead input fieldRead current field text
ime_get_clipboardRead clipboardRead device clipboard
ime_set_clipboardSet clipboardSet clipboard content
ime_open_urlOpen URLOpen URL via IME
ime_remove_all_contentClear input fieldClear all content
ime_change_keyboardSwitch keyboardSwitch input method keyboard
ime_dismissHide keyboardDismiss keyboard

7. BLE Bluetooth peripherals

For BLE keyboard, mouse, and other external input devices. Complete BLE tutorial and, if needed, OTG tutorial binding and testing first.

Step opNameDescription
ble_clickBLE tapCoordinate tap
ble_double_clickBLE double tapCoordinate double tap
ble_swipeBLE swipestart/end coordinates + duration
ble_touch_down / ble_touch_up / ble_touch_moveDown / up / moveCombine for drag
ble_pressBLE long pressx, y, delay
ble_key_pressBLE keyprefix + code
ble_key_press_charBLE characterCharacter input
ble_system_keySystem keyHome, volume, etc.
ble_toggle_keyboardToggle soft keyboardShow/hide soft keyboard
ble_resetBLE resetReset peripheral
ble_set_wifiBLE WiFi provisioningSSID + password

8. OCR & data extraction

Step opNameDescriptionMain parameters
ocr_screen_no_autoNon-automation OCRBridge capture + recognizeocrType; saveAs; optional region
ocr_screen_autoAutomation OCRAgent capture + recognize; requires ensure_auto_envSame as left
pick_nodeNode data extractionExtract fields, regions, coordinates from node variableconditions, saveAs
pick_ocrOCR data extractionPick line, field, center from OCR resultmatch rules, saveAs
pick_matchMatch data extractionCenter or best match from template/color-offset resultfromParam; pick.mode; saveAs

pick_* steps support quick templates (buttons on step cards) and last trial run preview.

9. Image/color recognition

See Image/color matching for detailed usage.

Step opNameDescription
match_template_no_autoNon-automation template matchBridge capture + OpenCV template match
match_template_autoAutomation template matchAgent capture + template match
find_image_by_color_no_autoNon-automation color-offset matchBridge + findImageByColorEx
find_image_by_color_autoAutomation color-offset matchAgent + findImageByColorEx

Main parameters: templatePath (relative to working directory, e.g. assets/templates/xxx.png), imageFromParam, region, threshold / weakThreshold, saveAs.

Typical chain: match_template_*pick_match (mode=center) → click_point.

10. Local files

File steps operate on the control host filesystem (not files on the device).

Step opNameDescriptionMain parameters
save_fileSave fileWrite variable content to filebaseDir: runtime_data / external; fromParam; filename; format
read_fileRead fileRead JSON/textbaseDir: readdata / external; filename; saveAs
delete_fileDelete fileDelete file or directory recursivelybaseDir + relative path, or external absolute path
list_dirList directoryReturn path arrayfolderPath; recursive
file_existsPath existsWrite {exists, path, isDir?}path absolute path
Working directory often not required

If flow config has no working directory, save/delete use Agent default runtime_data/{deviceId}/, read uses runtime_data/readdata/ (shared, not per device). With working directory set: save/delete {workDir}/{deviceId}/, read {workDir}/.

Directory notes (baseDir):

baseDir valuePath
runtime_data{dataDir}/runtime_data/{deviceId}/ (default save, delete)
readdata{dataDir}/runtime_data/readdata/ (default read, shared)
externalUser-specified absolute path on PC
audit{dataDir}/audit/{taskId}/{deviceId}/{workflowId}/

Legacy datatmp and {dataDir}/datatmp/ still work; new workflows should use runtime_data. Save paths do not include taskId.

11. External integration

Step opNameDescriptionMain parameters
call_httpHTTP requestCall registry endpoint or specified URLendpoint/url; method; body; saveAs
run_cliRun CLIExecute registry commandcliId; args; saveAs
call_mcpRun MCPCall registry MCP Toolserver; tool; arguments; saveAs

Legacy pick_cli / pick_mcp auto-migrate to new step format when opened.

See External integration.

12. Flow control

Step opNameDescription
branchConditional branchif/else with two nested step groups
switchMulti-way branchMatch cases in order, else default
pause_humanHuman pauseTask pauses; wait for Continue in task panel
invoke_workflowInvoke subflowRun another workflow synchronously; pass params, write back variables

invoke_workflow (subflow)

ParameterDescription
workflowIdSubflow ID
params / input paramsKey-values passed to subflow
exportParams / write backWhich subflow variables return to parent
saveAsOptional; record invoke success { workflowId, status }
returnModeResult content: status only / includes write-back / subflow params snapshot

On subflow failure or human pause, internal variables are not written back by default (unless configured to write on failure).

branch / switch conditions

  • Supports when expressions (evaluated after template expansion)
  • Can combine with dumpXml node existence (configure pick conditions in editor)

13. Insert-step menu categories

Editor Add step groups by category:

Common · Proxy events · OCR · VLM · visual locate · Image/color · Album · IME input · BLE Bluetooth · Link management · Data processing · Files · HTTP/CLI/MCP · Sub-workflow (FSM)

Variables & templates

  • Flow config: global defaults (UI merges former globals / fsm.context; workflow default vs. this flow startup scopes)
  • Task params override startup values via trial run Params or invoke input params
  • String fields support {{var}}, {{stepVar.field}} template syntax
  • Variable pool (editor toolbar): view config and step results; after trial run switch to Run view for actual values; click to highlight canvas references

Validation rules (before save / trial run)

Editor Validate checks for example:

  • Workflow ID, FSM initial/final reachability
  • Album steps have folderPath
  • Match steps have template path or Base64
  • File steps in external mode specify directory
  • Invoke has no circular dependency
  • Global variable name conflicts, reserved words

On failure, the first error is shown in the UI.