7. Follow Different Paths Based on the Time Between Two Events

Duration Difference Branch compares the time between two selected events and uses that duration to choose which path a sequence (a series of actions) follows.

3 min readProduct documentationzinzu user guide

Use it when you expect different follow-up actions depending on how quickly or slowly an earlier part of a process happened.

Build the Query

  1. Drag the required events onto the canvas and connect them in order.
  2. Add Duration Difference Branch after both events you want to compare.
  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. Connect all three outputs—GT, EQ, and LT—to their required paths.
  6. Continue each path with additional events or connect it to End.

The control uses one shared threshold for all three outputs.

Illustrative query: branch on the time between the two selected events.

Example: Support Assignment and Follow-Up

Start → Ticket Opened → Agent Assigned → Duration Difference Branch

Select Ticket Opened first and Agent Assigned second. Set the threshold to 900,000 ms (15 minutes).

OutputTime between the selected eventsNext required event
LTLess than 15 minutesAgent Responded → End
EQExactly 15 minutesAssignment Reminder Sent → End
GTMore than 15 minutesTicket Escalated → End

These follow-up events must represent records in your data. zinzu does not generate reminders or escalations.

Query example: Choose a path using the time between two selected events.

How It Works

zinzu calculates:

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

It uses this difference to select an output, then checks the current incoming record against the event connected to that output.

For the example above:

  • Agent assigned after 10 minutes: LT is selected. The next record must match Agent Responded.
  • Agent assigned after exactly 15 minutes: EQ is selected. The next record must match Assignment Reminder Sent.
  • Agent assigned after 20 minutes: GT is selected. The next record must match Ticket Escalated.

The selected time difference determines the path—not the timestamp of the follow-up action.

For example, if assignment took 10 minutes, LT is selected even if Agent Responded occurred much later. To constrain that later delay, you would need a condition that measures it.

Selecting an output does not complete the sequence. The required events on that path must also match.

When to Use It

Analyze support assignment delays Find different follow-up actions after a fast or delayed assignment.

Analyze payment retry handling Look for different recovery actions depending on the time between Payment Failed and Retry Started.

Analyze order fulfillment Find different follow-up actions depending on the time between Payment Confirmed and Order Shipped.

Important Notes

  • Both selected events must have matched earlier in the same sequence.
  • They do not have to be adjacent. Use Any between named events when you want to capture intervening activity.
  • Select the earlier event first and the later event second.
  • All three outputs must be connected.
  • The threshold is shared by all three outputs.
  • This measures the gap between the selected events, which may be only part of the sequence.
  • Duration uses timestamps in your data, not query execution time. 1 second = 1,000 milliseconds.

Next: Submit the query and view results.

Continue reading8. Negation
Search documentation · Esc to close
Open original image ↗