Pipedrive New Deal Document Generation
When a Pipedrive deal reaches the Proposal stage, the flow merges the deal and product data into a branded quote/proposal document, files it to SharePoint, attaches it to the deal, and emails it to the contact. Removes manual quote creation and keeps proposals consistent.
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 auto-generates a branded quote/proposal document from Pipedrive deal and product data, with no manual document assembly. On a schedule it finds deals that have reached the Proposal stage, merges the deal header fields and product line items into a branded HTML proposal, archives it to SharePoint, attaches it to the Pipedrive deal, and emails it to the deal contact. A Dataverse ledger guarantees each deal is processed only once.
Why it matters: Manual quote creation is slow and inconsistent. Generating proposals from CRM data on stage change keeps them accurate, on-brand, and fast.
Build note: the proposal is composed as branded HTML inside the flow (the Adobe PDF Services DocGen template-file input is not accepted by the API-first authoring path), keeping the flow connector-first (Pipedrive, SharePoint, Outlook, Dataverse) with no premium document dependency and Flow Checker 0 errors / 0 warnings. Swapping in a PDF rendering connector later only requires changing the Compose_Proposal_Html render step; everything around it is unchanged.
Use Case
A sales team wants a branded proposal produced automatically the moment a deal reaches the Proposal stage, stored for the record, attached to the deal, and sent to the customer - without anyone re-keying CRM data into a template.
Flow Architecture
Recurrence
Recurrence (hourly)Polls Pipedrive on a schedule
Initialize variables
Initialize Variable x7Binds env vars and mints a guid() correlation id
List Deals
Pipedrive ListDealsReads all deals
Filter Proposal Deals
Filter ArrayKeeps open deals where stage_id equals the Proposal stage
Apply to each Deal
Foreach (concurrency 1)Processes each matching deal
Check Existing (idempotency)
Dataverse ListRecords + IfProceeds only when no ledger row exists for the deal
Get Deal + Products
Pipedrive GetDeal + HTTP GET (Pipedrive REST)Full deal header and the line-item products
Compose Proposal Html
Select + ComposeMaps products to pricing rows and merges deal fields into the branded HTML proposal
Archive To SharePoint
SharePoint CreateFileStores the proposal in the proposals library
Attach To Deal
HTTP POST Pipedrive /filesAttaches the proposal to the deal (multipart; no connector op)
Email Contact
Outlook SendEmailV2Emails the proposal (rendered in body and attached)
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_ProposalStageId | String | 3 | Pipedrive stage id that triggers generation |
| flowlibs_ProposalLibraryUrl | String | /Shared Documents/Proposals | Server-relative SharePoint folder for archived proposals |
| flowlibs_ProposalRecipientFallback | String | sales@flowlibs.local | Fallback email when the deal contact has none |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site hosting the library |
| flowlibs_PipedriveApiBaseUrl | String | https://api.pipedrive.com/v1 | Pipedrive REST base for products + file attach |
| flowlibs_PipedriveApiToken | String | (set per tenant) | Pipedrive API token (query-param auth) |
| flowlibs_ProposalTemplatePath | String | (reserved) | Reserved - server-relative path to a branded template for a future template-based render |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Pipedrive | shared_pipedrive | ListDeals GetDeal |
| SharePoint | shared_sharepointonline | CreateFile |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords |
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.
- Branding
- Edit the markup in Compose_Proposal_Html (colors, logo, layout). The accent color is #5b2a86.
- PDF output
- Replace the archive/attach/email payload with a render step (e.g. a PDF connector) fed by Compose_Proposal_Html; the surrounding wiring is unchanged. flowlibs_ProposalTemplatePath is reserved for a template-based render.
- Trigger cadence
- Change the Recurrence interval, or pair with a Pipedrive webhook for near-real-time generation.
- e-sign / approval
- Route the proposal through DocuSign for signature, or gate generation behind a discount approval.
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.01Proposal file name
Deal-titled proposal file name
EXPR.02Proposal-stage filter
Open deals at the Proposal stage
EXPR.03Idempotency gate
True when no ledger row exists
EXPR.04Pricing rows (Select map, object form)
Object form unwrapped via nested replace()
EXPR.05Contact email (with fallback)
Deal contact email or the fallback
EXPR.06Deal products (HTTP, no connector op)
Pipedrive REST deal products URL
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.