Skip to main content

Workflows

Record a sequence of BAP commands and replay them later. Workflows are saved as YAML and support parameter substitution.

Record a Workflow

1

Start recording

bap workflow record qa-checkout
All subsequent BAP commands will be captured.
2

Run your commands normally

bap goto https://shop.example.com --observe bap act fill:label:"Search"="headphones"
press:Enter bap click role:link:"Sony WH-1000XM5" bap act click:role:button:"Add to Cart" ```
</Step>

<Step title="Stop recording">
  ```bash
  bap workflow stop
Saves the workflow as YAML to ~/.bap/workflows/qa-checkout.yml.

Run a Workflow

bap workflow run qa-checkout
With parameter substitution:
bap workflow run qa-checkout --param search=speakers --param product="JBL Flip 6"
name
string
required
Name of the saved workflow to run.
--param
string
Parameter substitution in key=value format. Can be specified multiple times.
Output shows pass/fail status for each step:
Running workflow: qa-checkout
4 steps

  PASS Step 1: goto https://shop.example.com  120ms
  PASS Step 2: act fill:label:"Search"="headphones" press:Enter  85ms
  PASS Step 3: click role:link:"Sony WH-1000XM5"  230ms
  PASS Step 4: act click:role:button:"Add to Cart"  95ms

PASS -- 4 passed, 0 failed (530ms)

List Workflows

bap workflow list

Macros

Macros are reusable workflow fragments. Record them the same way:
bap workflow macro login
bap goto https://app.example.com/login
bap act fill:label:"Email"="user@test.com" \
        fill:label:"Password"="pass" \
        click:role:button:"Sign in"
bap workflow macro stop
Reference macros in workflows with macro: <name>.

Optimized Execution with bap run

For fastest execution, use bap run instead of bap workflow run. It compiles workflows into fused batches:
bap run qa-checkout --param search=speakers
See the run command for details on compilation and cache warming.
bap workflow run executes steps sequentially as recorded. bap run compiles them into optimized batches with fusion, resulting in fewer server calls.