apex-workflow-engine
Skill216 starsChanged 2 months agoMITView on GitHub
**UTILITY SKILL** — Machine-readable workflow DAG for the multi-step agent pipeline. Defines node types, edge conditions, gates, and fan-out patterns. WHEN: "orchestrator step routing", "resume from graph", "workflow validation", "workflow DAG", "workflow gate", "fan-out pattern". USE FOR: orchestrator step routing, resume-from-graph, workflow validation. DO NOT USE FOR: Azure infrastructure, code generation, troubleshooting.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- apex-agent-authoringSkill
- apex-azure-adrSkill
- apex-azure-artifactsSkill
- apex-azure-bicep-patternsSkill
- apex-azure-cloud-migrateSkill
- apex-azure-complianceSkill
- apex-azure-computeSkill
- apex-azure-cost-optimizationSkill
- apex-azure-defaultsSkill
- apex-azure-deploySkill
- apex-azure-diagnosticsSkill
- apex-azure-governance-discoverySkill
- apex-azure-kubernetesSkill
- apex-azure-kustoSkill
- apex-azure-prepareSkill
- apex-azure-quotasSkill
- apex-azure-rbacSkill
- apex-azure-reliabilitySkill
- apex-azure-resourcesSkill
- apex-azure-storageSkill
- apex-azure-upgradeSkill
- apex-azure-validateSkill
- apex-context-managementSkill
- apex-entra-app-registrationSkill
- apex-github-operationsSkill
- apex-golden-principlesSkill
- apex-host-debug-log-exportSkill
- apex-host-git-commitSkill
- apex-host-workflow-startSkill
- apex-iac-commonSkill
- apex-mermaidSkill
- apex-microsoft-docsSkill
- apex-python-diagramsSkill
- apex-terraform-patternsSkill
- apex-terraform-search-importSkill
- apex-terraform-testSkill
- apex-unslopSkill
- apex-vendor-promptingSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Use the graph and apex-recall show <project> --json together.
- Very specific: line 73
Use Steps as the routing protocol.
- Distinctive: line 90
Do not load retired documentation tooling when advancing infrastructure steps.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workflow Engine Skill
Provides a declarative, machine-readable workflow graph that the Orchestrator reads instead of relying on hardcoded step logic.
When to Use
- Orchestrator determining the next step after a gate
- Resuming a workflow via
apex-recall show <project> --json - Validating that all steps have proper dependencies and outputs
- Understanding fan-out (parallel sub-steps) and conditional routing
Rules
- Forward DAG —
edgesmust be acyclic; refinement routes are declared separately inreturn_edges. - Source of truth is
templates/workflow-graph.json— the orchestrator reads this directly; do not encode workflow logic in agent prose - Gates are blocking — a
gatenode halts downstream execution until human approval is recorded in session state - IaC routing —
step-4is the shared planner; select CodeGen and Deploy nodes usingdecisions.iac_tool. - Fan-out is logical work structure, not permission to invoke main agents or unavailable workers. The owning main agent handles its outputs; parallelize only independent, authorized work.
- Edge conditions — follow the graph's declared conditions, including refinement returns; the schema allows a string or array.
- Schema evolution — bump
metadata.versionand followreferences/schema-evolution.mdrollback rules when changing the graph
Prerequisites
Use the graph and apex-recall show <project> --json together. If the returned
session is empty, initialize or recover the project before routing.
Steps
Orchestrator protocol for routing the next step:
- Load
templates/workflow-graph.json - Read current state — use
session.current_step,session.steps, andsession.decisionsin the response. - Resolve the node — use the per-step status map to distinguish Design (
3) from Governance (3_5); usedecisions.iac_toolfor the CodeGen and Deploy tracks. Do not derive a node ID from the numeric pointer alone. - Check node status:
complete→ followon_completeedges → find next nodein_progress→ resume fromsub_stepcheckpointpending→ offer the declared human handoff to the owning main agentskipped→ followon_skipedges- failed or blocked → stop and follow the applicable declared recovery or refinement route
- Apply edge and node conditions — honor optional Design selection and the IaC track; do not execute every outgoing edge when alternatives are present.
- If next is a
gate— check its preconditions, present to the user, wait for approval, and record the decision. - If next is a
subagent-fan-out— use the owning agent's actual role/tool contract; never infer callable workers from graph children. Collect required outputs before continuing. - Repeat until all nodes are complete or blocked
Core Concepts
Forward execution and declared refinement returns are distinct. A shared
step-4 plan feeds step-5b / step-5t, then step-6b / step-6t.
Approval gates remain blocking on both tracks.
Full node-type table, edge-condition matrix, and IaC routing rules in
references/dag-concepts.md.
Workflow Graph
The full machine-readable DAG is in:
templates/workflow-graph.json
Reading the Graph (Orchestrator Protocol)
Use Steps as the routing protocol. Response fields are documented in
show-schema.md.
Reference Index
Operational Local and Host entrypoints share
workflow-entry.md. For parent-to-worker calls,
read execution-subagent.md.
Manual Host workflow entry uses
apex-host-workflow-start, including
resume [project]. This skill requires explicit owner selection; it does not bind models/tools.
Other retained Local operations load only their requested procedure:
imported IaC,
existing Azure as-built,
project review.
Published documentation maintenance belongs to the separate jonathan-vella/apex-docs repository.
Do not load retired documentation tooling when advancing infrastructure steps.
For their shared execution boundary, read
operational-safety.md.
| Reference | File | Content |
| Workflow Graph | templates/workflow-graph.json | Full DAG for the multi-step workflow |
| Orchestrator Handoff | references/orchestrator-handoff-guide.md | Gate templates, IaC routing, delegation rules |
| Subagent Integration | references/subagent-integration.md | Subagent matrix, pricing accuracy, review protocols |
| Handoff Validation Rules | references/handoff-validation-rules.md | B1a–B5 rule reference (workflow-handoffs PART) |
| Track Parity Spec | references/track-parity-spec.md | B4 normalization spec for Bicep/Terraform parity |
| Schema Evolution | references/schema-evolution.md | D1 versioning policy + D2 rollback (metadata.version) |
Validation Surfaces
The workflow graph is enforced at three points:
| Validator | Rule registry | Scope |
tools/scripts/validate-workflow-graph.mjs | inline | Graph shape + schema |
tools/scripts/validate-agents.mjs --only=workflow-handoffs | WORKFLOW_HANDOFF_RULES | handoffs[] UI buttons + agents[] dispatch |
tools/scripts/validate-artifacts.mjs | ARTIFACT_HEADINGS["00-handoff.md"] | Gate-companion file H2 sync |
npm run validate:_node includes these checks. For focused graph and handoff
checks, use npm run validate:workflow-graph and npm run lint:workflow-handoffs.
Artifact Markdown validation remains owned by the existing hooks and challenger review.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

