Skip to main content
lua workflows manages pushed workflow definitions and their runs. deploy changes what runs for every end user; every other verb reads or steers one workflow, one run, one schedule or one goal. Verified against lua-cli 3.33.0.

Synopsis

Description

A workflow version is uploaded with lua push workflow and does nothing until lua workflows deploy <name> -v <version|latest> makes it active. That deploy is a scoped promote: it records a new agent version and prints it as agentVersion, so lua version promote <n> is the rollback. A chat-composed (dynamic) workflow cannot be deployed by version; the verb refuses with WORKFLOW_DYNAMIC (exit 1). Run verbs take a run id. start --follow, watch and logs --follow stream the run’s events and exit when the run ends (0 completed, 4 failed or timed out, 5 canceled) or when it needs a person: an approval, an input, a signal, a billing, budget or exception park (exit 8, with the resuming verb printed) or a consent gate (exit 6). --wait-for-human prints that notice and keeps streaming until the run is terminal; --timeout <s> ends either mode with exit 7 while the run is still live. --json prints the raw {success,data} envelope on stdout for every verb; a refused verb prints the server’s error envelope and keeps its exit code. Without an action the command offers a menu (list, run, start, runs). Only delete, delete-run and schedules delete confirm; pass --yes under --ci, where any prompt fails with ✖ error: Interactive prompt required but --ci flag is set. Provide all required flags or arguments. (exit 1). run is the offline driver; its flags are on lua test.

Arguments

Run and deploy actions

A schedule is a workflow’s cadence job (at most 5 trigger slots). A goal runs a workflow repeatedly until a judge says the objective is met; its cadence is a schedule tagged with the goal id: schedules patch, pause and resume refuse it with goal_schedule (exit 1), and schedules delete refuses it while the goal is active or paused. Schedule sub-verb aliases: lslist; new, add, setcreate; update, editpatch; hold, stop, disablepause; unpause, enable, continueresume; rm, remove, del, unscheduledelete. Goal sub-verb aliases: lslist; view, show, infoget; new, add, setcreate; update, patch, changeedit; bump, increaseraise; hold, stoppause; unpause, continueresume; end, finishclose.

Schedule and goal actions

Options

Shared options

start

Prints ✅ Run <runId> · <status>; with --json the envelope’s data holds runId and status, plus deduplicated or idempotentReplay when no new run was created. A run that starts gated exits 6; with --follow the attached watch reaches the same gate and also exits 6 unless --wait-for-human. A concurrencyPolicy: 'forbid' workflow with a run in flight prints the blocking run id and exits 1.

runs

status

watch and logs

Ctrl-C detaches without touching the run. A boundary the run has already moved past is printed as history and does not end the watch.

cancel, resume, retry-step

resume on an approval step is refused with APPROVAL_REQUIRES_HUMAN and names the approve command; on a signal wait it is refused with USE_SIGNAL_ROUTE and names the signal command. retry-step refuses with STEP_NOT_PARKED, RUN_TERMINAL or STEP_RETRY_CAP.

resolve-step

With an API key the verb refuses with APPROVAL_REQUIRES_HUMAN: sign in with a user session instead.

raise-budget

At least one cap is required, every value is an integer of 1 or more, and increases only. A raise that does not cover the next step’s reserve parks the run again (resumed: false).

approve and approval-payload

signal

A payload member named like a credential (token, and the other reserved names the warning lists) is stored and shown as [REDACTED] downstream; the CLI warns and sends it anyway.

replay

Exit 4 on a divergence. Needs a compiled project in the current directory.

delete and delete-run

delete is refused while a goal or schedule still references the workflow (409 WORKFLOW_REFERENCED_BY_JOBS, exit 1); the message names each job and the verb that stops it. delete-run refuses a live run: cancel it first.

env-overlay and export

export compiles the written files before it exits 0; a file the compiler refuses is still written and the verb ends with export_not_compilable (exit 1). With --json the files are printed inline and nothing is written.

archive-runs

workspace, jobs, job-logs

schedules create

schedules patch, pause, resume, delete

goals create

One of --judge-predicate or --judge-agent is required; --schema and --judge-role belong to --judge-agent only.

goals edit and goals raise

Examples

Deploy the newest pushed version and start a run that follows to completion, exiting 8 if a person is needed.
Follow unattended through approvals for up to an hour.
Read one run and its steps, then answer the approval it is parked on.
List the workflows on the agent.
Output
Schedule the workflow weekly and create a goal with a deterministic judge.
Delete a schedule without a prompt.

Exit codes

Which 4xx is which: a 401 or 403 never reaches the verb, because the HTTP client raises it as auth (9) or forbidden (10) before the verb sees a response, while every other 4xx the server answers with (400, 409, 422, 424) is the verb’s own refusal and exits 1 with the server’s code on the line. Every escaped error is one line, ✖ <code>: <message>, plus a hint; LUA_DEBUG=1 prints the stack.

See also