Back to the blog

DocuGen integration: send generated and signed PDFs to other systems

Integrations 6 min read 27 November 2026

The problem, in two sentences

You generate complex documents from Salesforce—maybe a 60-page MSA with clauses populated from Opportunity, Account and a custom Contract_Line__c. After signature you still copy the PDF into your ERP, CLM or document vault. That copy step is manual, error-prone and adds days to revenue recognition.

DocuGen integration options: pick one that matches your team

There are four practical patterns to get Salesforce document generation output into other systems. Each is click-first for a Salesforce Admin and avoids a managed package: Files-hosted pull, Platform Events push, middleware webhook, or direct outbound message from Salesforce. DocuGen handles the generation and writes the final (or signed) PDF back to the same record, which is the anchor for every pattern.

1) Let the external system pull the file from Salesforce Files

How it works: DocuGen saves the generated PDF to the record as a Salesforce File (recommended for documents larger than 25 MB). Your external system authenticates to Salesforce and downloads the ContentDocument/ContentVersion when it needs it.

Why choose this: Simple, secure, and easy to audit. No middleware required. Best if the target system can poll or initiate the retrieval on an event, or when a human clicks a sync button.

When not to choose it: If the external system must be notified immediately for every signed document and cannot poll or pull on demand.

2) Push with Platform Events (real-time, scalable)

How it works: Configure a Flow to fire a Platform Event when DocuGen writes a PDF to the record (DocuGen can be triggered by a button, stage change, field change, or a new file). A downstream subscriber or middleware subscribes to the event and fetches the file using the ContentDocumentId in the event.

Why choose this: Near real-time delivery and robust at scale. Platform Events are resilient and decouple Salesforce from the receiver.

Example event payload your middleware will receive (illustrative):

{
  "ReplayId": 12345,
  "payload": {
    "recordId": "006xxxxxxxxxxxx",
    "contentDocumentId": "069xxxxxxxxxxxx",
    "signed": true,
    "templateName": "MSA_2026"
  }
}

3) Use outbound webhook via middleware (no Salesforce code in the target system)

How it works: A Flow or Process Builder action calls out to an iPaaS or middleware webhook with the record id and file metadata. The middleware authenticates to Salesforce, retrieves the document, transforms it and delivers to the target system (ERP, CLM, S3, etc.).

Why choose this: If the target system requires protocol translation, field mapping, or batching. Middleware also handles retries and security token rotation outside Salesforce.

When not to choose it: If you can live with the external system pulling directly—middleware adds cost and configuration.

4) Outbound message or Apex callout (direct push)

How it works: For older integrations you can use Salesforce outbound messages or a Flow with an Apex action to POST the file or a presigned URL to the external endpoint. This is more technical and may require dev support for auth and retries.

Why choose this: When you need a synchronous response from the target system or want to avoid middleware. Verdict: it's powerful but more brittle to maintain unless you have dev resources.

Salesforce document generation: triggers, timing and what to include

To pick a pattern you also need to decide when to move the file. Common trigger points:

  • After generation (before signature) – useful for archiving drafts or sending for internal review.
  • After send for signature – send the unsigned package to a workflow system.
  • After signed PDF is returned – most common for compliance and downstream systems that need the final executed copy.

DocuGen supports those triggers: you can start the run from a button, a stage change on Opportunity, a field change on Contract__c, or when a new file is added. For signed delivery, DocuGen writes the signed PDF back to the same record automatically—use that write action as your single source of truth.

Concrete scenario

Hypothetical: your commercial team generates 200 renewals a month. Each renewal is a 30–60 page PDF stored on the Opportunity and then needs to land in the billing system. Choose Platform Events or middleware. Platform Events notify the billing system in near-real-time; middleware can batch and push daily if the billing API has rate limits. Either way, using the ContentDocumentId written by DocuGen avoids re-generating documents and prevents mismatched versions.

Practical tips and pitfalls

  • Always prefer Salesforce Files for anything over 25 MB. Notes and Attachments cap at 25 MB and will cause unexpected failures.
  • Use anchor-tag signatures in your templates so signature positions survive repagination during generation and later conversions.
  • Include the record id and ContentDocumentId in any notification payload—it's the cleanest way for the receiver to retrieve the exact file version.
  • If your target system needs proof of signing, include DocuGen/Circularo metadata: signed timestamp, signer emails, and signature audit info stored on the record.
  • Test in a sandbox: DocuGen works in sandboxes exactly as in production, so validate the full end-to-end flow there before turning it on in production.

How Savvy DocuGen fits this picture

DocuGen does the heavy lifting for template merging and signing: it fills Word and PDF templates from any Salesforce record (including child rows), bundles templates if needed, and writes the finished and signed PDF back to the record. That signed PDF is the anchor you use for any DocuGen integration pattern described above. Because DocuGen connects via an authorised connection and not a managed package, you can test integration options in sandbox with the same behavior as production.

If you want to try these options in your org, install your templates, run a few merges and then configure a Flow to fire a Platform Event on the ContentDocument write. Try it in your sandbox.

Read next