Install dagraph
Install the Verify the install:
dagraph package from PyPI. Python 3.12 or newer is required.The default backend is
claude_code, which runs the claude CLI as a subprocess and bills against your Claude Code plan. You do not need an API key to use it. Make sure the claude CLI is installed and on your PATH before running workflows. See Installation for other backend options.Write a workflow file
Create a file called
my-workflow.yaml with the following content. This defines two research nodes that run in parallel, followed by a synthesizer node that waits for both.angle_a and angle_b have no depends_on, so dagraph fires them simultaneously. summary lists both as dependencies, so it starts only after both complete and receives their outputs as template variables.Validate the workflow
Before running, check that the YAML parses correctly and preview the execution plan:Expected output:This confirms dagraph identified the two independent nodes and will run them in parallel in the first wave.
Run the workflow
Pass an input value for dagraph will fire
{{ topic }} using the --input flag:angle_a and angle_b in parallel, wait for both to finish, then run summary with their outputs injected into the prompt template.Inspect the results
When the run completes, dagraph prints a run ID. Use it to inspect outputs:This shows a table of all nodes with their status, token usage, and a preview of each artifact. To see the full output of a specific node:
All artifacts land in
runs/<run_id>/artifacts/ as content-addressed binary files. The index.json in that directory maps each node ID to its SHA-256 hash. You can also diff two runs with agentgraph diff <run_a> <run_b> to see per-node text differences.Next steps
You now have a working parallel agent workflow. From here you can:- Add an
approval_gatenode to pause the workflow for human review — see Human-in-the-loop - Swap backends per node using model-prefix routing (
openai/gpt-4o,ollama/llama3.2) — see Multi-provider fallback - Replay a run without LLM calls for fast iteration:
agentgraph run my-workflow.yaml --input topic="..." --replay-from <run_id> - Schedule recurring runs:
agentgraph schedule my-workflow.yaml --cron "0 9 * * 1"