Step 1: Create Custom Fields
You need two types of fields for each stage:- Date & Time fields: Record when the opportunity entered each stage
- Number fields: Store how many days the opportunity spent in each stage
Create the “Last Entered” Fields
- Go to Settings → Data Model → Opportunities
- For each stage, click + Add Field and configure:
- Name: Last Entered [Stage Name] (e.g., “Last Entered New”, “Last Entered Qualified”)
- Type: Date & Time
- Description: Timestamp when opportunity entered this stage
- Click Save
- Last Entered New
- Last Entered Qualified
- Last Entered Meeting
- Last Entered Proposal
- Last Entered Negotiation
- Last Entered Closed Won
- Last Entered Closed Lost
Create the “Days in Stage” Fields
- For each stage, click + Add Field and configure:
- Name: Days in [Stage Name] (e.g., “Days in New”, “Days in Qualified”)
- Type: Number
- Description: Number of days spent in this stage
- Click Save
- Days in New
- Days in Qualified
- Days in Meeting
- Days in Proposal
- Days in Negotiation
You don’t need “Days in” fields for Closed Won and Closed Lost since those are final stages.
Optional: Make Fields Read-Only
If you don’t want users manually editing these calculated fields:- Go to Settings → Roles
- Select the role to configure
- Find the Opportunities object
- Set the “Last Entered” and “Days in” fields to read-only
Step 2: Create the Workflow
This single workflow handles both tasks:- Records the timestamp when entering a new stage
- Calculates days spent in the previous stage
Create the Workflow
- Go to Workflows
- Click + New Workflow
- Name it “Track Stage Time”
Configure the Trigger
- Add a Record Updated trigger
- Select Opportunities as the object
- Filter on: Stage field is updated
Add Branches for Each Stage
To create a new branch, right click on the workflow canvas and click New action. Then, link this action to the previous node by dragging the arrow from the previous node to this new action.
Branch 1: Stage = New (first stage) Since this is the first stage, we only record the entry timestamp—no previous stage to calculate.
- Add a Filter node: Stage = New
- Add a Code action:
- Add an Update Record action:
- Record: The triggering Opportunity
- Field: Last Entered New
- Value:
nowfrom Code node
Branch 2: Stage = Qualified When moving to Qualified, record entry time AND calculate days spent in New.
- Add a Filter node: Stage = Qualified
- Add a Code action:
- Configure the Code node input: map
lastEnteredPreviousStageto the Last Entered New field - Add an Update Record action:
- Record: The triggering Opportunity
- Fields to update:
- Last Entered Qualified =
now - Days in New =
daysInPreviousStage
- Last Entered Qualified =
Branch 3: Stage = Meeting When moving to Meeting, record entry time AND calculate days spent in Qualified.
- Add a Filter node: Stage = Meeting
- Add a Code action:
- Configure the Code node input: map
lastEnteredPreviousStageto the Last Entered Qualified field - Add an Update Record action:
- Record: The triggering Opportunity
- Fields to update:
- Last Entered Meeting =
now - Days in Qualified =
daysInPreviousStage
- Last Entered Meeting =
Continue for remaining stages:
| Stage | Records | Calculates |
|---|---|---|
| Proposal | Last Entered Proposal | Days in Meeting |
| Negotiation | Last Entered Negotiation | Days in Proposal |
| Closed Won | Last Entered Closed Won | Days in Negotiation |
| Closed Lost | Last Entered Closed Lost | Days in Negotiation |
Step 3: Analyze Time in Stage
With timestamps and day counts recorded, you can now analyze deal velocity.Create a “Slow Deals” View
- Create a Table view of Opportunities
- Add columns: Name, Stage, Days in [previous stage], Amount
- Sort by “Days in” field (descending)
- Filter by Stage to focus on one stage at a time
Use Aggregations
In your pipeline Kanban view:- Click the number next to a Stage name
- Select Average
- Choose a “Days in” field
Summary
| Component | Purpose |
|---|---|
| Last Entered fields | Store when opportunity entered each stage |
| Days in fields | Store how many days spent in each stage |
| Workflow | Records timestamp AND calculates days in one pass |
| Views & Aggregations | Analyze deal velocity and identify bottlenecks |
Related
- Workflows — automation basics
- How to Create Custom Fields — field configuration
- Kanban Views — aggregations