Overview
The Duration Between Two Activities enrichment calculates the time elapsed between two selected activities within a case and adds this duration as a new case attribute. You can specify whether to use the first or last occurrence of each activity, making this enrichment flexible for analyzing different process patterns. This is valuable for performance analysis, bottleneck identification, and SLA monitoring.
Common Uses
- Invoice Processing: Calculate cycle time from "Enter Invoice" to "Pay Invoice" to measure payment processing speed
- Order Fulfillment: Measure duration from "Order Placed" to "Shipment Sent" for delivery performance
- Approval Workflows: Track time between "Request Submitted" and "Approval Granted" to identify approval delays
- Support Tickets: Monitor resolution time from "Ticket Created" to "Ticket Closed" for customer service metrics
Settings
Start by going to the 'Log Enrichment' engine by going to any analysis and clicking 'Log Enrichment' in the top right.

Then click 'Add New'

Then choose the enrichment block.
Configuration Options
New Attribute Name: Specify the name of the new duration attribute that will be created in your dataset
First Activity: Select the activity that marks the start point for duration calculation
First Activity First or Last: Choose whether to use the 'First' or 'Last' occurrence of this activity in the case
Second Activity: Select the activity that marks the end point for duration calculation
Second Activity First or Last: Choose whether to use the 'First' or 'Last' occurrence of this activity in the case
Choosing First vs. Last Occurrence:
- Use First occurrence when you want to measure from the initial instance of an activity
- Use Last occurrence when you want to measure to/from the final instance of an activity
- Example: For "First occurrence of Order Created" to "Last occurrence of Payment Received" measures total order-to-payment cycle including any retries
Examples
To calculate the duration between enter invoice and post invoice, use the following settings:

In this example:
- New Attribute Name: "Invoice_Processing_Time"
- First Activity: "Enter Invoice" (using First occurrence)
- Second Activity: "Post Invoice" (using First occurrence)
Click 'Create' and once you're ready click 'Calculate Enrichment' to add the new attribute to your data set.

The new duration attribute is now available in your dataset for analysis, filtering, and visualization.
Output
When this enrichment is executed, it creates a new case attribute with the name you specified in "New Attribute Name". The attribute contains:
- Data Type: Numeric (decimal)
- Units: Duration in hours
- Value: The time elapsed between the two specified activities
- Null Values: If either activity doesn't exist in a case, or if they occur in the wrong order, the value will be null
Example Output Values:
24.5= 24.5 hours between the two activities168.0= 7 days (168 hours) between activitiesnull= One or both activities not found in the case
You can use this new attribute in:
- Performance dashboards to visualize cycle times
- Case filters to identify slow-moving cases
- Statistical analysis to calculate average durations
- Variant analysis to compare different process paths
See Also
Related Duration Enrichments:
- Duration Between an Attribute and an Activity - Calculate duration from a case attribute to an activity
- Calculated Attributes - Create custom calculations using attributes
Related Topics:
- Attribute Enrichments - Understanding enrichments in general
- Data Rules - Validating and transforming data
This documentation is part of the mindzie Studio process mining platform.