Pipedrive Deal Stage Automation
When a Pipedrive deal moves stage or is won/lost, the flow updates a Dataverse pipeline mirror, notifies the account team in Teams, and on a won deal triggers a handoff (creates an onboarding task and emails the delivery team). Stuck deals with no activity past a threshold are flagged to the sales manager.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow keeps a Pipedrive sales pipeline mirrored and acted upon inside Microsoft 365. On a schedule it reads every deal, mirrors each one into a Dataverse pipeline-mirror table, posts a Teams notice whenever a deal moves to a new stage, hands off won deals (creates a Pipedrive onboarding activity and emails the delivery team), and flags stuck open deals (no activity past a configurable threshold) to the sales manager by email.
Why it matters: Deals stall in silence and won deals lose momentum at handoff. The Dataverse mirror gives a governed, queryable record of pipeline state and — by comparing the stored stage to the live stage — lets the flow detect real stage moves without any change trigger.
Status: Off (demo). Going live requires only authorizing the connections and setting the three env var values.
Use Case
A sales team on Pipedrive wants (1) stage changes surfaced to the account team in Teams, (2) a clean automatic handoff to delivery when a deal is won, and (3) manager visibility on stagnant deals — all without manual data entry, and with a Dataverse copy of the pipeline for reporting.
Flow Architecture
Recurrence Every Hour
Recurrence (Hourly)Polls Pipedrive and detects stage moves by diffing the live stage against the Dataverse mirror (the connector exposes no usable change trigger).
Initialize configuration
Initialize Variable x7Correlation id, stuck threshold days (default 14), sales manager email, delivery team email, pipeline id (env var), Teams group/channel ids (env vars).
Load stages and deals
Pipedrive ListStages + ListDealsBuilds the stage id → name map and retrieves all deals (open/won/lost).
Per-deal mirror sync
Apply to each Deal (concurrency 1)Looks up the mirror row by deal id; if it exists, updates it and posts a Teams stage-move notice only when the stored stage differs from the live stage; if not, creates a mirror row and announces the new deal.
Won-deal handoff
Condition (status = won) → Pipedrive AddActivity + Outlook SendEmailV2On a won deal, creates a Pipedrive onboarding activity and emails the delivery team.
Stuck-deal escalation
Condition (open + inactive past threshold) → Outlook SendEmailV2Emails the sales manager (High importance) when an open deal has no activity past the configurable threshold.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_PipedrivePipelineId | String | 1 | Pipedrive pipeline id whose stages drive automation (used as @int(...) in ListStages). |
| flowlibs_TeamsGroupId | String | REPLACE_WITH_TEAMS_GROUP_ID | Teams team (group) id for account-team notifications. |
| flowlibs_TeamsChannelId | String | REPLACE_WITH_TEAMS_CHANNEL_ID | Teams channel id for account-team notifications. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Pipedrive | shared_pipedrive | ListStages ListDeals AddActivity |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord UpdateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
| Office 365 Outlook |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Sync cadence
- Change the Recurrence Every Hour interval to match your pipeline velocity.
- Stage-specific actions
- Extend Condition Stage Changed with a Switch on stage name (e.g. send a quote template when a deal reaches Proposal).
- Stuck threshold & recipients
- Edit varStuckThresholdDays, varSalesManagerEmail, varDeliveryTeamEmail.
- Lost-deal handling
- Add a Condition Deal Lost branch to capture lost reasons into the mirror table for win/loss reporting.
- Forecast roll-up
- Aggregate open-deal value from the mirror table for a weekly Teams forecast post.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Won gate
True when the deal status is won.
EXPR.02Stage-move detection
Detects a genuine stage change against the mirror.
EXPR.03Stuck-deal gate
True when an open deal is inactive past the threshold.
EXPR.04Owner name
Pipedrive user_id is an object; resolve the owner name.
EXPR.05Mirror match filter
OData filter to find the mirror row by deal id.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.