ADR / 010

Automate exits, not only entries

Every automation that creates work when a record enters a state must also define what happens when it leaves it—or the downstream state goes stale.

Reference pattern

Independently created. Contains no employer or client implementation detail, internal names or figures.

01Context

Segments, eligibility and lifecycle states drive tasks, campaign memberships and recovery processes. Each automation was built for the entry: when an account becomes At Risk, create a task and add it to a campaign. None was built for the exit. Recovered and ineligible accounts keep receiving actions, and cleanup is a periodic manual job.

02Decision drivers

  1. D01

    States change in both directions

  2. D02

    Stale actions waste owners’ time and send wrong messages

  3. D03

    Reruns must not duplicate work

  4. D04

    Work in progress must not be discarded

03Options considered

Options considered: when each would be the right choice, what it costs, and the verdict under these premises
OptionRight whenCost / trade-offVerdict
Entry automations only; periodic manual cleanupStates that never reverseDrift accumulates; risky bulk editsRejected
Delete and recreate all actions each runTiny, stateless populationsLoses work in progress; churns recordsRejected
Designed exits per action, plus a reconcilerAny state that drives downstream workAn exit rule per action and a small reconcilerSelected

Every option is right under some premises. The verdict applies to the context above.

04Decision

For every automated action, declare its entry, its key and its exit: what happens to it when the record leaves the state or the population—close, exit, archive or keep—and with which reason. Check eligibility when the action executes, not only when it is triggered. Protect work in progress from automatic closure. Run a reconciler that finds and repairs exits that were missed.

05Consequences

What this choice changes elsewhere in the system.

  1. Business state

    Downstream state follows the current state in both directions.

  2. Idempotency

    Duplicates disappear because every action is keyed.

  3. Reconciliation

    Missed exits are found by the reconciler, not by users.

  4. Design practice

    Designing an automation now includes designing its end.

06Revisit when

The decision holds while its context holds. Challenge it when:

01

The action is purely informational and expires on its own.

02

The downstream system derives membership live from the source state.

07Where this decision is applied

The decision says why this path was chosen; each case shows how it takes part in a larger architecture.

  1. Automation case / 02Designing closed-loop automation from signal to action and exitAutomation as the maintenance of an expected downstream state: entry, update, exit and re-entry designed per transition, system-managed and human-owned work told apart, reruns that converge instead of adding, and reconciliation as the control loop that repairs only what is safe.AutomationRevenue OperationsData & IntegrationsArchitecture case · 11 min

Decisions this one depends on, or constrains.

  1. ADR / 008Run reconciliation as a permanent control, not an exception processDelivery guarantees fail silently. A scheduled comparison of expected and actual populations—with an owner for every kind of difference—is part of the architecture, not cleanup.Proposed patternIntegration · Data · Governance
  2. ADR / 009Model long-running automation as a run record with a state machineWhen automation spans steps, systems or days, give each run an identity, a state and step-level guards—so it can wait, fail, resume and finish exactly once.Proposed patternAutomation · Orchestration · Operations