flowchart LR accTitle: A late order event and the check at send time accDescr: A sequence between the shop, the order system, the CRM workflow and the email service. The shop sends a basket event at 10:00 with an event ID, and the workflow plans a reminder for the next day. The customer buys at 09:50 on that day. The order event does not reach the workflow in time. At 10:00 the workflow asks the order system whether an order exists for this basket. The answer is yes, and the reminder is cancelled. The late event arrives at 10:05 and is ordered by its source time. The email service receives no request. %% ref-crm-late-order (en) %% https://www.thebsq.com/work/ecommerce-crm-automation/ %% n_shop — The shop records the basket and later the purchase. Each event carries the time at the source and an event ID. n_shop["Shop"] %% n_order — The system of record for a confirmed purchase. Its event can arrive late, and its status can be asked at any time. n_order["Order system"] %% n_workflow — The workflow plans the reminder after the basket event and orders all events by their source time. n_workflow["CRM workflow"] %% n_check — Before a message leaves, the workflow asks for the current order status. A missing or stale answer follows a defined rule. n_check["Send-time check"] %% n_email — The service receives no request in this case. When it does, the send key lets a retry return the first result. n_email["Email service"] n_shop -->|"sends the basket event"| n_workflow n_shop -->|"records the purchase"| n_order n_order -->|"delivers the order event late"| n_workflow n_workflow -->|"runs the check at send time"| n_check n_check -->|"asks for the current status"| n_order n_check -->|"releases a message only without an order"| n_email %% The reminder that is cancelled — n_shop → n_workflow → n_check → n_order %% The late order event — n_shop → n_order → n_workflow → n_check