Execute a workflow file and resume paused workflows.
run
Therun command executes the default export from a TypeScript workflow file against a live browser. Use it to verify a workflow after creating or editing it.
Syntax
<file>: path to the TypeScript workflow file. The file must have a default-exportedworkflow().
Flags
Run the browser in headless mode. Use this for the normal fix-and-verify loop.
Run the browser in headed (visible) mode. This is the default when neither
flag is passed.
Name for this run session. Auto-generated if omitted. Use an explicit name to
target the session with
exec, snapshot, or resume after a failure or
pause.Inline JSON input for the workflow, passed as a quoted string. Example:
--params '{"status":"open"}'.Path to a JSON file to use as workflow input. Cannot be used together with
--params.Domain of a saved auth profile to load for this run. Example:
--auth-profile linkedin.com. Profiles are created with npx libretto save <domain> --session <name>.Viewport size in
WIDTHxHEIGHT format, for example 1920x1080. Falls back to
.libretto/config.json, then 1366x768.Path to a
tsconfig.json file for module resolution during workflow
compilation.Disable ghost cursor and element highlight visualization in headed mode.
Cloud browser providers: The
run command does not yet support the
--provider flag. Workflows always run against a local browser. Cloud
provider support for run is planned — see open &
connect for the
current provider support on open.Behavior on failure
When a workflow fails, Libretto keeps the browser open at the point of failure. You can then usesnapshot and exec to inspect the live page state before editing the workflow code.
Validation loop
Preferrun --headless for the normal fix-and-verify loop. When the headless run passes, do a final headed run if you or the user wants to watch the finished workflow:
Examples
resume
Theresume command unpauses a workflow that has stopped at an await pause(session) call. Use it repeatedly until the workflow completes or pauses again at the next breakpoint.
Flags
The session name of the paused workflow to resume.
The pause() API
Insert await pause(session) calls in your workflow file to create interactive breakpoints, similar to debugger breakpoints in the browser flow. The workflow stops at each pause() call and waits for resume before continuing.
pause() is a no-op when NODE_ENV === "production". You can leave
pause() calls in your workflow code during development and they will be
silently skipped in production.Complete debugging flow
Run the workflow and let it fail (or pause)
pause(), it prints Workflow paused. and returns. The browser stays open.Resume the workflow
resume until the workflow prints Integration completed. or fails with an error.snapshot
Inspect page state after a failure or pause.
exec
Prototype fixes against the paused browser before editing code.