Pipedrive Lead Inbox to Qualified Deal
When a lead lands in the Pipedrive Leads Inbox (web form, chat, import), the flow enriches it, scores it against qualification criteria, converts qualified leads to deals on the right pipeline/stage, assigns an owner, and notifies them in Teams; low-scoring leads are routed to nurture. Automates lead qualification and routing.
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 automates lead qualification and routing from the Pipedrive Leads Inbox. On a schedule it reads open leads, scores each new lead against configurable qualification criteria, converts qualified leads into deals on the right pipeline/stage, assigns an owner, logs every lead to a Dataverse ledger (idempotent — no duplicate deals on re-poll), and alerts the sales channel in Microsoft Teams. Low-scoring leads are routed to nurture (logged with a Nurture outcome).
Why it matters: Manual lead triage is slow and inconsistent. Automated scoring + conversion gets qualified leads to a rep fast and keeps the inbox clean, while a Dataverse ledger gives a governed, auditable record of every routing decision.
Status: Built as an Off demo. Going live requires only authorizing the three connections and setting the environment variable values — no logic changes.
Use Case
A sales/marketing team wants inbound Pipedrive leads (web form, chat, import) qualified, converted, assigned, and notified automatically — with nurture for the rest — without a rep watching the Leads Inbox.
Flow Architecture
Recurrence
Scheduled (hourly)Polls the Leads Inbox for new leads (the Pipedrive connector has no lead trigger and no Leads operation).
Initialize configuration
Initialize Variable x8Correlation id (guid), qualify threshold, value threshold, target pipeline/stage ids, owner user id, and Teams group/channel ids — sourced from env vars.
Read leads from inbox
HTTP GET /leadsReads open leads via Pipedrive REST with api_token query auth (connector has no Leads op).
Per-lead idempotent processing
Apply to each Lead (concurrency 1)Checks the Dataverse ledger by lead id; only unseen leads proceed. Computes a 0–100 score (value + organization + person).
Qualify and convert
Pipedrive AddDealV2 + HTTP PUT + Dataverse CreateRecord + Teams PostMessageToConversationIf the score meets the threshold, creates a deal on the pipeline/stage, sets the owner via HTTP PUT, logs a Qualified ledger row, and alerts the sales channel in Teams.
Nurture branch
Dataverse CreateRecordLow-scoring leads are logged with a Nurture outcome.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_PipedriveApiBaseUrl | String | https://api.pipedrive.com/v1 | Pipedrive REST base (HTTP leads/owner calls). |
| flowlibs_PipedriveApiToken | String | REPLACE_WITH_PIPEDRIVE_API_TOKEN | Pipedrive API token (query-param auth). |
| flowlibs_PipedrivePipelineId | String | 1 | Target pipeline for converted deals. |
| flowlibs_PipedriveQualifiedStageId | String | 1 | Target stage for converted deals. |
| flowlibs_LeadQualifyThreshold | String | 60 | Min score to convert (else nurture). |
| flowlibs_LeadValueThreshold | String | 5000 | Lead value for the high-value score component. |
| flowlibs_PipedriveDealOwnerUserId | String | REPLACE_WITH_PIPEDRIVE_USER_ID | Pipedrive user id assigned as deal owner. |
| flowlibs_TeamsGroupId | String | REPLACE_WITH_TEAMS_GROUP_ID | Teams team/group id. |
| flowlibs_TeamsChannelId | String | REPLACE_WITH_TEAMS_CHANNEL_ID | Teams channel id for alerts. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Pipedrive | shared_pipedrive | AddDealV2 |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
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.
- AI scoring
- Replace the Compose scoring with an Azure OpenAI call over the lead notes/source for a richer score.
- Territory / round-robin owner
- Drive Init Owner User Id from a lookup (region/product) or a rotating counter instead of a single env var.
- Nurture sync
- Extend the Nurture branch to push low-score leads into Mailchimp / a marketing audience instead of only logging them.
- SLA follow-up
- Add a downstream flow that alerts a manager if a converted deal isn't actioned within N hours (join on flowlibs_correlationid).
- Poll frequency
- Change the Recurrence interval to match lead volume.
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.01Qualification score
Computes the 0–100 lead score.
EXPR.02Idempotency filter
OData filter on the lead id ledger key.
EXPR.03New-lead gate
True only for unseen leads.
EXPR.04Qualify gate
Gate to convert vs nurture.
EXPR.05Owner assign body (form-encoded)
Form body for the HTTP owner-set PUT.
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.