Skip to content

AI uses for records

Event log cancelled action dataset: a schema for agent recovery

By SourceX Editorial · Updated

10 sections

Short answer

Preserve a cancelled action as its own event, linked to the action it cancels, instead of deleting the case or keeping only its final state. Record who cancelled, when, from which state, which downstream effects had already happened, and what compensating steps followed and whether they succeeded. Recovery training needs that whole chain; a log filtered to completed cases teaches an agent that nothing is ever undone.

Record timeline

Event log cancelled action

This page covers event log cancelled action dataset: a schema for agent recovery.Illustrative

Key takeaways

  • A cancellation is its own event and must link to the action it cancelled.
  • Recovery is judged by downstream effects and the compensations that followed, not by the cancel event alone.
  • Standard cleaning steps such as completed-case filters and latest-state snapshots silently delete recovery cases.
  • Separate withdrawn, aborted, cancelled, compensated, superseded and retried before labeling.
  • Validate every release: target links, effect coverage, compensation timing and reconciliation to source totals.

How do you preserve cancelled actions in agent recovery training data?

Keep three things that most exports throw away: the cancellation event itself, a link to the action it cancelled, and a record of every downstream effect that had already happened when the cancellation arrived. Then add the compensating steps that followed, with their own outcomes. That chain is the recovery case.

An agent learning to recover needs to see the moment a plan stopped making sense and what a competent person did next. A booking that was cancelled after a confirmation email went out, a payment authorization released after a shipping label was printed, a ticket reopened after a refund was issued: each shows a decision under partial completion, which is exactly what happy-path logs lack.

Process mining standards already make room for this. The IEEE XES lifecycle extension's standard transactional model includes withdraw, an activity-level abort (ate_abort) and a case-level abort (pi_abort) alongside start and complete, so a log can say that an activity was abandoned rather than simply never finished. OCEL 2.0 adds the ability to link one event to several objects with a qualifier describing each object's role, which is how a single cancellation can touch an order, a payment and a shipment at once.

Cancelled, aborted, withdrawn, compensated: which word means what in the log?

Source systems use these words loosely, so the dataset should map each source signal to one defined meaning before anything is labeled. The table shows the distinctions worth keeping and where they typically come from.

Cancelled, aborted, withdrawn, compensated: which word means what in the log?
Term in the datasetWhat happenedExample source signalProcess mining mapping
withdrawnWork was assigned or offered, then taken back before it startedTask unassigned or offer retracted in a workflow toolXES withdraw transition
aborted_activityOne activity stopped partway; the case continuedStep marked abandoned, job cancelled mid-runXES ate_abort
aborted_caseThe whole case stoppedOrder cancelled, ticket closed as will not doXES pi_abort
cancelled_requestA request was cancelled before the action took effectStripe PaymentIntent moved to canceled before captureCancellation event qualified to the payment object in OCEL
compensatedAn effect that had happened was offset by a new actionRefund, credit note, return label, booking releaseSeparate event linked to the original with a compensates qualifier
supersededA new action replaced the old one without undoing itOrder edited, appointment rescheduledNew event linked to the prior one; no abort
retriedThe same action was attempted again after a failureDuplicate submission with a new attempt idNot a cancellation; classified as a retry

Which cleaning steps delete the most useful recovery cases?

Standard preparation steps quietly remove cancellations. Filtering to cases that reached a completed end state, keeping only the latest record per entity, collapsing status histories into a final status column and deduplicating near-identical events each strip out part of the chain.

The loss is not random. Cases with cancellations are the ones with more events, more systems and messier timing, so they fail joins and validation checks more often and get dropped as noise. A training set built that way overstates how often plans run straight through, and an agent trained on it has no examples of noticing that a step already took effect before deciding how to back out.

The fix is procedural rather than clever. Export full status histories, such as the issue changelog that the Jira Cloud REST API returns as a paginated list of every change in date order, instead of current-state tables, and make every filter that removes a case log what it removed and why.

What should the cancelled action and downstream effect schema include?

The schema has two linked record types: one row per cancellation, and one row per downstream effect that the cancellation had to deal with. The table lists the cancellation record's fields. Each field exists to answer a question an agent or reviewer will ask about the case.

At a glance

What should the cancelled action and downstream effect schema include

  • Downstream effect record fields: effect_id, effect_type (for example notification sent, funds held, stock reserved, label printed), occurred_at, reversibility (reversible, compensable, irreversible), compensation_event_id if any, compensation_status and evidence_ref pointing to the source record.
  • Version the schema and write the version into every file, so a later change to the state list does not silently relabel old cases.
What should the cancelled action and downstream effect schema include?
FieldType and ruleQuestion it answers
cancel_event_idUnique id; never reusedWhich event is the cancellation?
case_id and object_refsCase id plus qualified links to each affected object (order, payment, shipment)What did the cancellation touch?
target_action_idRequired; must reference an existing event earlier in timeWhich action was cancelled?
cancel_kindOne of withdrawn, aborted_activity, aborted_case, cancelled_requestWhat sort of stop was it?
state_at_cancelThe target object's state immediately before the cancellationHow far had the action progressed?
actor_role and initiatorRole of who cancelled (customer, agent, system rule, supplier), never a nameWho decided to stop?
reason_code and reason_textSource code kept verbatim plus a mapped category; free text redactedWhy was it stopped?
ts_source and ts_normalizedOriginal timestamp, source clock id and UTC valueWhen, and can the order of events be trusted?
effect_idsList of downstream effect records; may be empty only if state_at_cancel shows nothing took effectWhat had already happened?
recovery_outcomeOne of fully_compensated, partially_compensated, not_compensable, compensation_failed, none_neededDid the recovery work?

Which downstream effects decide whether recovery succeeded?

Recovery is judged by the effects, not by the cancellation. Microsoft's Compensating Transaction pattern makes the point directly: undoing completed steps is often more complex than restoring the original state, can require business-specific rules, and must account for concurrent changes rather than overwrite them.

The same guidance notes that compensation does not have to run in exact reverse order, that some undo steps can run in parallel, and that compensating transactions can themselves fail, which is why the effect record carries its own compensation status. Its Saga pattern adds a useful boundary: a pivot transaction is the point of no return, after which remaining steps must be completed rather than undone. Mark effects that sit past such a point as irreversible, so the dataset does not imply that an agent could have reversed them.

Payment systems show why the distinction matters in practice. Stripe documents that cancelling a PaymentIntent cannot be undone and releases held funds, and that cancellation is allowed only before the payment reaches states such as processing or succeeded; once a payment has succeeded, offsetting it is a separate step, such as a refund, with its own record. A dataset that labels both cases as cancelled payment erases the decision the agent most needs to learn.

Can skewed clocks, unmatched IDs or missing status changes flip a recovery label?

Yes, and each failure can turn a correct recovery into an apparent mistake or the reverse. Before labeling, test the case against the three ways reconstruction goes wrong.

At a glance

Can skewed clocks, unmatched IDs or missing status changes flip a recovery label

  • Clock drift: when the cancellation and the effect come from different systems, a few seconds of skew can put the cancellation before an effect that actually preceded it. Keep each source's clock id, normalize to UTC, and flag any ordering that depends on a gap smaller than the known skew.
  • Identifier mismatch: the payment system's id, the order id and the warehouse reference must resolve to the same case through a mapping table, not string matching on customer names. Unmatched effects are reported as orphans with counts.
  • Unrecorded transitions: some systems record only the latest status. If an object jumps from reserved to cancelled with no record of the shipped state between them, mark state_at_cancel as unknown rather than guessing from the end state.
  • Reconciliation to source totals: the count of cancellations per type and period in the dataset should match the count in the source system's own report; differences are explained in the release notes.

What does a valid record look like for an illustrative order cancelled after payment and label?

The case below is invented for this guide and uses illustrative counts and times; it is not customer data. A customer cancels an order eleven minutes after checkout. By then the payment was authorized but not captured, a confirmation email went out, and the warehouse had printed a shipping label.

What does a valid record look like for an illustrative order cancelled after payment and label?
SeqEventObject and qualifierSchema result
1Order placedorder (subject)Target action for the cancellation
2Payment authorized, not capturedpayment (funds held)Effect, compensable
3Confirmation email sentnotification (customer)Effect, irreversible
4Shipping label printedshipment (label)Effect, compensable by voiding label
5Customer cancels orderorder (cancelled), payment, shipmentcancel_kind aborted_case; state_at_cancel awaiting pick
6Authorization cancelled, funds releasedpayment (compensates 2)compensation_status succeeded
7Label void requested, carrier rejects as already scannedshipment (compensates 4)compensation_status failed
8Return label issued when parcel arrivesshipment (follow-up)recovery_outcome partially_compensated

How does a cleaning pass break the same case, and what catches it?

Here is the same case after a typical cleaning pass. Events 2, 6 and 7 are gone because the payment table was joined on captured payments only; event 5 survives as a final status of cancelled on the order row. The record now claims a clean cancellation with no effects, which is false.

A validator should catch this automatically. The checks below are written to run on every release of the dataset, and each failure names the case and the rule.

  • Every cancellation has a target_action_id that resolves to an earlier event in the same case.
  • effect_ids is empty only when state_at_cancel shows nothing had taken effect; otherwise the record fails.
  • Every effect marked compensable has either a compensation event or an explicit not attempted status.
  • recovery_outcome agrees with the effect statuses: any failed compensation rules out fully_compensated.
  • No compensation event precedes the effect it compensates after clock normalization.
  • Per-period counts of cancellations by kind reconcile to source totals within a stated tolerance.

How should cancellation cases be sampled and split for training and evaluation?

Sample by cancellation kind and by how far the target action had progressed, not by raw frequency. When early cancellations, made before anything took effect, dominate a log, a frequency sample contains few late ones, yet the late cases with several effects and at least one failed compensation are the ones that test recovery.

Split by case, never by event, so that a cancellation and its compensations always land in the same partition. Keep a held-out evaluation set where the agent sees only the events up to the cancellation and must propose the recovery steps, and score it against what the effect records say actually worked. Record the sampling weights in the dataset card so a buyer can undo them when estimating real-world rates.

  • Strata worth keeping separate: nothing took effect, only reversible effects, at least one compensable effect, at least one irreversible effect, and any failed compensation.
  • Exclude from training labels, but keep for reporting, any case with state_at_cancel unknown or an orphaned effect.
  • Hold out whole time periods as well as random cases, because cancellation policies and reason codes change over time.

What must be redacted before cancellation histories leave the company?

Cancellation records carry more personal and commercial detail than most logs: free-text reasons, customer complaints, supplier disputes and payment metadata. Redact free text, replace people with roles and keep payment identifiers as mapped tokens rather than real values.

Being able to export these logs is not the same as having privacy permission to share them, owning them, or holding contractual rights to license them; platform terms and customer contracts can restrict each separately, and de-identification on its own does not create a right to license. Companies that license order, payment and fulfillment histories through SourceX get the rights review, contract and preparation handled for them, and the de-identification of those logs is performed by SourceX through approved processing routes. A brief assessment of the company, not of its logs, tells it whether it qualifies, so no event history leaves its systems at that stage.

Frequently asked questions

Should cancelled cases be removed from an event log before training?

No, not for recovery training. Cancelled cases show how work is stopped and undone after it has partly taken effect, which is the behavior a recovery agent must learn. Remove them only for an analysis that is explicitly about completed cases, and log the removal.

What is the difference between a cancellation and a compensation?

A cancellation stops an action or case. A compensation is a new action that offsets an effect that already happened, such as a refund or a released reservation. One cancellation can need several compensations, and each can succeed or fail on its own.

How does XES represent a cancelled activity?

The XES lifecycle extension's standard transactional model includes withdraw for revoked assignments and two abort transitions: ate_abort for one activity and pi_abort for the whole process instance. Map source statuses to these before analysis so the meaning is consistent.

Is a retry the same as a cancelled action?

No. A retry repeats an action after a failure and usually aims at the same outcome, while a cancellation abandons it. Treat retries as their own class so they do not inflate cancellation counts or hide genuine recoveries.

What counts as an irreversible downstream effect?

An effect that cannot be meaningfully undone once it happens, such as a sent notification or a step past a saga's point of no return. Record it as irreversible so the dataset does not suggest an agent could have reversed it, and label any follow-up action as mitigation.

Sources

  • The XES 2.0 lifecycle extension's standard transactional model includes withdraw, ate_abort (activity) and pi_abort (process instance) alongside start and complete. Source
  • OCEL 2.0 relates each event to one or more objects through event-to-object relationships that can carry a qualifier describing the object's role. Source
  • Compensating transactions undo completed steps using business-specific logic, need not run in exact reverse order, can run some steps in parallel and can themselves fail. Source
  • In a saga, a pivot transaction is the point of no return after which compensable transactions are no longer relevant and remaining steps must complete. Source
  • Cancelling a Stripe PaymentIntent sets its status to canceled and accepts an optional cancellation_reason. Source
  • Stripe PaymentIntent cancellation cannot be undone, releases held funds and is allowed only before certain states such as processing or succeeded. Source
  • The Jira Cloud REST API Get changelogs operation returns a paginated list of all changelogs for an issue, sorted by date from the oldest. Source

See if your company qualifies

A short company assessment. No data uploads are needed.

See if your company qualifies