Late automation events: an old status should not move a case backwards
Test out-of-order events against change sequence, package versions, missing history and a justified return for correction.
Article language: English

In this article
On the job board, a package of drawings is ready to download. A minute later it goes back to “in preparation”. Nobody opened or corrected it. The automation simply received a delayed message that work had started and treated it as the latest truth. The package travelled through time without help from the research department.
This error does not require two identical messages. Two different events reached the system in reverse order: first the notification of readiness, then the earlier start. Protection against executing the same operation twice does not decide what to do with a separate, late state change.
Consider a fictional workflow at Rys Studio. A customer requests a set of display elements, an automation uses AI to prepare descriptions, a person checks them and a system assembles a package for collection. Different stages report progress through events, or messages about a change that has occurred. Acceptance needs to check which events may change the current status and what happens if some history arrives late or never arrives.
Establish the order of changes, not just delivery time
In the Rys example, “package preparation started” is created before “package ready”. That describes the order in the source process. The receiver may nevertheless get them in a different order. Receipt time says when the system saw a message, not when the change described in it occurred.
Azure Event Grid delivery documentation (in English) notes that the service does not guarantee delivery order. A receiver may get events in a different order from the source changes. This is a property of that particular mechanism to account for in handling; do not attribute identical behaviour to every service on that basis.
Shopify's webhook guidance (in English) likewise says ordering is not guaranteed within a topic or across topics for the same resource. It recommends organising webhooks with the timestamps it provides. A webhook is a notification sent to an application after an event; receiving it does not by itself establish that it represents the resource's latest state.
The studio should agree with the implementer what identifies a newer change in its particular mechanism. It might be a record version, a sequence number or a properly interpreted timestamp. Not every integration supplies all of these. The acceptance report should name the basis used, its scope and cases it cannot resolve.
Compare version numbers within the correct case and source. Version twelve of package P-17 cannot be compared with version two of P-18 to establish their work order; these are separate change sequences. If several systems assign their own labels, establish the relationship between them. A coincidentally larger number should not decide a conflict.
An event identifier answers a different question: which message is this? Two different changes to the same package can have different identifiers and still arrive in reverse order. That is why duplicate and retry checks complement an ordering test but do not replace it. The test set should cover both situations separately. For related guidance, see the article on duplicate and retry checks (in Polish).
Do not select the “latest” item by sorting displayed dates without establishing their meaning. A task's creation, a record update, event dispatch and receipt by the automation can describe different moments. Multiple sources add differences in how time is assigned. When the data is insufficient for a safe decision, the process needs an explicit way to establish the state.
Also prepare two messages with the same visible date but a different documented sequence of changes. Check whether the integration has an additional basis for deciding or honestly reports that it cannot distinguish them. Adding a fraction of a second at the receiver does not repair information the source never supplied. A user should recognise a case requiring confirmation rather than see an apparently precise result.
Three runs of the same package
Prepare an artificial package P-17 and describe its permitted stages for acceptance. At Rys they are: accepted for preparation, under review, ready for collection. “Ready” should mean the specified file passed the agreed check and can be shared with the recipient. It cannot follow solely from a fluent assistant comment.
The first run delivers events in their ordinary order. It confirms that the basic process works at all. Record the state after each message and additional actions such as creating a file or notification. If this test already produces the wrong state, it cannot establish whether late delivery is handled correctly.
The second run changes delivery order for two different events. The readiness message arrives before the earlier start message. Agree on the expected result before the test: the package does not return to preparation merely because an old message arrived later. The history should nevertheless show that the old message arrived and how it was handled.
For example, an event for version three confirms readiness, then a start message for version two arrives. The test expectation is to keep version three ready and record the old message without rolling the state back. This is a sample of the Rys workflow, not a description of Azure or Shopify numbering. The implementer should reproduce it using fields available in the actual integration.
The third run concerns a newer, real change. After the package is shared, the reviewer finds an error and starts a correction. Returning to work is then justified if the process defines it that way. A rule to “never move a status backwards” would be as misleading as accepting whichever message was delivered last. The system must distinguish a late description of old work from a current decision to correct material.

Check the package identity in each run too. P-17 in its first version and P-17 after correction need not be the same file. Readiness for an old version should not approve new material. A similar boundary appears in binding an AI batch result to a record: the result must reach the correct input and version. The article on binding an AI batch result to a record (in Polish) offers related guidance.
Separate the status of an individual action from the status of the entire case. AI may finish a description while a person is still checking drawings. A “description completed” event should not automatically close the job if acceptance conditions remain. The stages should identify which signals only report part of the work and which authorise a move onward.
After changing the order, check not only the final label but also actions taken along the way. The system may briefly move the package backwards, send an incorrect notification and later restore the right status. The final screen then looks correct although the recipient received conflicting information. The test expectation should define permitted notifications and created artefacts for each run.
Do not invent missing history
A fourth test omits one event. The automation receives a readiness message but never saw the earlier start. The team decides whether it can verify current state in the source system or must send the case for investigation. It should not invent that the missing stage certainly completed correctly.
Separately, deliver a message about an unknown package. Decide whether it permits creating a case or requires checking its existence at the source. This depends on the event's meaning and the agreed process. Automatically creating an empty job after any “ready” signal can hide a wrong identifier and create work nobody actually ordered.
Determine where the authoritative case state resides. If it is the source system, reading its current data may help reconcile the discrepancy. That operation needs its own error handling: the source may be unavailable or return incomplete information. In that case “awaiting confirmation” should be distinguishable from “ready for collection”.
It is not enough to keep the message somewhere in a technical log. The person responsible for the case should know that the automation could not resolve the state, who must clarify it and what is allowed in the meantime. For AI logs without excess data, useful elements include identifiers linking the trail to the package and the reason for the decision, not another complete copy of customer material. For another perspective, see the Polish Signal article “AI logs without excess data (in Polish)”.
The test should also show a return to normal work. Once missing information is recovered, the clarified package moves forward according to the agreed rule. It does not stay in an exception queue forever, but neither does it jump to the end merely because someone manually checked off a warning. Record what was confirmed and who made the decision.
For a manual retry, retain the event's original identifier and its relationship to the source change. A new delivery time should not turn old information into a new business decision. If an actual correction is needed, it should have its own basis and author. Test whether the operator can distinguish replaying a message from approving a new state.
A person can change the state while automation waits
Delay can also affect the result of an analysis already started. A Rys employee corrects a record before the automation receives completion of a task based on the old version. If the incoming result unconditionally overwrites the current data, delivery order starts governing the business decision. The case requires checking the version on which the work was performed.
Acceptance benefits from checking concurrent record changes by AI and a person. Resolution might mean rejecting the old result, preparing a proposal again or showing the conflict to the employee. The choice depends on the specific process; silent overwriting should not be an accidental consequence of delay. For related guidance, see the article on checking concurrent record changes by AI and a person (in Polish).
Similar principles apply to handoff between agents. The second worker needs the case identifier, material version and the state relevant to its step. A summary that merely says “package in preparation” may already be outdated when work begins. The receiving party should be able to recognise that boundary. The article on handoff between agents (in Polish) offers related guidance.
At Rys, the process owner defines status meanings, the integration implementer describes available ordering information, and the person accepting the work tests samples against agreed results. If these roles regard different events as decisive, clarify the rule first. An extra instruction to a model does not replace a shared decision about who may reopen a ready package.
Add cancellation to the agreement. A later completion message for work started long ago should not itself restore a cancelled job. Decide whether the result is retained only as an execution trail or needs a separate decision. This tests the rule even when the highest version number does not mean permission to continue handling the case.
Give the team clear outcomes: message applied, skipped as old, recognised as a repeat or sent for investigation. Add the package identifier and basis for the decision to each outcome. A person handling an exception should not have to reconstruct the logic by comparing several screens without a common identifier.
The Aeneia Audit overview is a starting point for discussing such a sample and what the final status should mean. This can reveal a gap between a tool's action and responsibility for its result. The recipient should get the right package version, and the employee should see why the system considered it ready.






