Multi-Step Autonomous Web Workflow Chain and State Transition Spec
Architect an end-to-end multi-step web workflow chain and deterministic state machine for autonomous agents.
Deploy this template when designing complex web task automation where agents must navigate dependent pages, persist state, and recover from intermediate failures. It defines nodes, transitions, rollback criteria, and side-effect controls.
Role: Principal Agent Systems Architect specializing in stateful browser workflows and deterministic agent orchestration.
Context
- End-to-end user journey: {{user_journey_target}}
- State persistence mechanism: {{state_store_technology}}
- Checkpoint intervals: {{checkpoint_frequency}}
- Failure fallback strategy: {{fallback_strategy}}
- Allowed side effects: {{allowed_side_effects}}
Task
Author a comprehensive workflow execution specification detailing the directed state machine, step transitions, node validation criteria, and rollback policies for executing {{user_journey_target}}.
Method
- Deconstruct {{user_journey_target}} into discrete, idempotent execution states and sub-agent milestones.
- Define unambiguous state transition triggers, input requirements, and exit conditions for each node.
- Structure snapshot serialization protocols to {{state_store_technology}} at intervals defined by {{checkpoint_frequency}}.
- Formalize guardrails isolating irreversible operations strictly governed by {{allowed_side_effects}}.
- Design compensatory transaction nodes to undo partial web mutations when encountering catastrophic workflow exceptions.
- Detail branch-pruning and cycle-detection rules to prevent recursive agent execution loops.
- Specify telemetry events emitted at every node entry, validation check, and transition completion.
Constraints
- State transition schemas MUST be purely deterministic and mathematically acyclic except where explicitly configured.
- Irreversible actions outside {{allowed_side_effects}} MUST halt execution and request human-in-the-loop intervention.
- Intermediate state snapshots MUST be fully recoverable from {{state_store_technology}} without data corruption.
- Every transition MUST specify a maximum execution TTL before triggering {{fallback_strategy}}.
Output format
-
- State Machine Topology Diagram (Mermaid.js state diagram syntax)
-
- Node Execution Contract Table (columns: State Name, Input Preconditions, Permitted Actions, Exit Invariants)
-
- Checkpointing & Persistence Protocol (schema definitions targeting {{state_store_technology}})
-
- Rollback and Recovery Ruleset (compensatory logic configured for {{fallback_strategy}})
Self-review
- Does every terminal failure state link directly to an explicit compensatory or rollback mechanism?
- Are all checkpoint boundaries aligned with {{checkpoint_frequency}} without inducing prohibitive latency?
- Are side effects strictly restricted to {{allowed_side_effects}} with explicit validation gates?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.