6. Check the Time Between Two Events

Duration Difference checks the time between two selected events within the same sequence (a series of actions).

3 min readProduct documentationzinzu user guide

Use it when you want to measure a particular part of a process, such as the time between a payment failure and a retry. The measurement does not have to start at the beginning of the sequence.

Build the Query

  1. Drag the required events onto the canvas and connect them in order.
  2. Add Duration Difference from System Defined Events after both events you want to measure.
  3. Click the control and select the two events: the earlier event first, then the later event.
  4. Enter the threshold in milliseconds and click Confirm Selection.
  5. Set the comparison on the outgoing connection and connect it to the next required event.
  6. Continue the sequence and connect it to End.
Example:
Start → Request Received → Payment Failed → Retry Started → Duration Difference ≤ 30,000 ms → Payment Succeeded → End

Select Payment Failed first and Retry Started second.

Illustrative query: the numbered events define the interval being measured.

How It Works

zinzu uses the timestamps of the two selected events that have already matched for the same EventOwner:

Duration Difference = Second selected event’s timestamp − First selected event’s timestamp

For the example above, the check measures Payment Failed → Retry Started. It does not include the time before Payment Failed or the time from Retry Started to Payment Succeeded.

With Duration Difference ≤ 30,000 ms (30 seconds):

  • Retry after 20 seconds: The condition passes.
  • Retry after exactly 30 seconds: The condition also passes.
  • Retry after 45 seconds: The condition fails, and the sequence cannot continue through the control.

When the condition passes, the next record is checked against Payment Succeeded. Passing the duration check alone does not complete the sequence—the remaining required events must also match.

When to Use It

Check payment retry speed Find sequences where Retry Started occurred within 30 seconds of Payment Failed, followed by Payment Succeeded.

Query example: Payment retry within 30 seconds followed by success.

Measure support assignment delays Find sequences where Agent Assigned occurred at least 15 minutes after Ticket Opened, followed by Agent Responded.

Query example: Agent assignment after at least 15 minutes followed by a response.

Check fulfillment speed Find sequences where Order Shipped occurred within 24 hours of Payment Confirmed, followed by Delivery Confirmed.

Query example: Shipment within 24 hours followed by delivery confirmation.

Important Notes

  • Both selected events must have matched before the control is reached.
  • The selected events do not have to be adjacent. Use Any between named events if you want to capture intervening activity.
  • Selection order matters: zinzu subtracts the first selected event’s timestamp from the second’s.
  • Duration uses timestamps in your data, not query execution time. 1 second = 1,000 milliseconds.

Next: Submit the query and view results.

Continue reading7. Time-gap branches
Search documentation · Esc to close
Open original image ↗