- 3 minutes to read

Correlate Transactions End to End

An order passes a web shop, an integration platform, an ERP, a warehouse, and a carrier, and the order response comes back two days later. End-to-end logging means one search shows all of it. That only works when the events carry something in common, and that is a decision you make before you write the first line of logging code.

  • ✅ Group every event of one run with a correlation id
  • ✅ Tie together the messages of long-running transactions, days apart, with a business key such as the Order Id
  • ✅ Show the whole story in a grouped Log View and on a BPM

Group the Log View Contoso: Order-to-Cash on the Application interchange id, save and show it, then search one customer and open one order run, animated walkthrough (7.12)
Animated walkthrough: with one Group by on the correlation id, the Log View shows one row per order run of the Order-to-Cash demo, each holding every event of that run.

Understanding Correlation

flowchart TB subgraph Run1["Day 1: order run PIC-1001"] direction LR A["fa:fa-cart-shopping Order received"] --> B["fa:fa-gears Order entered in ERP"] --> C["fa:fa-truck Order to warehouse"] end subgraph Run2["Day 3: response run PIC-2077"] direction LR D["fa:fa-reply Order response"] --> E["fa:fa-file-invoice Invoice"] end Key["fa:fa-key Business key
Order Id ORD-10001"] Run1 --> Key Run2 --> Key style A fill:#2678BD style B fill:#2678BD style C fill:#2678BD style D fill:#E47528 style E fill:#E47528 style Key fill:#93d16d

Each run (blue, orange) shares one correlation id in ApplicationInterchangeId. The response run starts days later with an id of its own, so the two runs meet only on the business key (green), extracted from the body or context by a Search Field.

The Three Ids

Id Where Scope Use it for
Correlation id ApplicationInterchangeId One run of one transaction, across every system it passes Grouping the steps of one run; see How ApplicationInterchangeId enables end-to-end correlation
Local id LocalInterchangeId One step inside one system Telling apart the events of one system, such as a batch and its items
Business key Context or body, extracted by a Search Field The business object for its whole life: order, invoice, shipment Following an order across runs, days, and partners

Long-Running and Durable Transactions

Order and order response, request and acknowledgement, invoice and payment: these are separate runs, often started by another party who never saw your correlation id. Don't try to force one id through all of them. Instead:

  1. Give each run its own correlation id, generated where the run starts.
  2. Log the business key in every message that has it, in the context or the body.
  3. Ask your administrator for a Search Field on that key for each Message Type; it works on events already logged too, after a re-index.
  4. Search on the business key, or group the Log View on it, to see every run of the order.
  5. Draw the business process as a BPM, so business users see where each order is, whichever run it is in.

The Order-to-Cash demo does exactly this: each order run has its own ApplicationInterchangeId, and the O2C - Order ID Search Field finds the order in every step; see its correlation id format and Follow One Order.

Correlation Rules

  • ✅ Generate the correlation id at the entry point and pass it on in headers, message properties, or the message itself
  • ✅ Make it unique and readable, such as PIC-20251023-0915-0001, so support can read it out over the phone
  • ✅ Agree on the business keys and their names across teams and platforms
  • ❌ Don't let one correlation id cover a whole batch of unrelated orders; give each item its own, or use LocalInterchangeId
  • ❌ Don't rely on platform-internal ids alone; they stop at the platform boundary

Design grouped Log Views for Runtime Inspection explains which Group by fits which audience, and Inspect grouped Log Views as runtime diagrams shows what users get from it.

Next Steps