flowchart LR accTitle: From store activity to a decision at send time accDescr: Inspect the durable event key, waiting interval and current order record at the moment a message would leave the CRM. %% case-crm-send-time (en) %% https://www.thebsq.com/work/ecommerce-crm-automation/ %% n_activity — The shop records the durable basket key, activity time and storefront. A basket start is evidence of activity, while a completed purchase needs its own record. n_activity["Store event occurs"] %% n_state — Apply a store event only to the relationship that can be established from its reference. Preserve its business time when delivery is late. n_state["CRM applies the event"] %% n_clock — Wait the agreed interval since activity. A late event can update history after the useful window for a particular message has passed. n_clock["Workflow evaluates timing"] %% n_eligible — Check eligibility for the proposed purpose and competing journeys. An expected transaction notice can take priority over a promotional reminder. n_eligible["Message eligibility"] %% n_decision — Immediately before contact, check order state, eligibility and timing again. Record the reason for the action taken. n_decision["Send-time decision"] %% n_send — Submit the approved content only for the eligible, still-open purchase journey. Keep the actual send status separate from the scheduled intention. n_send["Approved contact"] %% n_outcome — Separate opens, link activity and confirmed purchases. Compare eligible customers over the same window and include the cost of actual contacts. n_outcome["Observed customer response"] %% n_late — A purchase can complete before its event reaches the CRM. Consult the authoritative order record at send time. n_late["Late order event"] %% n_purchase — Use the authoritative purchase status and associated basket key to determine whether a reminder is still relevant for this customer. n_purchase["Confirmed order"] %% n_hold — Suppress a reminder after a confirmed purchase. Hold an uncertain or stale decision for reconciliation under the agreed rule. n_hold["Hold or suppress"] n_activity -->|"joins the durable basket key"| n_state n_state -->|"starts or refreshes the waiting interval"| n_clock n_clock -->|"checks timing and purpose"| n_eligible n_eligible -->|"checks eligibility immediately before send"| n_decision n_decision -->|"eligible and purchase still open"| n_send n_decision -->|"purchase completed or facts unclear"| n_hold n_send -->|"records actual contact and response"| n_outcome n_late -->|"consults the authoritative state"| n_purchase n_purchase -->|"provides the latest order outcome"| n_decision n_hold -->|"reconciles the unresolved order"| n_purchase %% Evaluate a scheduled contact — n_activity → n_state → n_clock → n_eligible → n_decision → n_send → n_outcome %% Resolve a late purchase — n_late → n_purchase → n_decision → n_hold → n_purchase