Skip to main content

Workflows Reference

Media placeholders

Before publishing, capture the workflow list, detail page, Visual and YAML builder modes, validation panel, Run Workflow form, a human-input pause, and Rerun from Saved State. Redact repository paths and external identifiers.

Workflows are repeatable execution graphs. Use them when a task needs explicit inputs, multiple steps, branching, review points, retries, child workflows, or durable outputs.

User-visible workflow surfaces

SurfacePurpose
WorkflowsBrowse saved workflows and start a valid workflow.
Workflow detailReview description, validity, versions, nodes, edges, and previous runs.
Edit → VisualBuild the graph with nodes, edges, and property panels.
Edit → YAMLEdit the complete workflow definition and preview its graph.
Run WorkflowComplete the generated input form and create an execution.
Execution detailFollow nodes, logs, traces, input requests, costs, artifacts, children, and saved states.

The builder synchronizes Visual and YAML representations when you switch modes. Save and validate after changing either representation.

Minimal definition

name: investigate-and-review
description: Investigate a request, then ask a human to review the result.
version: 1
context:
requires: [repo]
input:
request:
type: string
required: true
widget: textarea
label: Request
repo_path:
type: string
required: true
widget: repo_picker
label: Repository
nodes:
investigate:
type: agent
agent: bug-investigator
prompt: |
Investigate this request in {{repo_path}}:
{{request}}
outputs:
findings: Evidence-backed findings and recommended next step.
review:
type: human
human:
kind: review
widget: approval_gate
title: Review findings
question: Approve the recommended next step?
edges:
- from: START
to: investigate
- from: investigate
to: review
- from: review
to: END

Top-level fields:

FieldRequiredPurpose
nameYesUnique workflow name used for discovery and routing.
descriptionNoUser-facing summary shown in workflow surfaces.
versionNoDefinition version. New workflows default to version 1; saved definition updates increment the stored version.
contextNoDeclares requirements, tools, secrets, or concurrency metadata.
inputNoSchema used by the run form and required-input validation.
nodesYesNamed workflow steps.
edgesYesRoutes between START, nodes, and END.

Input schema

input is a map from the exact input key to its definition. Use these same keys when calling a workflow through chat or API.

FieldPurpose
typeValue type such as string, boolean, number, object, or array.
requiredRejects a missing, null, or empty-string value when true.
defaultPrefills the run form where supported.
labelHuman-readable form label.
descriptionHelp or fallback placeholder text.
placeholderExplicit placeholder text.
enumAllowed values; renders a select control.
widgettext, textarea, checkbox, select, repo_picker, or number.
min / maxInclusive bounds for number inputs.

The run form casts booleans and numbers before starting the execution. A repository picker can list registered repositories and accept a manual path. Use it only when the workflow actually declares a repository requirement.

If Allen reports WORKFLOW_INPUT_VALIDATION_FAILED, reload the workflow and rebuild the input from the exact saved parsed.input keys rather than guessing a field name.

Node types

If type is omitted, Allen treats the node as an agent node.

TypeKey fieldsBehavior
agentagent, prompt, outputs, agentOverridesRuns a configured agent and records its session, tools, usage, context, and declared outputs.
codefunction, config, retry fieldsRuns a registered Allen built-in function. Validation rejects unknown function names.
humanhuman or legacy prompt/fieldsPauses with waiting for input until a human submits a decision or form values.
workflowworkflow, input_map, output_mapStarts a child workflow and maps selected inputs and outputs.
conditionconditionsEvaluates named expressions and writes boolean results into workflow state.

Agent nodes

Common agent-node fields:

FieldPurpose
agentName of the configured Allen agent to run.
promptTemplate rendered from workflow input and upstream state.
outputsNamed outputs with descriptions. Describe each value clearly for downstream routing.
output_formatjson for structured downstream use or freeform for prose.
agentOverridesPer-node provider, model, reasoning, plan mode, external MCP, or tool exclusions. Does not edit the agent record.
resume_on_retryDefaults to true. Set false when a retry should start a fresh model session.
session_keySeparates agent sessions across loop iterations when each item needs independent context.
timeoutNode timeout in seconds.

At spawn time, node overrides take priority over chat-session overrides, which take priority over the agent's defaults.

Code nodes

Code nodes reference a registered function and may pass config. Retry controls include:

FieldPurpose
retriesNode retry count. High values produce validation warnings.
backoffexponential, linear, or fixed.
backoff_base_msBase delay for the backoff calculation.
retry_onError labels eligible for retry.
on_failurefail, skip, or fallback.
fallback_valueOutput used by the fallback path.

Review code-node side effects and retry idempotency. A retry can duplicate an external action if the function does not guard it.

Human nodes

Use a human node before irreversible or externally visible work. The richer human block supports:

  • kind: clarify, review, or recover;
  • widget: dynamic form, approval gate, retry-exhausted gate, or escalation gate;
  • title, summary, question, highlights, and evidence;
  • typed fields, including text, boolean, number, and select;
  • actions that continue, retry a target node, or end the run;
  • required feedback on request-changes or rejection paths.

Allen validates action targets, field names, and select options before the workflow is considered valid.

Child workflow nodes

run_design:
type: workflow
workflow: tdd-design-by-severity
input_map:
requirement: "{{request}}"
repo_path: "{{repo_path}}"
output_map:
design_summary: implementation_plan

The child is a separate execution linked to its parent. Inspect the execution tree when reviewing status and cost.

Edges and routing

START and END are reserved graph boundaries.

FieldPurpose
from / toNode name, boundary name, or an array used for a fork or join.
conditionExpression evaluated against current state before routing.
parallelRuns an array of targets as a parallel fork.
joinwait-all, wait-any, or fail-fast; defaults to wait-all.
mergePer-key merge strategy: last, concat, min, max, all, or any.
max_retriesBudget for a backward or retry edge.
retry_contextFeedback rendered for the retry target.
allow_revisitAllows a completed node to be visited again.

Example retry route:

- from: qa
to: implement
condition: "qa_verdict == 'fail'"
max_retries: 2
retry_context: "Fix these findings: {{qa_findings}}"

Validation

Validation checks structure and known references. Errors can include:

  • missing name, nodes, edges, or a START route;
  • unknown edge sources or targets;
  • orphan nodes;
  • unsafe backward edges without a condition or retry budget;
  • unknown agents, built-in functions, or child workflows;
  • invalid human presentation fields or action targets;
  • invalid condition syntax.

Warnings can include unresolved template variables, unknown condition sources, high retry budgets, or parallel forks without a matching join.

A valid result means the graph satisfies these checks. It does not prove that prompts are sufficient, credentials work, repository state is safe, or external side effects are idempotent. The workflow detail page disables Run when validation has errors.

Built-in catalog

Allen currently seeds these workflow definitions. The live Workflows list can also contain user-created or imported workflows.

WorkflowPurpose
agent-build-with-reviewDesign, validate, review, and create an agent.
workflow-build-and-reviewDraft, validate, review, and persist a workflow.
requirement-to-prd-ensembleProduce and review a PRD from a product requirement.
tdd-design-by-severityProduce severity-aware technical design and implementation-readiness evidence.
feature-plan-and-implementPlan, implement, validate, document, review, and prepare a feature change.
bug-fix-by-severityInvestigate and route a bug through size-aware implementation and review.
milestone-implementation-from-prd-tddImplement milestones from approved PRD and TDD artifacts.
multi-repo-change-orchestrationPlan and coordinate related work across repositories.
allen-self-healing-monitor-hourlyScan runtime evidence, deduplicate incidents, ticket findings, and optionally dispatch repair.
self-healing-incident-triageAnalyze and route one recorded incident.

Always inspect a workflow's current input schema before starting it. Built-in definitions can evolve between releases.

Execution state and saved states

Workflow executions record the input, current state, completed nodes, attempts, sessions, cost, logs, traces, context usage, child execution links, and a snapshot of the workflow definition that actually ran.

User-visible statuses include queued, running, waiting for input, completed, failed, and cancelled. Allen saves a checkpoint after a node completes successfully.

From execution detail, operators can:

  • submit human input;
  • cancel, pause, or resume current progress;
  • retry from a node;
  • inspect and edit eligible saved state;
  • run from a checkpoint using the same execution lineage;
  • fork a checkpoint into a new execution lineage;
  • inspect children, logs, activity, traces, artifacts, and failure reports.

Imported replay executions are read-only for resume and retry operations.

API summary

Method and pathPurpose
GET /api/workflowsList workflows; summary=true returns a smaller list shape.
POST /api/workflowsCreate from YAML or parsed JSON.
GET /api/workflows/:idGet one saved workflow.
PUT /api/workflows/:idUpdate its definition or visual layout.
DELETE /api/workflows/:idSoft-delete it.
POST /api/workflows/:id/validateRevalidate and save the result.
GET /api/workflows/:id/mermaidGenerate a Mermaid representation.
GET /api/workflows/:id/exportExport one workflow as YAML.
POST /api/workflows/importImport one YAML workflow.
POST /api/workflows/export / import/jsonMove portable JSON bundles.
POST /api/executionsStart a workflow with workflowId and input.

Review before running side effects

Before publishing or running a workflow that can change state:

  1. Confirm the generated form matches every required input key.
  2. Fix validation errors and review warnings.
  3. Create or select an isolated workspace before repo-writing agents run.
  4. Review model, system-tool, external MCP, and credential access.
  5. Place human approval before commits, pull requests, tickets, messages, deployments, or destructive actions.
  6. Set bounded retry and escalation paths.
  7. Check that retries cannot duplicate external side effects.
  8. Save reviewable deliverables as artifacts without secrets.
  9. Confirm the final execution output with independent validation evidence.