5. Follow Different Paths Based on Sequence Duration

Duration Length Branch lets a sequence (a series of actions) follow different paths based on the time elapsed since its first matched record.

3 min readProduct documentationzinzu user guide

Use it to find different actions depending on how quickly or slowly a process progresses.

Build the Query

  1. Drag the required events onto the canvas and connect them in order.
  2. Add Duration Length Branch from System Defined Events after a named event.
  3. Enter the duration threshold in milliseconds on the control.
  4. Connect all three outputs—GT, EQ, and LT—to their required paths.
  5. Continue each path with additional events or connect it to End.

The control uses one shared duration threshold for all three outputs:

OutputMeaning
LTElapsed time is less than the threshold.
EQElapsed time is exactly equal to the threshold.
GTElapsed time is greater than the threshold.

Example: Response and Timeout Handling

Start → Request Received → Processing Started → Duration Length Branch

Set the threshold to 2,500 ms (2.5 seconds).

OutputDuration conditionNext required event
LT< 2,500 msResponse Sent → End
EQ= 2,500 msDeadline Reached → End
GT> 2,500 msTimeout Recorded → End

These events must represent records in your data. zinzu does not generate deadline or timeout events.

Illustrative query: all three outputs share one duration threshold.

How It Works

When the next record arrives for the same EventOwner, zinzu:

  1. Measures the time from the sequence’s first matched record to the incoming record.
  2. Selects the output whose duration condition matches.
  3. Checks the same incoming record against the event connected to that output.

Suppose Request Received occurred at 10:00:00:

  • Response Sent at 10:00:02: The elapsed time is 2 seconds. LT is selected, and Response Sent matches.
  • Deadline Reached at 10:00:02.500: The elapsed time is exactly 2.5 seconds. EQ is selected, and Deadline Reached matches.
  • Timeout Recorded at 10:00:03: The elapsed time is 3 seconds. GT is selected, and Timeout Recorded matches.
  • Response Sent at 10:00:03: GT is selected, but that path requires Timeout Recorded. The sequence cannot continue through that path.

Both the duration condition and the connected event must match. Selecting an output alone does not complete the sequence.

When to Use It

Analyze service response handling Find different response, deadline, or timeout actions based on elapsed time since a request arrived.

Analyze payment recovery Find different follow-up actions depending on how much time has passed since the initial payment failure.

Analyze support handling Find resolution or escalation paths based on elapsed time since a ticket was opened.

Important Notes

  • Duration starts at the first matched record of the sequence, not the event immediately before the control.
  • All three outputs must be connected, even if your analysis primarily concerns one outcome.
  • A query supports one general timing control—Duration Length Branch, Duration Difference, or Duration Difference Branch—plus one optional terminal Duration Length. Timing controls cannot connect directly to each other.
  • The threshold is shared by all three outputs.
  • The control evaluates an incoming record. It does not wait for a timer to expire.
  • A completed match must satisfy the remaining events on the selected path.
  • Duration uses timestamps in your data, not query execution time. 1 second = 1,000 milliseconds.

Next: Submit the query and view results.

Continue reading6. Time between events
Search documentation · Esc to close
Open original image ↗