Your first workflow
A workflow in abt is a file under workflows/ whose edges: wire together nodes — sources, prompts, agents, and exposures. Sources, prompts, and exposures are never agent frontmatter fields; an agent's own frontmatter only ever declares retrievers: (search) and transformers: (post-processing), plus delegation/control fields like subagents:, tools:, output_schema:, and middleware:.
Reach for a workflow when you need more than abt run -s <agent> -p "..." — specifically when you need to:
- Fetch live data before the agent runs (Slack thread, Jira ticket)
- Compose a reusable, named user message ahead of one or more agents
- Search external sources to enrich the prompt (Jira/Confluence/web) — via the agent's own
retrievers: - Post-process the response (JSON extraction, PII redaction, formatting) — via the agent's own
transformers: - Dispatch the result to an external system (Slack, Jira)
Minimal workflow
A prompt is a workflow node (the stem of a file under prompts/), referenced by name from a workflow's edges::
Save this as agents/assistant.md:
---
description: A friendly greeter.
---
You are a friendly greeter.
Save this as prompts/greet_task.md:
Say hello in one sentence.
# workflows/greet.yaml
edges:
- [START, greet_task]
- [greet_task, assistant]
- [assistant, END]
Run it:
abt dispatch -s greet
A workflow name only resolves to node stems matched against the sources/, prompts/, and exposures/ catalogs (falling back to an agent name otherwise) — see resolve_workflow_node_kinds. For ad-hoc text at runtime instead of a named prompt, use abt run -s <agent> -p "..." or abt dispatch -s <workflow> -p "...", which overrides the composed prompt for that run only. Bare abt run -s <agent> with no -p and no workflow always raises — an agent never owns a default prompt.
With a prompt that uses variables
Save this as agents/reviewer.md:
---
description: Reviews content for clarity.
---
You review content and suggest one improvement.
# workflows/review_solo.yaml
edges:
- [START, review_task]
- [review_task, reviewer]
- [reviewer, END]
Save this as prompts/review_task.md:
Review the following content:
{{ var('content', '') }}
Pass variables at runtime:
abt dispatch -s review_solo --vars '{"content": "..."}'
With a source workflow node and an exposure sink node
Sources and exposures are workflow nodes too (see Sources — workflow nodes and Exposures): a source is fetched as its own node in a workflow's edges:, wired ahead of the agent that needs it, and an exposure is dispatched as a sink node wired after the agent that produces the result:
# sources/slack_thread.yaml
name: slack_thread
type: slack_thread
credentials: slack
config:
channel_id: "{{ var('channel_id') }}"
thread_ts: "{{ var('thread_ts') }}"
A var('x') with no default must have a value before abt compile, abt list or a bare
abt run/abt dispatch works, because they render every source and exposure. Give it one under
vars: in abt.yaml (or vars.yaml) and override it per run with --vars; or write
var('x', '') to make it optional:
# abt.yaml
vars:
channel_id: C0EXAMPLE
thread_ts: "1234567890.123456"
# exposures/slack_reply.yaml
name: slack_reply
type: slack
credentials: slack
config:
channel_id: "{{ var('channel_id') }}"
thread_ts: "{{ var('thread_ts') }}"
# workflows/investigate.yaml
edges:
- [START, slack_thread]
- [slack_thread, investigate_incident]
- [investigate_incident, investigator]
- [investigator, slack_reply]
- [slack_reply, END]
Save this as agents/investigator.md:
---
description: Investigates an alert from a Slack thread.
---
Investigate this alert. Here is the Slack thread and any other context in the prompt.
Save this as prompts/investigate_incident.md:
Investigate this alert using the Slack thread below.
{{ upstream('slack_thread') }}
Run it against your own Slack thread (needs credentials.slack in profiles.yaml):
abt dispatch -s investigate \
--vars '{"channel_id":"C0EXAMPLE","thread_ts":"1234567890.123456"}'
Or rehearse without touching Slack — stub the source and skip the exposure:
abt dispatch -s investigate --mock-sources '{slack_thread: "Checkout latency alert, p2"}' --skip-exposures
To start this workflow from a Slack event instead of by hand, add a trigger: — see abt watch.
For a minimal source-node + exposure-node + trigger: workflow, see sources and exposures, and Tutorial 3: Incident Response for a full sources → agents → prompt node → retrievers → transformers → exposure workflow.
Key concepts
- Sources, prompts, and exposures are named workflow nodes, referenced by name in a workflow's
edges:— never fields on agent frontmatter. Define them once undersources//prompts//exposures/, then wire them by name into any workflow'sedges:. This makes them reusable across workflows. - A prompt node's file must be a stem under
paths.prompts(no path separators, no.mdsuffix) — inline task text is not supported as a node. For ad-hoc user text, useabt run -p "..."/abt dispatch -p "...". - Preview:
abt graph <workflow>renders the workflow's topology without calling the model;abt run -s <agent> --dry-runprints an agent's execution plan.--skip-exposuresruns the workflow without delivering anything. --skip-exposures/--skip-sources: skip delivery or fetching for local iteration.
Running an agent vs. dispatching a workflow
- "
abt run -s <agent>is rehearsal,abt dispatch -s <workflow>is opening night." - "An agent name is never a workflow name."
abt dispatchonly accepts workflow names — given an agent name it errors:'triage' is an agent, not a workflow. abt dispatch only accepts workflow names — use abt run -s triage to run it.
Both abt run and abt dispatch take a bare name through a required -s/--select. abt run -s <agent> runs that agent plus its full
subagents: delegation tree, unbounded — never a workflow neighbor. Order and branching between agents
live only under workflows/, not in this selection. Both commands always require an explicit -p unless a workflow supplies
one via a prompt node ahead of the agent.
| Command | What runs | Who it's for |
|---|---|---|
abt dispatch -s <workflow> |
the workflow's full topology from its file under workflows/ — sources, prompt/exposure nodes, conditional edges |
operators pressing a button |
abt run -s <agent> |
one agent plus its subagents: tree, without sources or exposures (those need abt dispatch) |
developers smoke-testing one node |
Omitting -s is a usage error.
See Workflows for the workflows/ topology, Selectors
for the full CLI selection reference, and Multi-agent dependencies
for subagents: delegation.
See also
- Sources — source node types and
freshnessconfig - Exposures — post-run destinations and the exposure-timing rule
- Slack integration — Slack-specific details
- Tutorial 3: Incident Response — a complete hands-on walkthrough of a source → agent → prompt node → retriever → transformer → Slack exposure workflow