Agent instructions
AuraScore 83/100

Multi-Step Autonomous Workflow State and Routing Specification

Architect deterministic DAG state transitions, halting conditions, and routing logic for multi-step agent workflow execution chains.

Use this template when building complex, non-linear autonomous agent workflows that require multi-step reasoning, intermediate validations, and human-in-the-loop escalations without losing execution state.

Template

Role: Autonomous Systems Engineer specializing in stateful agentic workflows, directed acyclic graphs (DAG), and deterministic multi-agent chain orchestration.

Context

  • Operational domain: {{workflow_domain}}
  • State transition graph: {{state_transition_graph}}
  • Token budget per step: {{context_window_budget}}
  • Maximum chain iterations: {{max_chain_depth}}
  • Escalation triggers: {{human_in_the_loop_triggers}}
  • Terminal fallback node: {{fallback_state}}

Task

Construct a comprehensive workflow chain specification for {{workflow_domain}}, establishing deterministic state-machine mechanics, context-pruning rules within {{context_window_budget}}, and strict traversal criteria defined by {{state_transition_graph}}.

Method

  1. Define the formal state-space schema representing the global context payload across all workflow steps.
  2. Map every node in {{state_transition_graph}} to input preconditions, execution actions, and exit criteria.
  3. Establish transition logic using deterministic predicate checks and probabilistic confidence thresholds.
  4. Design context window management routines to compress or prune state history within {{context_window_budget}}.
  5. Implement infinite loop prevention and hard termination constraints bound to {{max_chain_depth}}.
  6. Specify interception hooks for human intervention governed by {{human_in_the_loop_triggers}}.
  7. Detail failure-state transitions routing directly to {{fallback_state}} when unrecoverable anomalies occur.

Constraints

  • State graphs MUST NOT contain unbounded cycles or unhandled orphan states.
  • Transitions MUST require deterministic condition evaluation before advancing to subsequent nodes.
  • Context truncation strategies must preserve system directives and critical task identifiers.
  • All state transitions must be logged with execution latency and token consumption metrics.
  • Human escalation hooks must fully freeze state execution until explicit feedback is received.

Output format

Provide the specification in four distinct sections:

  1. Workflow State Machine Architecture (Formal state definitions and schema fields for {{workflow_domain}})
  2. Transition Routing Table (Source State -> Condition -> Target State based on {{state_transition_graph}})
  3. Memory & Context Management Plan (Pruning algorithm honoring {{context_window_budget}} and {{max_chain_depth}})
  4. Escalation and Failure Directives (Protocol for {{human_in_the_loop_triggers}} and {{fallback_state}})

Self-review

  • Ensure all variables ({{workflow_domain}}, {{state_transition_graph}}, {{context_window_budget}}, {{max_chain_depth}}, {{human_in_the_loop_triggers}}, {{fallback_state}}) are applied correctly.
  • Verify every branch in the routing table has an explicit path to a terminal or fallback state.
  • Confirm context pruning rules do not discard immutable system instructions.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-instructions
autonomous-agents-workflows
workflow-chains
state-machine
dag-orchestration