Skip to content

Run a workflow

Pass the file to dagweave run:

Terminal window
dagweave run my-workflow.yaml

It takes an Argo Workflow in YAML or JSON, or a file saved from the Dagweave editor, and stays in the foreground until the run finishes. To check a file without running it, use dagweave lint.

Dagweave Local decides from the workflow. There’s no flag.

  • On the host if every step is a script template with a command. Each step is an ordinary process on your machine.
  • On a local cluster for anything else: a container template, sidecar, init container, volume, artifact, daemon step, or http or data template. It runs Argo Workflows in a single-node k3s cluster in Docker, with nothing for you to set up.

The run’s first line says which it picked and, for a cluster, which template needed it.

A four-step DAG where every step is a script:

$ dagweave run examples/pipeline.yaml
dagweave: running on the host, because every step is a command this machine can run directly
dagweave: steps run against this machine, so alpine:3.20 is not used
dagweave: steps share this machine's /tmp, which separate pods would not, so a step reading what another wrote there works here and would not on a cluster
hello
HELLO
5
HELLO has 5 letters
Succeeded produce 4ms
Succeeded shout 6ms
Succeeded count 6ms
Succeeded finish 3ms
Succeeded pipeline 14ms
dagweave: Succeeded, 5 step(s), under ~/.local/state/dagweave/runs/pipeline

Step output comes first, then each step’s result. The last row is the DAG itself, hence five steps. The last line is where the output and logs are kept.

  • A host run ignores the step’s image and uses your own shell.
  • Host steps each get their own working directory and TMPDIR, but share your /tmp. A file one step writes to /tmp/out is there for the next, which won’t be true on a cluster.
  • A host run can’t enforce resources.limits. A cluster run does.
  • Parameters are pasted into a script’s source as text, as in Argo. Whoever controls a value from -p, a file or another step can run commands on your machine as you.

It takes about two minutes to set up the cluster. It stays up afterwards, so later runs start straight away. To free its memory and disk, run dagweave prune.

They compile the same way as in the Dagweave app. One saved as a WorkflowTemplate runs as a Workflow, like Run in the app does.

Plain Argo YAML has to be a Workflow. Like argo submit, it refuses a WorkflowTemplate or CronWorkflow.