Salesforce document generation means producing a finished document, usually a PDF, straight from a Salesforce record: a quote from an opportunity, a contract from an account, an invoice from an order. You design the template once, and every record fills it with its own data.
It sounds like a solved problem, and in a demo it always is. The differences between tools show up later, when the template has a related-list table, a conditional clause and a signature block, and the document has to go out from a flow at two in the morning with nobody watching. This guide covers what to compare, where document generation projects usually go wrong, and what generating natively inside Salesforce looks like in practice.
What document generation in Salesforce actually involves
Every document generation tool does the same four things, whatever it calls them. It reads data from a root record and anything related to it. It merges that data into a template: fields, loops over related records, conditions and tables. It renders the result into a PDF or an HTML email. And it delivers the output somewhere: attached to the record, emailed, or handed to e-signature.
The tools differ in where each of those steps happens. Some read your data through the API and render on their own servers. Others run entirely inside your org. That choice decides more about security reviews, limits and maintenance than any feature list does.
Five questions to ask before you choose
1. Where is the document rendered? If rendering happens outside Salesforce, customer data leaves the org on every generation. For many companies that is fine. For regulated industries, or customers with strict data-residency requirements, it adds a security review and a data processing agreement to the project.
2. Who maintains the templates? Templates outlive the project that created them. If only a developer or a consultant can change a clause, every small legal update becomes a ticket. Look for a template builder an admin can use, with a live preview against a real test record.
3. How does it handle related lists? Quotes need line items, contracts need contacts, reports need tables. Ask how deep the relationships can go, how many rows a list can hold, and what happens when a record exceeds that number. A tool that silently drops rows is worse than one that warns you.
4. Can it run unattended? Generating from a button is the easy case. The valuable case is a Flow that generates and sends the document when an opportunity reaches a stage, with no user in the loop. Check whether generation can run in the background, and what the limits are when it does.
5. What happens at signature? Most generated contracts need a signature next. If generation and e-signature are separate products, someone has to place signature fields by hand or maintain anchor text in every template. If they are connected, the signature blocks live in the template itself.
The test that matters
Take your most complicated real document, not the vendor's sample, and ask for it to be built during the trial: related-list table, one conditional section, a signature block, generated from a Flow. Whatever breaks there will break in production.
Where document generation projects usually go wrong
The template library grows without ownership. Every team copies an existing template and changes three things, and two years later nobody knows which of forty quote templates is current. Shared brands, meaning one place for fonts, colours, logo and page layout, keep that under control.
Limits are discovered in production. Salesforce governs processing time and memory, and a document that generates perfectly with ten line items can fail with eight hundred. Good tools publish planning figures and offer a background mode with more headroom for large documents.
Generation and signature are designed separately. The document gets built, and then someone realises the signature fields have to be positioned by hand on every send. That manual step is exactly what the automation was supposed to remove.
Native generation with @Draft
@Draft is the document generation add-on that ships with @Sign. It runs inside Salesforce: templates are built in a builder in your org, data never leaves it to be rendered, and output is a PDF for documents or HTML for emails.
A template is built for one root object, such as Opportunity or Account, and can add extra named records called contexts, for example a sender and a receiver. Inside the template you insert merge fields, loops over related records, conditions, tables, images, barcodes and QR codes. You can import an existing Word document as a starting point, and a live preview shows the result against a test record while you edit.
Brands hold the shared look: fonts, colours, page layout, logo and watermark. Templates link to a brand, so a logo change is one edit rather than forty.
Generation runs either directly from the builder or in the background through a Flow action. The background mode has roughly four times more room, which is what makes large dossiers and bulk runs practical. Related lists hold up to 2,000 rows, and the builder warns you when a record goes over that number instead of failing silently.
From generated document to signed contract
The step that saves the most time comes after generation. A @Draft template can contain @Sign blocks: Role, Signature, Signer Name, Signer Date and Initials. When the document is sent, each block becomes a real signing field at the exact page and position in the PDF. Nobody drags fields around, and nobody maintains anchor text.
From a record, a user picks the template under New Contract, reviews the document in the @Sign editor and sends it. From Flow, the Send @Draft Contract action generates and sends the contract with nobody opening the editor, and signers can be overridden per run. The signed document and its status come back to the same Salesforce record, which is the part that matters for anyone trying to find the contract again later.
Is a separate document generation platform worth it?
If you generate many different document types across many objects, need complex clause libraries, or already run a full CLM suite, a dedicated platform can earn its cost. Our guide to Salesforce CLM covers when that is the case.
If your documents are mostly quotes, order forms and standard contracts that end in a signature, the simpler setup is usually better: generate inside Salesforce, sign inside Salesforce, and keep the result on the record. That is the setup @Draft and @Sign are built for.
Frequently asked questions
Does Salesforce have built-in document generation? Salesforce offers document generation in some of its own products and editions, but most orgs add a tool from AppExchange. Check what your edition includes before you buy anything.
Can I generate documents from a Flow? Yes, as long as the tool provides a Flow action. With @Draft, the Generate Document action runs in the background by default, and Send @Draft Contract generates and sends for signature in one step.
How large can a generated document be? It depends on content rather than page count. As a planning figure, a text-only contract runs to about 150 pages when generated directly and about 650 in the background. Documents with a QR code on every page are much smaller.
Can I reuse my Word templates? @Draft can import a .docx file into the builder as a starting point, after which you add merge fields and blocks.