Back to the blog

How to avoid hitting Salesforce file storage limits with DocuGen

Storage & Limits 6 min read 23 November 2026

The problem, in two sentences

If you generate long agreements or batch hundreds of signed documents a month, Salesforce file storage can get eaten faster than you expect. This post shows how DocuGen stores generated files, how that interacts with Salesforce file quotas, and a concrete plan to avoid surprises.

Understand Salesforce file storage limits and DocuGen behaviour

DocuGen fills Word and PDF templates from any Salesforce record (Opportunity, Contract, Quote, custom objects, etc.) and then files the finished document on the record either as Salesforce Files or Notes & Attachments, depending on the template settings. Important hard limits to remember:

  • DocuGen will produce documents up to 40 MB.
  • Salesforce Notes & Attachments is capped at 25 MB per file by Salesforce and cannot be raised; Files has different limits and is the right choice for larger documents.
  • DocuGen works exactly the same in sandboxes as in production.

That means two simple rules: if your generated PDF might exceed 25 MB, store it as a Salesforce File. And if you expect many documents per record, plan for cumulative storage, not just single-file size.

Notes and Attachments limit: where people get burned

Admins often keep using Notes & Attachments because it's how attachments worked historically. That becomes a problem when you start generating signed contracts or bundled documents:

  • Single long documents can exceed 25 MB and will fail to save to Notes & Attachments.
  • Many small PDFs add up. Ten 6 MB PDFs is 60 MB of storage—still attached to the record and counting against your org's total file storage.
  • Automations that expect a new attachment on Opportunity or Contract can suddenly break when a save fails due to size.

So switch templates that produce big or many documents to use Salesforce Files. Files supports DocuGen's 40 MB documents and avoids that specific failure case.

Practical storage strategy for document generation Salesforce admins

Here’s a real-feeling hypothetical scenario and a concrete plan you can implement.

Hypothetical scenario

You generate renewal packages for 200 contracts each month. Each package is a 60-page merged PDF, approximately 6 MB signed. You keep the signed PDF on the Contract record.

# Monthly storage consumed
documents_per_month = 200
avg_size_mb = 6
monthly_mb = documents_per_month * avg_size_mb
# monthly_mb = 1200 MB = ~1.2 GB

At that rate you'll add about 1.2 GB of file storage per month. If you keep historical copies forever, that adds up fast.

Three rules to implement today

  • Use Salesforce Files for anything over 10 MB. Notes & Attachments fails at 25 MB; pick Files as the default for templates that create longer documents.
  • Store only the final signed PDF on the primary record. Configure templates so intermediate drafts or merged-but-unsubmitted PDFs are not auto-filed. File the final signed bundle back to the Opportunity or Contract record.
  • Define a retention policy and automate cleanup. Move older versions (signed copies older than X months) to a Documents Library or an external archive. If you keep every signed PDF on the Contract, plan the growth and automate a cleanup job that moves older files off core storage.

How DocuGen features help

  • DocuGen bundles multiple templates into a single signature run — that reduces the number of generated files you store.
  • Signature positions use anchor tags so layouts survive repagination, avoiding repeated manual rework that creates extra drafts.
  • Signed PDFs are written back to the same record automatically, so your records keep the official copy without extra manual uploads.

Operational tips and checks

Put these short checks into your release playbook and flow definitions.

  • Add a template naming convention: include "Files" or "N&A" in the template name so the person creating templates picks the right storage target.
  • When you test in sandbox, generate copies that match production sizes. DocuGen works the same in sandbox, so a sandbox test that produces 30 MB confirms the behavior before you push changes.
  • Monitor storage growth: run a monthly query on ContentDocument or Attachment counts and average sizes. If you see a steady climb, adjust the retention window.

Quick checklist to avoid surprises

  • Switch templates that produce long or bundled PDFs to Salesforce Files.
  • File only final signed documents to the record; avoid auto-saving drafts.
  • Bundle templates where possible to reduce file count.
  • Test large documents in sandbox; DocuGen behaves the same as production.
  • Automate archival for older signed PDFs to keep core storage under control.

If you want a simple first change: identify templates that produce more than 10 pages or include many images and set those templates to save to Salesforce Files instead of Notes & Attachments. That single change removes the most common storage failure.

Savvy DocuGen handles the document generation and storage choices for you: it creates documents up to 40 MB, writes signed PDFs to the record as Files or Notes & Attachments per template, and works the same in sandbox. Try it in your sandbox to generate a realistic contract, confirm where it saves, and measure the storage impact before you roll it into production.

Ready to test? Try DocuGen in your sandbox today and run a full signed contract through the flow to see exactly how your org storage changes.

Read next