---
title: Correlate Long-Running Transactions End to End with Nodinite
description: "How to follow one order through every system with Nodinite: a correlation id in ApplicationInterchangeId for each run, business keys such as the Order Id as Search Fields for long-running transactions like order and order response, grouped Log Views, and BPMs."
---

# :fa-link: 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][Log Views] and on a [BPM][BPMs]  

![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.13)][1]  
*Animated walkthrough: with one Group by on the correlation id, the [Log View][Log Views] shows one row per order run of the [Order-to-Cash demo][], each holding every event of that run.*  

## :fa-network-wired: Understanding Correlation {#understanding}

<div class="mermaid">
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<br/>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
</div>

*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][Search Fields].*

### :fa-puzzle-piece: The Three Ids

| Id | Where | Scope | Use it for |
| --- | --- | --- | --- |
| Correlation id | [`ApplicationInterchangeId`][JSON Log Event - 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][ApplicationInterchangeId] |
| Local id | [`LocalInterchangeId`][JSON Log Event - 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][Search Fields] | The business object for its whole life: order, invoice, shipment | Following an order across runs, days, and partners |

## :fa-clock: Long-Running and Durable Transactions {#long-running}

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][Search Fields] on that key for each [Message Type][Message Types]; it works on events already logged too, after a [re-index][Log the Payload and Context].  
4. Search on the business key, or [group the Log View on it][Log View Group by], to see every run of the order.  
5. Draw the business process as a [BPM][BPMs], 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][Search Fields] finds the order in every step; see its [correlation id format][O2C Log Event Structure] and [Follow One Order][O2C Follow One Order].

## :fa-list-check: Correlation Rules {#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][Log Runtime Diagram] shows what users get from it.

## :fa-hand-point-right: Next Steps

* :fa-flag: [Log Status and Errors][]  
* :fa-compass: [Plan Your Logging with Nodinite][Logging Strategy]  

## :fa-link-horizontal: Related Topics

* :fa-link: [How ApplicationInterchangeId enables end-to-end correlation][ApplicationInterchangeId]  
* :fa-list: [Log View Grouping Tab][Log View Group by]  
* :fa-diagram-project: [BPM Binding][]  
* :fa-magnifying-glass: [How do I extract business data like Order Numbers?][Extract Business Data]  
* :fa-route: [Order flow][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/LogViews/O2C_GroupedLogView_Setup.gif

[ApplicationInterchangeId]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Troubleshooting/ApplicationInterchangeId.md
[BPM Binding]:{ndr}/Core%20Services/Log%20Event/Features/BPM%20Binding.md
[BPMs]:{ndr}/Repository%20Model/BPMs/Overview.md
[Design grouped Log Views for Runtime Inspection]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Design%20grouped%20Log%20Views%20for%20Runtime%20Inspection.md
[Extract Business Data]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Troubleshooting/Extract%20Business%20Data.md
[JSON Log Event - ApplicationInterchangeId]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md#applicationinterchangeid
[JSON Log Event - LocalInterchangeId]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md#localinterchangeid
[Log Runtime Diagram]:{ndr}/Getting%20Started/2.%20Log/Inspect%20grouped%20Log%20Views%20as%20runtime%20diagrams.md
[Log Status and Errors]:{ndr}/Getting%20Started/2.%20Log/Logging%20Strategy/Log%20Status%20and%20Errors.md
[Log the Payload and Context]:{ndr}/Getting%20Started/2.%20Log/Logging%20Strategy/Log%20the%20Payload%20and%20Context.md
[Log View Group by]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Log%20View%20Grouping%20Tab.md#fa-layer-group-group-by-options
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Logging Strategy]:{ndr}/Getting%20Started/2.%20Log/Logging%20Strategy/Overview.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[O2C Follow One Order]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Follow-One-Order.md
[O2C Log Event Structure]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Log-Event-Structure.md#correlation-id-format
[Order flow]:{ndr}/Getting%20Started/Scenarios/Order%20flow/Overview.md
[Order-to-Cash demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[Search Fields]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md