Automation case / 02 · Expected state, entry to exit & reconciliation

Designing closed-loop automation from signal to action and exit

Not “when X, do Y”, but keeping downstream work true to a signal that keeps changing.

The case in brief

Current reality

The first automation handles only entry—“when an account becomes At Risk, create a task”. The signal keeps changing and nothing follows it, so stale tasks, old memberships, recovery work after recovery and duplicate actions accumulate.

What must become true

For every governed source state, the automation knows what should exist, what should change, what should be removed, what must remain untouched, what happens on re-entry and what may safely run again—and keeps the downstream state implied by the current business condition, not just the one implied by the first entry.

Design question

How does a changing business signal produce exactly the right downstream actions—and remove or change them when the signal no longer applies?

01The reality · current state

What the automation does today.

Accounts carry a governed performance signal—On Track, Underperforming, At Risk or No Sale—and an eligibility flag, published by the data platform. Each state should drive different follow-up: action memberships, a task for the owner, a recovery obligation, visibility in the management review. The first version reacted to the signal with a trigger that created actions on entry—and never removed, changed or checked any of them.

  • Accounts that recovered still receive risk follow-up
  • Old memberships remain after the signal has moved on
  • Recovery work is created after the account has already recovered
  • A rerun of the signal creates a second task
  • Two states leave conflicting follow-up on the same account
  • Accounts no longer eligible keep open actions

02Why the naïve version fails

What the first automation cannot answer.

The first version reacts to entry. The signal keeps changing; the downstream state does not follow—and every change leaves something behind.

  • Stale tasksTasks created for a state the account has already left.
  • Old membershipsAction memberships that keep running after the signal moved on.
  • Recovery work after recoveryAn obligation opened for an account that is On Track again.
  • Multiple actions after rerunsThe same signal processed twice creates the same work twice.
  • Conflicting stateFollow-up from two states on one account, each correct when it was created.
  • Actions for ineligible subjectsWork that stays open for accounts no longer in scope.

03Key dimension · Expected state, entry to exit & reconciliation

Expected state against actual state—then converge

The automation does not react to a change once. It maintains the downstream state the current signal implies, and compares it with what exists every time it runs.

The control loop
  1. 01Source stateThe governed signal, as published and as of a date
  2. 02Expected action setWhat the current state implies downstream
  3. 03Actual action setWhat exists today, found by automation key
  4. 04DifferenceMissing · unexpected · wrong state · orphaned
  5. 05ConvergeCreate · update · remove · preserve · escalate
Entry to exit
  1. Enter

    What starts when an account enters a state?

    Create the expected set once, keyed by Account + segment + entry period.

  2. Current

    What changes while it stays there?

    Update in place when an owner or a guard changes; never a second copy.

  3. Change

    What happens when it moves to another state?

    Close what only the old state required, create what the new one requires, keep what both require.

  4. Exit

    What stops when it leaves?

    Close or remove system-managed work with a reason; flag human work for review.

  5. Re-entry

    What if it comes back later?

    A new entry period: a new key and a fresh obligation; the earlier episode stays as history.

What each state implies downstream

Expected downstream state per source state: what should exist and what should not
Source stateShould existShould not exist
At Risk
  • Recovery obligation for the owner
  • Visibility in the management review
  • Retention action membership where the account qualifies
  • Growth or reactivation follow-up
Underperforming
  • Review call for the owner
  • Growth action membership
  • Recovery obligation
On Track
  • Nurture membership
  • Active recovery obligation
  • Risk action membership
No Sale
  • Reactivation task
  • Reactivation membership
  • Recovery obligation
No longer eligible
  • System-managed follow-up closed or removed, with a reason
  • Human-authored work preserved and flagged
  • Any automated membership or open automated task

Most duplicate and orphan problems are exit problems. Design the exit column first.

04Step contract

Each step with its mode, its actor and its guard.

Trigger

A new version of the governed signal is published for an account.

Done means
  • The actions the current state requires exist exactly once, keyed by Account + segment + entry period
  • Actions the state no longer requires are closed or removed with a reason
  • Human-authored work is preserved and flagged, never destroyed
  • Differences are visible to the reconciler

Systems and partiesData platformCRMCampaign platform

  1. 01
    Signal published

    A new version arrives with the previous and the current state, as of a date.

    AutomatedData platform
  2. 02
    Derive expected set

    What the current state implies downstream, for this account.

    AutomatedCRM automationGuardEligibility re-checked at execution
  3. 03
    Read actual set

    What exists today, found by automation key—not by name or date.

    AutomatedCRM automation
  4. 04
    Converge

    Create what is missing, update what is wrong, close what is no longer expected, leave the rest.

    OrchestratedCRM · campaignsGuardAccount + segment + entry period
  5. 05
    Owner review

    Flagged human work and the recovery plan the state requires.

    HumanAccount owner
  6. 06
    Owner notification

    One summary per owner per run, not one per record.

    AutomatedCRM

05Entry, update, exit & re-entry

Every automatic entry needs an automatic exit strategy.

Each transition says what is created, what is updated, what is closed or removed, what is preserved, who owns it and what guards it. Thresholds and names are illustrative.

Action matrix: for each transition, what is created, updated, closed or removed and preserved, with its owner and guard
TransitionCreateUpdateClose / removePreserveOwnerGuard
No signal → At RiskRecovery obligation; retention membership——Open seller tasksAccount ownerEligible; active owner; no obligation for this entry period
At Risk → UnderperformingReview callManagement visibility levelRetention membershipThe seller’s recovery planAccount ownerSignal version newer than the one that created the obligation
At Risk → On Track——Recovery obligation as “recovered”; retention membershipSeller commitments and notesAutomation; the owner confirmsSignal version newer than the obligation’s
No Sale → active——Reactivation task and membership as “reactivated”The opportunity the seller openedAutomationOrder confirmed in the governed model
Eligible → not eligible——Every system-managed membership and task, with a reasonHuman-authored work, flagged for reviewAutomation; team lead for flagged workBlast-radius limit
Not eligible → eligibleThe current state’s expected set, with a new entry period——History from the earlier episodeAccount ownerEligibility re-checked at execution
Same state, next periodNothing: the key already existsOwner, if it changed—Everything open—Entry period unchanged

06System vs human work

Automate the coordination, keep the judgement visible.

The automation may manage what it created. It must not destroy real work authored by people just because a signal changed. Ownership moves to a person the moment they touch the artifact.

Downstream artifacts: who manages each, what the automation may do and what it must never do
ArtifactManaged byThe automation mayIt must not
Action membershipSystemCreate, update or remove it to match the expected stateKeep it after the state that required it has gone
Automated reminder task, untouchedSystemCreate it; close it with a reason when no longer expectedReopen it silently
Task the seller has started or editedPersonFlag it for review; suggest closing itClose it because a segment changed
Recovery plan or customer commitmentPersonPrompt a review; link the new signalClose, delete or rewrite it
Management review entrySystemAdd or remove it with the stateHide an obligation that is still open

07Execution safety

If it can run twice, it is designed to run twice.

Execution patternEvent-driven convergence with keyed effects + scheduled reconciliation

Changes arrive per account, but the downstream state spans two systems and several runs—and must stay correct whatever order they arrive in.

Automation key
Account + segment + entry period
Eligibility guard
Checked when the action runs, not only when it is triggered
Ownership marker
Every artifact records whether the automation or a person manages it
Exit rule
Leaving a state closes its system-managed actions with a reason
Rerun
Same state in, same downstream state out
Notification
Batched per owner and run

08Safe reruns

Same state in, same downstream state out.

The same source state will be processed again—after a retry, a recovery, a deployment, a backfill or a reconciliation. The result must not change, and nothing may be duplicated because a run executed twice.

Converge, don’t add

Convergent processing: what the lookup by automation key finds and what the automation does
The lookup by automation key findsThe automation
Nothing, but the state expects itCreates it
It, in the wrong state or with the wrong ownerUpdates it
It, no longer expected, system-managedCloses or removes it with a reason
It, no longer expected, human-ownedFlags it for review
It, already correctDoes nothing

When the same state is processed again

Rerun contexts and what keeps each one safe
ContextWhat keeps it safe
After a retryThe automation key: the second attempt finds what the first created
After a recoveryIt works from the difference, not from the original event
After a deploymentRules are versioned; the new version compares against expected state
After a backfillThe entry period comes from the signal, not from the date of the run
After a reconciliationRepairs use the same keys the entry would have used

09Reconciliation

The control loop: expected against actual, then repair only what is safe.

Reconciliation is the control loop of the automation, not a quarterly clean-up. Every day, after the signal is published, expected downstream state is compared with actual downstream state. The automation repairs only what is safe; anything else goes to a person.

Expected downstreamActual downstreamCompared byAccountExpected downstreamActual downstreamOwnership
Show
Expected downstream compared with Actual downstream, one row per key
KeyExpected downstreamActual downstreamOutcome
ACC-A12Retention membershipRetention membershipMatchBoth sides agree.
ACC-B07Recovery obligation—MissingMissing: the entry failed during an outage.
ACC-C33No risk membershipRetention membershipUnexpectedUnexpected: the account recovered and the exit never ran.
ACC-D19Not eligibleReactivation membershipUnexpectedOrphaned: the account left the population; its automated membership stayed.
ACC-E02Review callRecovery call · in progressDifferenceWrong state, but human-owned: the seller is working the call.
ACC-F58Nurture membershipGrowth membershipDifferenceWrong state, system-managed: a later signal was never applied.
  1. Match

    Downstream matches expected.

    Owner
    Nobody
    Action
    Record the check.
  2. Difference

    Present, in the wrong state.

    Owner
    Automation or account owner
    Action
    Update if system-managed; flag for the owner if human-owned.
  3. Missing

    Expected, not present.

    Owner
    Automation
    Action
    Auto-repair: create it with the key the entry would have used.
  4. Unexpected

    Present, no longer expected—or orphaned.

    Owner
    Automation
    Action
    Auto-repair if system-managed and within the blast-radius limit; otherwise flag.
  • Dry run first

    A new rule reports what it would do for a period before it acts.

  • Blast radius

    An unusual share of closes holds the run for review.

  • Protected work

    Anything in progress or recently touched by a person is suggested, never closed.

  • Reversibility

    Every automated close carries a reason and the run ID, so it can be reopened.

10Failure & recovery

Not every failure is a retry.

  • Owner inactive ConfigurationEligibility guardHolding queue for the team leadSales operations
  • Campaign platform unavailable Dependency · retryConnection failuresQueue memberships; converge when it is backPlatform team
  • Signal republished DuplicateAutomation key existsNo new effectsNobody: absorbed
  • Account left the population Stale stateEligibility guard or reconcilerRun the exit rule; flag human workAutomation
  • Signal publication late DependencyExpected state not readySkip the comparison; never reconcile against stale expectationsData team
  • Unusual close volume ValidationBlast-radius limit exceededHold the run for reviewCommercial operations

11The trade-offs

Credible options, judged against these premises.

Rejected

One-way triggers that create actions on entry

One-off actions that never need undoing

Cost: No exits; duplicates on rerun; drift nobody measures
Rejected

Recreate every action on every run

Tiny populations with no human work attached

Cost: Churns memberships and tasks; destroys work in progress
Selected

Maintain expected state, converge and reconcile

Signals that drive work in several systems

Cost: An action-matrix owner, ownership markers and a reconciler to run

Criterion by criterion

Maintaining expected state costs more to design. It is justified when a signal changes over time, drives work in more than one system and sits next to work people author themselves.

Closed-loop options compared criterion by criterion
CriterionOne-way triggersRecreate every runExpected-state maintenance
EntryHandledHandledHandled, keyed
ExitForgottenImplicit, by deleting everythingDesigned per transition
Rerun safetyDuplicatesChurnConverges
Human workIgnoredDestroyedPreserved and flagged
Drift visibilityNoneNoneReconciliation report
Design effortLowLowHigher: matrix, keys and reconciler

Design decision

Model automation as the maintenance of an expected downstream state rather than a series of one-way triggers; make entry, update, exit and re-entry explicit; treat system-managed and human-owned work differently; make every rerun converge; and run reconciliation as the control loop that repairs only what is safe to repair.

Key principleEvery automatic entry needs an automatic exit strategy.

12The second layer

Questions that change the design.

Change

  1. What happens when the state changes?
  2. What happens when the account becomes ineligible?
  3. What happens when it comes back?

Safety

  1. Can a rerun create a duplicate?
  2. When is eligibility checked?
  3. What may the automation close without asking?

Ownership

  1. Who owns the exit path?
  2. When does an artifact become human-owned?
  3. Who reviews what reconciliation flags?

13Decisions & outputs

What the work produces.

  1. 01Expected-state model
  2. 02Entry, update, exit and re-entry matrix
  3. 03Ownership rules
  4. 04Automation keys
  5. 05Convergent rerun logic
  6. 06Reconciliation classes & guardrails
  7. 07Drift report