Generate a PDF from a template and send it automatically
The Generate a document step prints a PDF document template for a record, saves it in a file field, and makes it available to the next steps so you can send it by email or WhatsApp.
Before you start · 2 things · for owners and managersA document template for the unit, a file field in the unit
- You need: The permission to edit workflows
- A document template for the unit: Document templates: quotes, contracts and invoices as PDF.
- A file field in the unit: Field types: the full list and when to use each.
Steps
invoice, for the next steps to use.How it works
It’s printed as the automation’s creator. The document shows only what they could download themselves.
Sending it afterwards: in Send an email, add the document as an attachment. In Send a WhatsApp message, attach it under Attachments to send the PDF as a file, or put its link in the text with Insert a detail.
Variables: {{document.invoice.url}} is the link, {{document.invoice.name}} the name, and {{document.invoice.size}} the size.
If the record refuses the new status, the file alone is saved, with a warning.
If the PDF engine is busy, the step waits and tries again without counting an attempt.
The document is saved only once, even if the step is retried.
A practice run doesn’t print the document: it shows what would happen, and warns when a field it needs is empty.
If something goes wrong
A real example
Quotes are printed and sent by hand.
- A field changes: the stage changes to “Approved”.
- Generate a document from the quote template into the “Quote file” field.
- Send an email with the document, and Send a WhatsApp message with the file.
The quote reaches the client by email and WhatsApp within a minute.