The problem
You want a PDF contract generated and sent for signature the moment an Opportunity reaches a specific stage — not a button click, not someone remembering to press send. Manual steps create delays: a sales rep forgets, legal waits, and you spend time hunting for the signed file.
This walkthrough shows a practical, click-based Flow pattern that triggers Salesforce document generation and e-signature on a stage change. It uses a simple trigger field so you avoid code and keep control in declarative tools.
How triggers work with DocuGen
Savvy DocuGen can kick off a merge-and-send when a record changes: stage changes, other field changes, or when a new file appears. When triggered it fills your Word/PDF template from the Opportunity (and related records up to five levels), files the produced document back to the Opportunity (Salesforce Files or Notes & Attachments), and can send that document for signature using your Circularo account. Signature positions use anchor tags so they survive repagination, and you can require emailed one-time codes or a per-signer password pulled from the signer’s Salesforce record.
Example scenario
Hypothetical: you have a 60-page Master Services Agreement for new deals. When an Opportunity moves to a stage called "Contract Sent" you need the system to: generate the PDF from the Opportunity and related Account and Contact data, attach that PDF to the Opportunity, and send it to the primary Contact for signature.
Solution overview
We’ll use a small, declarative pattern that works well for admins:
- Create a trigger checkbox field on Opportunity (e.g.,
Send_DocuGen__c).
- Configure your DocuGen template to trigger when that field changes to true.
- Build a record-triggered Flow that flips the checkbox when StageName equals "Contract Sent" and resets it later so the trigger can run again.
Step-by-step: build the Flow
All clicks. No Apex.
- Create the trigger field
- Go to Object Manager > Opportunity > Fields & Relationships and create a Checkbox called
Send_DocuGen__c default false.
- Configure the DocuGen template trigger
- In the Savvy DocuGen template settings, set the template to run when Opportunity.
Send_DocuGen__c changes to true. Also set the template to file the resulting document on the Opportunity and to send for signature via Circularo.
- Build the Flow
- Open Flow Builder and create a Record-Triggered Flow on Opportunity.
- Trigger: When a record is updated, run the flow only when specific fields change (StageName).
- Entry criteria:
StageName = 'Contract Sent' AND Send_DocuGen__c = false (current value).
- Immediate path: Add an Update Records element that sets
Send_DocuGen__c = true for the triggering Opportunity. This flips the trigger field and starts DocuGen.
- Scheduled path: Add a scheduled action 5 minutes later (or whatever window you prefer) that updates the same Opportunity setting
Send_DocuGen__c = false. This reset lets the process run again if needed (for example, you move back and forth between stages during negotiations).
Why the scheduled reset? DocuGen listens for field changes. Flipping the checkbox true starts the job; resetting it later prevents the flag from permanently blocking future runs.
Notes on idempotency and multiple triggers
If reps re-enter the same stage rapidly, your Flow criteria and the scheduled reset ensure the trigger only fires when StageName changes into "Contract Sent" and Send_DocuGen__c was previously false. If you expect rapid repeated changes, add extra Flow logic to check a Last_DocuGen_Sent__c datetime field and avoid retriggering within X hours.
Handling signatures, large files, and attachments
Position signature blocks in your template with anchor tags so signatures stay attached even if the document repaginates. If you need identity verification, enable emailed one-time codes or require a per-signer password that DocuGen reads from each signer’s Contact record.
DocuGen supports documents up to 40 MB. Remember Notes & Attachments has a 25 MB cap, so large merged contracts should be saved into Salesforce Files.
Common pitfalls and checks
- Make sure your Flow runs in the same context as the user who can edit the trigger field or use proper system context settings.
- Test in a sandbox — DocuGen works in sandboxes exactly as in production.
- Confirm the template has access to the Opportunity fields and any parent or child records you need (DocuGen can reach five levels of parent lookups and child records for repeating rows).
- If signatures fail to send, check the Circularo connection and that signer email addresses exist on the Contact records.
Wrap-up
If you want to stop manual PDF generation and the signature chase, a small trigger checkbox plus a record-triggered Flow is a reliable, declarative solution. It keeps the logic visible, repeatable, and safe for admins to manage.
Savvy DocuGen fills templates from any Salesforce record, files the generated document back to the record, and sends it for signature through your Circularo account. Try this Flow pattern in your sandbox and run your first automated send there — if you want, use a copy of your template and a test Opportunity to confirm the full end-to-end process.
Call to action: Try this Flow in your sandbox with a test Opportunity and your DocuGen template to verify generation, filing, and e-signature flow end to end.
Read next