Skip to content

CLI

Workflows

Create workflow definitions, upload graphs, install triggers, start runs, and resume waits.

Workflow build order

  1. Design the SOP.
  2. Create tables, functions, and agents first.
  3. Run each function standalone and save the response shape.
  4. Create the workflow shell.
  5. Upload the graph with real function_name and agent_name values.
  6. Install the workflow if start type is scheduled, event, or datastore event.
  7. Run a realistic test and inspect run output.

Definition and graph

lemma workflow create --pod-id <pod-id> --payload-file ./payloads/workflow-create.json
lemma workflow graph-update expense-review --pod-id <pod-id> --payload-file ./payloads/workflow-graph.json
lemma workflow get expense-review --pod-id <pod-id>

Installs and runs

lemma workflow install-create expense-review --pod-id <pod-id> --schedule-type CRON --cron-expression '*/5 * * * *' --timezone UTC
lemma workflow run-start expense-review --pod-id <pod-id> --payload '{"input":{"expense_id":"exp_123"}}'
lemma workflow run-get expense-review <run-id> --pod-id <pod-id>
lemma workflow run-resume expense-review <run-id> --pod-id <pod-id> --payload-file ./payloads/resume.json

Manual workflow threshold

A manual workflow should usually have at least two substantive stages after intake, or a clear need for branching, waiting, looping, approval handoffs, or resumability.