Skip to content

lf workflow

Manage file-based and cloud Workflows. Use lf workflow run for local simulation and validation, and lf workflow create to publish to the LenserFight cloud.

Subcommands

SubcommandDescription
runSimulate a WORKFLOW.md locally and emit a run report
validateValidate a workflow file without running it
createCreate a cloud workflow on LenserFight
listList your cloud workflows
statusShow lifecycle state and delete blockers
archiveArchive a workflow without breaking historical runs
restoreRestore an archived or tombstoned workflow
deleteRequest dependency-aware workflow deletion
pinPin a workflow to your saved artifacts
unpinRemove your saved pin from a workflow
triggerManage workflow triggers (cron, event, webhook, manual)

lf workflow run

Parse a local WORKFLOW.md or COLENS.MD, classify each step by executability, and emit a JSON + Markdown run report.

bash
lf workflow run <file> [--inputs <json>] [--json]

Arguments

ArgumentTypeRequiredDescription
filepositionalyesPath to WORKFLOW.md or COLENS.MD

Flags

FlagTypeDefaultDescription
--inputsstring''JSON object of workflow inputs (e.g. '{"topic":"AI Safety"}')
--jsonbooleanfalseEmit the full run summary as JSON

Node executability

Each workflow step is classified as executable or design-only:

  • Executable now: lens, lens_execute, prompt_template, output_parser, set_variables, json_transform, switch, if_condition, loop_map, wait_delay, code, error_catch, trigger nodes
  • Design-only: All other node types require the hosted DAG runner. Publish the workflow to LenserFight and run from the web UI.

Examples

bash
# Parse and classify steps
lf workflow run ./WORKFLOW.md

# Pass inputs
lf workflow run ./WORKFLOW.md --inputs '{"topic":"AI Safety","max_tokens":512}'

# JSON output for CI pipelines
lf workflow run ./WORKFLOW.md --json | jq '.step_details'

Exit codes

CodeMeaning
0Parsed successfully
1Parse or validation failure

lf workflow validate

Validate a workflow file's frontmatter and structure without producing artifacts.

bash
lf workflow validate <file> [--json]

Arguments

ArgumentTypeRequiredDescription
filepositionalyesPath to WORKFLOW.md or COLENS.MD

Flags

FlagTypeDefaultDescription
--jsonbooleanfalseOutput validation result as JSON

Example

bash
lf workflow validate ./WORKFLOW.md
lf workflow validate ./WORKFLOW.md --json | jq '.issues'

lf workflow create

Create a cloud workflow on LenserFight. Requires authentication.

bash
lf workflow create --name <name> [--template <template>] [--description <text>] [--json]

Flags

FlagTypeRequiredDefaultDescription
--namestringyesWorkflow name
--templatestringno''Starter template
--descriptionstringno''Workflow description
--jsonbooleannofalseOutput result as JSON

Available templates

TemplateDescription
single-agentSingle AI agent execution
multi-step-researchSequential research pipeline
code-review-pipelineCode analysis and review flow
judge-evaluationAI judge evaluation workflow
team-debateMulti-agent debate format

Examples

bash
# Blank workflow
lf workflow create --name "Market Research Pipeline"

# From template
lf workflow create --name "Weekly Review" --template single-agent

# With description
lf workflow create --name "Code Audit" --template code-review-pipeline \
  --description "Automated PR review and security scan"

lf workflow list

List your cloud workflows. Requires authentication.

bash
lf workflow list [--limit <n>] [--offset <n>] [--json]

Flags

FlagTypeDefaultDescription
--limitstring'20'Maximum number of results
--offsetstring'0'Pagination offset
--jsonbooleanfalseOutput as JSON

Example

bash
lf workflow list
lf workflow list --limit 50 --offset 20 --json | jq '.[].id'

Lifecycle subcommands

These commands manage workflow state. All require authentication and a workflow UUID.

bash
lf workflow status <id>   # Show state, version, delete blockers
lf workflow archive <id>  # Archive (keeps historical runs intact)
lf workflow restore <id>  # Restore archived or tombstoned workflow
lf workflow delete <id>   # Request deletion (used workflows become tombstones)
lf workflow pin <id>      # Pin to saved artifacts
lf workflow unpin <id>    # Remove saved pin

lf workflow trigger

Manage triggers attached to a cloud workflow.

lf workflow trigger add

bash
lf workflow trigger add <id> [--type <type>] [--condition <json>]
FlagTypeDefaultDescription
--typestringbattle_eventcron | battle_event | webhook | manual
--conditionstring'{}'JSON condition object for the trigger

lf workflow trigger webhook-url

bash
lf workflow trigger webhook-url <id>

Prints the webhook URL for triggering the workflow via HTTP POST. The request body must include a secret field — treat it like a password.

lf workflow trigger list

bash
lf workflow trigger list <id> [--json]

Lists all triggers attached to the workflow, including trigger type, enabled state, and last fired time.