Orchestration directives
A tool can end its response by saying what should run next. awe reads that and runs it, without the AI deciding. This page is for developers who write MCP tools or keyword routes for awe. If you want a multi-step job that you describe yourself, use a workflow instead: it gives you a plan to approve, a run record and steps that really run side by side.
Directives are followed by awe’s keyword router, the part that runs a tool straight from a phrase. That covers ./do "..." and tools that the console runs from a phrase before the AI answers.
The shape
Add an orchestration object to the tool’s response:
{
"content": [{ "type": "text", "text": "Found 3 stale branches." }],
"orchestration": {
"execution_type": "parallel",
"user_choice_required": false,
"options": [
{ "label": "lint", "intent": "run the linter" },
{ "label": "tests", "intent": "run the test suite" },
{ "label": "types", "intent": "typecheck the project" }
]
}
}
Each intent is a phrase. awe matches it against its keyword routes the same way it would match something a person typed, and runs the best match.
Where awe looks
In this order, taking the first it finds:
orchestrationat the top level of the response. Prefer this.result.orchestration.orchestrationinside one of thecontentitems.- An
orchestrationkey in the stored parameters of the keyword route that started the tool. This lets a route ask for a follow-up without changing the tool.
A directive that does not parse is reported in .awe/system.log, wherever it was found, with the reason and the place:
[Orchestration] an `orchestration` directive in `result.orchestration` was present but REJECTED: missing field `user_choice_required` …
Required: execution_type (immediate | conditional | parallel | sequential) and user_choice_required (true | false)
Fields
| Field | Required | Meaning |
|---|---|---|
execution_type |
yes | immediate, conditional, parallel or sequential. Anything else is rejected. |
user_choice_required |
yes | true or false. Leaving it out makes the whole directive fail to parse. |
next_intent |
no | One phrase to run next. |
options |
no | A list of { "label": "...", "intent": "..." }. |
conditions |
no | For conditional: keys and the values they must have in what the tools have shared so far (their shareable_context). |
parameters, context_data, and parameters on an option |
no | Accepted, but not used yet, and the log says so when they are set. A follow-up tool gets its arguments from its own keyword route and the original request. |
Under parallel or sequential, set either options or next_intent, not both. Both together is an error. Nothing further runs, and the log says:
orchestration directive sets BOTH `options` and `next_intent` under Parallel —
they are alternatives (next_intent is single-branch shorthand). Pick one.
The four modes
execution_type |
What runs |
|---|---|
immediate |
next_intent: the single best-matching tool. |
conditional |
next_intent, or one of options chosen by a person. |
parallel |
Every entry in options, one tool each. |
sequential |
Every entry in options, one tool each, in the order written. |
immediate
{ "execution_type": "immediate", "user_choice_required": false, "next_intent": "summarise the results" }
conditional
{
"execution_type": "conditional",
"user_choice_required": false,
"conditions": { "status": "failed" },
"next_intent": "open the failure log"
}
With user_choice_required: false, next_intent runs only when every key in conditions has exactly that value in what the tools have shared so far. A tool shares values by returning a shareable_context object. When a condition does not match, nothing runs and the log says so. No conditions, or {}, means it always runs.
With user_choice_required: true and options, the labels are printed as a numbered list and the choice is read from the terminal. This only works when a person is running ./do or ./awe-core in a terminal. Do not use it for tools called from the console or by text.
parallel and sequential
{
"execution_type": "sequential",
"user_choice_required": false,
"options": [
{ "label": "filings", "intent": "fetch the latest filings" },
{ "label": "pricing", "intent": "check competitor pricing" }
]
}
Each option becomes one branch: the best-matching tool for its intent.
What you can rely on
-
Every branch runs. Three options means three tool calls.
-
A failed branch does not stop the others. That is true of
sequentialtoo: “in order” is about order, not about stopping on failure. -
The count is in the output. After a
parallelorsequentialdirective with more than one option, or whenever fewer branches ran than were written, the result ends with a line like one of these:_Fan: 3/3 branches ran._ _Fan: 2/3 branches ran — 1 did not._An option whose
intentmatches no tool is skipped, logged, and still counted in the total. -
One follow-up chain. If several branches return their own directive, awe continues from the first. The others are not followed, and the log says how many.
-
The chain is bounded. A chain of directives stops after 10 hops. A directive with several branches uses one hop, not one per branch.
-
Each branch is an ordinary tool call. awe’s pre-tool hooks, and the check that stops the same change being made twice, apply to every branch.
What not to expect
- Branches do not run at the same time. Under
parallelthey run one after another. Only the promise about order differs fromsequential. - Branches cannot read each other’s results.
- No plan and no approval step. A directive runs as soon as the tool returns.
When not to use one
- The next step reads this tool’s output. That is a single follow-up (
immediate), or better, one tool that does both. - The steps are known in advance. Write a workflow. A directive is for a tool that only learns at run time what should happen next.
- It is really one lookup. Checking three servers often comes down to one database query. Three tool calls are slower and cost more.
If you add one
Add a test that counts: the number of branches that ran must equal the number of options you wrote. A directive that runs one branch out of three looks the same as one that ran three unless something counts them, which is what the _Fan: line is for.
Related
- workflows.md: multi-step jobs with a plan and approvals
- skills.md: menus and tool steps in a skill
- mcp-protocol.md: how awe talks to tool servers