fabro/docs/workflows/variables.mdx
Bryan Helmkamp 28884ae093 rename Arc to Fabro in all Rust crates, symbols, env vars, and supporting files
- Rename 20 crate directories lib/crates/arc-* → fabro-*
- Update all Cargo.toml: crate names, dep paths, feature flags, bin name
- Rename arc_server module → fabro_server in fabro-llm
- ArcError → FabroError across 30+ files
- ARC_VERSION/ARC_GIT_SHA/ARC_BUILD_DATE → FABRO_* constants
- All use/qualified paths: arc_agent:: → fabro_agent::, etc. (~1500 occurrences)
- Env vars ARC_* → FABRO_* in string literals and shell scripts
- String literals: X-Arc-Demo, arc-bot, arc@local, arc-web, arc-mcp, etc.
- Path strings: .arc/ → .fabro/, arc.toml → fabro.toml, refs/arc/ → refs/fabro/
- arc-api.yaml → fabro-api.yaml (OpenAPI spec)
- skills/arc-create-workflow → fabro-create-workflow
- trycmd fixtures: $ arc → $ fabro
- Inline snapshots (insta) updated
- CI, Docker, install.sh, scripts, CLAUDE.md, AGENTS.md
- TypeScript app: env vars, headers, JWT issuer
- Docs: page slugs, git refs, config paths, sandbox names, repo URLs
- Repo references: brynary/arc → fabro-sh/fabro

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:25:58 -04:00

76 lines
2.4 KiB
Text

---
title: "Variables"
description: "Using variables in workflows"
---
Fabro supports `$variable` placeholders that let you parameterize workflows without editing the DOT file.
## Run config variables
Define variables in the `[vars]` section of a run config TOML file:
```toml title="run.toml"
version = 1
goal = "Run tests for $repo_name"
graph = "check.dot"
[vars]
repo_name = "fabro"
repo_url = "https://github.com/fabro-sh/fabro"
language = "rust"
```
These variables are expanded into the DOT source **before** the graph is parsed. You can use `$variable` anywhere in the DOT file — goals, prompts, labels, scripts, or any other attribute:
```dot title="check.dot"
digraph Check {
graph [goal="Run tests for $repo_name"]
start [shape=Mdiamond, label="Start"]
exit [shape=Msquare, label="Exit"]
clone [label="Clone", shape=parallelogram, script="git clone $repo_url repo"]
test [label="Test", prompt="Run the $language test suite in the repo/ directory."]
start -> clone -> test -> exit
}
```
When launched with `fabro run run.toml`, Fabro replaces `$repo_name`, `$repo_url`, and `$language` with their values before parsing the graph.
### Undefined variables
If a `$variable` in the DOT file has no matching entry in `[vars]`, Fabro raises an error. This catches typos early — a misspelled `$langauge` fails immediately rather than passing a literal `$langauge` to the LLM.
### Escaping `$`
To include a literal `$` in the output, write `$$`:
```dot
test [prompt="The env var is $$HOME"]
```
This produces `The env var is $HOME` without treating `$HOME` as a variable reference. A bare `$` not followed by an identifier character (e.g. `costs $5`) does not need escaping.
## The `$goal` variable
Inside agent and prompt node prompts, Fabro automatically expands `$goal` to the workflow's `goal` attribute. This happens at runtime, after graph parsing:
```dot title="example.dot"
digraph Example {
graph [goal="Implement the login feature"]
plan [label="Plan", prompt="Create a plan for: $goal"]
}
```
The plan node's prompt becomes `"Create a plan for: Implement the login feature"`.
## Variable merging
When using server-level run defaults alongside a run config TOML, variables are merged. Task config vars override default vars when keys collide:
| Source | Priority |
|---|---|
| Run config TOML `[vars]` | Highest — wins on collision |
| Server defaults `[vars]` | Lowest — provides fallback values |