Pre-draft PandaDoc proposals when HubSpot deals advance

By General Input

When a HubSpot deal moves to Send Proposal or Negotiation, an agent picks the right PandaDoc template, fills it from the deal, and DMs the owner the draft.

Integrations

  • HubSpot
  • PandaDoc
  • Slack

Type

Agentic Task

Categories

  • Sales

Build me an agent workflow that pre-drafts a PandaDoc proposal the moment a HubSpot deal is ready for one, so the account executive just reviews and sends instead of building it from scratch.

Trigger: a HubSpot webhook on a deal property change, specifically when dealstage moves into a Send Proposal or Negotiation pipeline stage. The deal stages that should fire it need to be configurable, so let me list the stage IDs (or stage labels) when I set this up.

When the trigger fires, the agent should do the following:

1) Pull the deal context from HubSpot. Use Get Deal to fetch amount, associated line items / products, expected close date, deal owner, and the associated primary contact. Then use Get Contact for that primary contact's email and full name. If a key field like amount or close date is missing, keep going but capture the gap for the Slack note at the end.

2) Choose the right PandaDoc template. Use List Template Folders and List Templates (filter by tag and/or folder) to enumerate the templates that are eligible for this deal. Then reason over the deal context to pick one: match on deal size band (for example SMB vs Mid-Market vs Enterprise), product mix from the line items, and any other signal that distinguishes the templates. The selection logic needs to be soft and judgement-based, not a hard rules engine, which is why this is an agent workflow.

3) Create the draft in PandaDoc. Use Create Document from Template with the chosen template. Prefill the recipient using the primary contact's name and email. Prefill tokens with the HubSpot data: client_name (contact or company name), contract_value (deal amount), product_lines (a clean summary of the line items), start_date (expected close date or a sensible default). If the template uses different token names, the agent should map intelligently based on the token labels it sees.

Critical: do NOT send the document. Leave it in draft status. This workflow is approval-first, the AE always reviews before sending.

4) DM the deal owner in Slack. Use Send a Message to direct-message the HubSpot deal owner (look them up by their HubSpot email). The message should include: the deal name and value, the PandaDoc draft edit link, the name of the template that was picked, a one-paragraph justification ("chose Enterprise SaaS template because deal is $X with multi-year term and includes Product A and B"), and a callout listing any HubSpot fields that were missing so the AE knows what to fill in by hand before sending.

Why an agent and not a code workflow: the template pick and the token mapping both require reasoning over the deal context. A hardcoded mapping would break the moment the team adds a new template or a new product. The agent should read the templates' names and tags, read the deal, and decide.

Configuration I want to set when I install this: which pipeline stages count as "ready for a proposal," optional tag or folder filters that restrict which PandaDoc templates are eligible, and an optional override to send to a Slack channel instead of a DM to the deal owner.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe reveals