Skip to main content

bap run

The fastest way to execute recorded workflows. Compiles workflow steps into fused batches for fewer server calls, and leverages the action cache for repeat runs.

Usage

bap run qa-checkout
name
string
required
Name of the saved workflow to execute.
--param
string
Parameter substitution in key=value format. Can be specified multiple times.
--dry-run
flag
Show the compiled execution plan without running it. Displays batch structure, fusion flags, and step reduction percentage.
--warm
flag
Force cache warming before execution. Pre-resolves selectors into the action cache.

Compilation

bap run compiles sequential workflow steps into optimized batches:
  • Adjacent interaction steps are merged into single act calls
  • Navigation steps get fused observe parameters
  • Fusion flags (preObserve, postObserve, responseTier) are applied automatically

Dry Run Output

bap run qa-checkout --dry-run
Execution Plan: qa-checkout
Steps: 6 -> 3 batches (50% reduction)

  Batch 1 navigate (1 steps) [postObserve, tier:interactive]
    -> goto https://shop.example.com
  Batch 2 act (3 steps) [postObserve]
    -> fill label:"Search"="headphones"
    -> press Enter
    -> click role:link:"Sony WH-1000XM5"
  Batch 3 act (2 steps)
    -> click role:button:"Add to Cart"
    -> click role:button:"Checkout"

Cache Warming

The action cache stores resolved CSS selectors from previous runs (24h TTL). On repeat executions, cached selectors skip the full resolution chain.
Running: qa-checkout
Compiled: 6 steps -> 3 batches (50% fewer calls)
Cache: 4/6 warm (67%)
Cache manifests are saved after each run with batch timings and selector mappings for analysis.

Output

Running: qa-checkout
Compiled: 6 steps -> 3 batches (50% fewer calls)
Cache: 4/6 warm (67%)

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

PASS -- 6 passed, 0 failed (630ms)
Use --format=json for machine-readable output. The JSON includes step-level timing, cache hit rates, and batch structure.

bap run vs bap workflow run

Featurebap workflow runbap run
ExecutionSequential, as recordedCompiled into fused batches
Server callsOne per stepOne per batch
Cache warmingNoYes
Dry runNoYes (--dry-run)
Use caseDebugging, step-by-stepProduction, speed