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.
Use it to find different actions depending on how quickly or slowly a process progresses.
Build the Query
- Drag the required events onto the canvas and connect them in order.
- Add Duration Length Branch from System Defined Events after a named event.
- Enter the duration threshold in milliseconds on the control.
- Connect all three outputs—GT, EQ, and LT—to their required paths.
- Continue each path with additional events or connect it to End.
The control uses one shared duration threshold for all three outputs:
| Output | Meaning |
|---|---|
| LT | Elapsed time is less than the threshold. |
| EQ | Elapsed time is exactly equal to the threshold. |
| GT | Elapsed 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).
| Output | Duration condition | Next required event |
|---|---|---|
| LT | < 2,500 ms | Response Sent → End |
| EQ | = 2,500 ms | Deadline Reached → End |
| GT | > 2,500 ms | Timeout Recorded → End |
These events must represent records in your data. zinzu does not generate deadline or timeout events.
How It Works
When the next record arrives for the same EventOwner, zinzu:
- Measures the time from the sequence’s first matched record to the incoming record.
- Selects the output whose duration condition matches.
- 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.

