Integration · Revenue operations
How to build quote document generation
A customer signs a quote built from a draft the deal desk never approved, and the signed PDF lives in a signing tool the CRM has never heard of. The shape of quote document generation that holds together, the prompts that build it, and the production detail that decides whether it holds.
Built with Tray Headless
- System Salesforce
- Step Approved version
- Step Generate document
- System DocuSign
- Step Write back
Only the approved version becomes a document, and the signed PDF and status are written back to the quote record.
The short answer
What is quote document generation?
Quote document generation comes down to four things: a document built only from the approved quote version, a version number on every document so v2 and v3 are never confused, a signature request whose signers come from the CRM, and the signed PDF and status written back to the quote record. Where this usually goes wrong is revision. A quote changed after it was sent leaves two live documents for one deal, and the customer signs the old one.
Stage 4 of 6: Generate and send the quote document. Part of Quote-to-cash, end to end: every stage, the systems it runs on and the guide that builds it.
What matters here
- Generate from the approved version only. A document built from a draft carries terms nobody signed off.
- Number every version and record what changed. v3 means nothing if nobody can say how it differs from v2.
- Take signers from the CRM contacts on the deal, not from an address typed into the signing tool.
- Write the signed PDF and the status back to the quote record, so the account team never asks where the signed copy is.
- When a sent quote is revised, void the old envelope before the new one goes out. Two live documents for one deal is the failure.
Who this is for
You run revenue operations or deal desk. Quotes are approved in one place, turned into documents in another and signed in a third, and finding the right signed copy takes a message to somebody.
How it works in practice
Everything that sits between an approved quote and a signed document on the record.
- 1
The approved version is selected
A document is only built from a quote version that carries an approval. A draft never qualifies.
- 2
The template, terms and currency are chosen
By region, product and deal type, with the currency taken from the quote rather than retyped.
- 3
The document is generated and versioned
Each one carries its version number and a short note of what changed from the last.
- 4
It is sent for signature to the CRM signers
The signers are the contacts and roles on the deal, with an expiry date and reminders set.
- 5
The signed PDF and status are written back
To the quote and the opportunity, so the signed copy is one click from where the team works.
- 6
A revision voids the old envelope
The sent document is voided and the new version is sent, so only one is ever live.
What quote document generation is made of
Four parts. The first is what keeps a draft from reaching a customer.
An approved-only source
The document is built from the approved quote version and nothing else. If approval is revoked, generation stops.
Versioned documents
Every document has a version number and a change note, so v2 and v3 can be compared without opening both.
Signers from the CRM
Names, emails and signing order come from the contact roles on the deal, so the document goes to the right people.
Write-back and expiry
The signed PDF and status land on the record. Expiry dates and reminders are set when the document is sent.
The Tray Headless prompts
Paste these into Claude Code or Codex with the Tray Headless plugin installed. Each stage runs on its own. The systems named in them are the worked example rather than a requirement, and every prompt says so.
Once per project, run
/tray-workflows:set-workspace
to pick the workspace these build in. Point it at a sandbox first.
- 1
Set up, then map the systems
The quote, the document and the signature each hold part of the truth.
Headless skills
build-workflowUse build-workflow. The systems in play are Salesforce or HubSpot, DealHub or PandaDoc, and DocuSign, or whatever we run in those seats. I need the quote object and its line items, whichever field holds the approval state and the version number, the contact roles on the opportunity, and what the signing tool sends when an envelope is completed, declined or voided. Show me where the quote version is stored in each system. They will not agree, and that disagreement is the integration.
- 2
Generate from the approved version only
A document built from a draft carries terms nobody approved.
Headless skills
build-workflowUse build-workflow. Generate the customer-facing quote or order form only from a quote version that carries an approval. If the version is a draft, or the approval was revoked, do not generate. Raise it to the deal desk instead. Choose the template from the region, the product set and the deal type. Take the currency, the payment terms and the legal terms from the quote record. Do not let anyone retype them into the document. Stamp the quote id and the version number on the document so it can be traced back to the record it came from.
The approved-only check is the whole control. Without it, a rep edits a quote after approval and the customer receives the edit.
- 3
Version every document and record what changed
v2 and v3 are only useful if the difference is written down.
Give each generated document a version number that matches the quote version. When a new version is generated, compare it to the previous one and write a short change note: lines added or removed, quantity changes, price changes, and any change to term dates or payment terms. Store the change note on the quote record next to the document, and keep every earlier document readable. Never overwrite a version that has been sent.
- 4
Send for signature to the signers on the deal
The document goes to the people the CRM says should sign it.
Headless skills
tray-gotchasUse tray-gotchas, then send the document for signature through DocuSign or PandaDoc. Take the signers from the contact roles on the opportunity: name, email and signing order. If a required role has no contact, stop and ask the account owner rather than sending to a guess. Set an expiry date on the envelope, and set reminders ahead of it. Post the send to the account channel in Slack with the version number.
- 5
Write the signed PDF and status back
So nobody asks where the signed copy is.
On the envelope completed event, write back to the quote record and the opportunity: the signed PDF, the certificate of completion, the signing timestamps and the status. On declined or expired, write that status too, and tell the account owner in Slack. A quote that expired unsigned should show as expired on the record, not stay open.
- 6
Void and resend when a sent quote is revised
Where most quote document flows quietly break.
When a quote is revised after the document was sent, first void the existing envelope and write the voided status to the record. Only then generate the new version from the new approved quote and send it. If the revision has not been approved yet, void nothing and generate nothing. The customer keeps the document they have until the new version is approved. Never leave two live envelopes for one quote. Report any quote that has one.
- 7
Check it end to end, then hand it to deal desk
Because templates and reminder timings change with the business.
Run the per-step schema checks and the whole-workflow audit before this touches production. Then open the same workflow in Tray Build so the deal desk can change templates, expiry periods and reminder timings in the visual canvas. Those change with the business, and they should not need a coding assistant.
What it connects to
Four kinds of system hold one quote between them.
Salesforce
Read the approved quote, its lines and the contact roles. Write the signed PDF, status and version back onto the record.
Reads and writes
HubSpot
The same job where deals and quotes live in HubSpot: read the approved quote and contacts, write back the signed copy and status.
Reads and writes
DealHub
Generate the customer-facing quote from the approved version, with the template, terms and currency from the quote.
Reads and writes
PandaDoc
Generate or send the document where PandaDoc is the document tool, and read its status.
Reads and writes
DocuSign
Send the document to the CRM signers, void it on revision, and take completion, decline and expiry events.
Reads and writes
Same build, other stacks
The design does not change if you run something else in one of these seats. The same prompts build it against Microsoft Dynamics 365, Microsoft Teams, Marketo, Google Chat or Braze.
Connections in this build
Field mapping, templates and common problems for each pairing: HubSpot + Salesforce, DealHub + Salesforce, DealHub + HubSpot and PandaDoc + Salesforce.
Named systems are the ones most teams run, not the only ones that work. Each is an authentication in your Tray workspace, referenced by name, so the workflow never holds a credential. Where we have a connector page, the name links to it.
Running it in production
This sends a commercial offer to a customer under your name. A wrong document is visible immediately.
It runs where production runs, not on a laptop
Signature events arrive when they arrive, including at the end of a quarter. They are handled on the platform with retries rather than by an endpoint somebody maintains.
Every document traces to an approved version
Quote id and version number are stamped on the document, so a signed copy can be traced to the approval behind it.
Credentials live in the workspace, never in the repo
CRM, document tool and signing tool are three authentications, each scoped separately. The signing credential should not be able to do anything else.
Deal desk owns the templates and timings
Templates, expiry periods and reminder timings open in Tray Build, adjusted by the team that owns the quote process.
A draft stops the line
It does not warn and continue. A document generated from an unapproved version is a customer-facing error.
Questions people ask
Why generate only from the approved version?
Because a document built from a draft carries prices and terms nobody approved. Checking for an approval before generating is what keeps an unreviewed discount from reaching a customer.
How should v2 and v3 of a quote be handled?
Number every document to match the quote version, write a short note of what changed from the last one, and never overwrite a version that was sent.
What happens when a quote is revised after it was sent?
Void the existing envelope, record the voided status, then generate and send the new approved version. Only one envelope should ever be live for a quote.
Where do the signers come from?
From the contact roles on the deal in the CRM. If a required role has no contact, stop and ask the account owner instead of sending to a guess.
Where does this stop and quote-to-order begin?
This one ends with the signed document and its status on the record. Booking the order and comparing it to what was signed is quote-to-order. The two meet at the signed PDF.
Further reading
Background on the same subject, for the case rather than the build.
Related guides
Revenue operations
How to build a quote-to-order integration
Approved quote to signed contract to booked order, with the approval state carried through and amendments handled. The Headless prompts that build it.
Legal and compliance
How to build a contract lifecycle sync
Extract the obligations rather than storing a PDF, put renewal and notice dates where somebody will see them, and never let the signed version drift. The prompts.
Revenue operations
How to build pricing guardrails for quotes
Keep one price book synced to the CRM and CPQ, check every line's discount as the quote is built, lock the price when it is sent, and route exceptions. The prompts.
Revenue operations
How to build a CPQ to ERP sync
Map the product catalogue as data, carry ramps and proration intact, keep both catalogues aligned, and fail loudly on an unmapped SKU. The prompts that build it.
Last reviewed November 2026.