Skip to content

Separating Read and Write Phases in Automation Workflows

Why Phase Separation Matters

Mixed read/write scripts are hard to reason about under failure.

When discovery, planning, and execution are blended:

  • Operators cannot review intended changes clearly
  • Debugging is harder after partial execution
  • It becomes difficult to reproduce run decisions

Phase separation makes behaviour inspectable and controllable.


  1. Discovery: collect live facts
  2. Validation: enforce policy and prerequisites
  3. Planning: compute diff and proposed actions
  4. Approval: optional human gate
  5. Execution: apply approved plan only
  6. Verification: confirm intended state and service health

Each stage should emit structured artifacts.


Plan Artifact Pattern

Before any write, produce a plan document containing:

  • Target list and scope constraints
  • Pre-flight status per target
  • Intended changes per target
  • Risk classification and rollback option
  • Approval metadata (if required)

Execution then consumes this immutable plan.


Operational Benefits

Phase separation improves:

  • Safety: easier to block unsafe writes
  • Explainability: clear reason for each action
  • Repeatability: same plan can be re-run predictably
  • Auditability: artifacts show what was intended vs applied

Production Checklist

  • Read and write logic are implemented as separate phases
  • Plan output is reviewable before execution
  • Execution is blocked without a valid plan artifact
  • Verification runs after writes and is persisted
  • Operators can replay a run from artifacts

Anti-Patterns

  • Auto-generating and applying plan in one opaque function
  • No durable plan artifact
  • Mutating target scope during execution phase
  • Skipping verification due to time pressure

Key Takeaway

Separating read and write phases turns automation from a script into a reliable operational system.


Continue the Series

Get notified when the book ships

Christopher is writing a book on production-grade Cisco network automation: one script, followed from twelve lines to a system that upgrades hundreds of devices, and every failure along the way. Join the list to hear when it ships and when new Academy material goes up.

One list, occasional emails, unsubscribe any time. Sign-up is handled by Kit; see the Privacy Policy.

Need this applied in a live Cisco environment?

This guide is part of the Nautomation Prime Academy and stays free to read, share, and reuse. If you want the pattern built, governed, or adapted for your estate, I'm available for contract engagements, and I take on smaller fixed-scope projects by enquiry. If you are a registered UK charity or CIC, there is a free and low-cost route instead.