workflow
Workflow commands operate a step graph: send a JSON source file to the Host for validation, publish an immutable version, then run that version. The file must be a JSON object; its path is --file. The workspace must already exist.
A running Host and VIBEX_TOKEN are required. Graph editing and Studio are in the guide Graph Workflow.
npx vibex workflow validate
Validate only. No runnable version is created. Use it to check graph structure, dependencies, and step contracts before publish. Failures print the Host error code.
npx vibex workflow validate --file path/to/graph.json--file is required and must be a JSON file readable on this machine. The contents are sent as the definition. An invalid path or unparsable JSON fails in the CLI before the HTTP call.
npx vibex workflow publish
After validation, create an immutable workflow definition version. Later edits to the source file affect the next publish only; runs already started stay bound to this version.
npx vibex workflow publish --file path/to/graph.json [--definition-id ID]--file is required. --definition-id binds an existing workflow identity for a new version; omit it and the Host allocates a new identity. Pass the returned version ID to npx vibex workflow run --version.
npx vibex workflow run
Start a run from a published version, bound to a workspace.
npx vibex workflow run \
--version VERSION_ID \
--workspace WORKSPACE_ID \
[--input input.json] \
[--policy policy.json]--version and --workspace are required. --input defaults to {} and must be a local JSON file. --policy defaults to empty and overrides completion policy. The response is the run object; store id for npx vibex workflow show, npx vibex workflow wait, and npx vibex workflow cancel.
An unpublished source file cannot be run. Publish first with npx vibex workflow publish.
npx vibex workflow show
Fetch the run, its steps, and events (from sequence 0, up to 1000) and print them as one JSON object. Use it to see a stuck step and a waiting approval.
npx vibex workflow show --run RUN_ID
npx vibex workflow show --run RUN_ID --json--run is required. The object contains run, steps, and events. Step IDs come from steps and go to npx vibex workflow resume --step.
npx vibex workflow wait
Poll this run’s status until it reaches completed, failed, cancelled, interrupted, or the timeout.
npx vibex workflow wait --run RUN_ID [--timeout 600]--run is required. --timeout defaults to 600 seconds. After timeout, inspect the current step with npx vibex workflow show. A run sitting on approval is still non-terminal; wait continues until timeout or someone runs npx vibex workflow resume.
npx vibex workflow history
Read the event stream for incremental sync or debugging.
npx vibex workflow history --run RUN_ID [--after N] [--limit 1000]--run is required. --after is the last processed sequence, default 0. --limit defaults to 1000. A script can remember the last sequence and pass --after to fetch only new events.
npx vibex workflow cancel
Stop scheduling new steps and cancel in-flight agent turns. File changes already made stay in the workspace.
npx vibex workflow cancel --run RUN_ID [--reason TEXT]--run is required. --reason is optional. Cancelling an already finished run returns a Host error.
npx vibex workflow resume
When a run sits on approval, review, or a failed step, submit a human decision to continue.
npx vibex workflow resume \
--run RUN_ID \
--decision retry|accept|skip|cancel \
[--step STEP_ID] \
[--output output.json] \
[--reason TEXT]--run and --decision are required. --decision values:
retry: run that step again;--steprequiredskip: skip that step;--steprequiredaccept: accept the step’s candidate output;--steprequired; with--output, that JSON is the accepted contentcancel: end the whole run; optional--reason;--stepomitted
Step IDs come from the steps list of npx vibex workflow show. A missing required --step raises Missing required --step.

