Generating PDFs in n8n Using Google Docs without paid APIs (for FREE)

The process involves the following steps:

  1. Create a document template in Google Docs.
  2. Add a service account to the document (details below).
  3. In your n8n workflow, copy this document into a new file.
  4. Use the document modification node to replace placeholders (for example, {client_name} with the actual client’s name).
  5. Convert the final document into a PDF and proceed with further workflow steps as needed.

This method lets you dynamically generate personalized PDFs based on a predefined template.

The process involves the following steps:

  1. Create a Template in Google Docs
  • Set up a document with placeholders (e.g., {client_name}, {invoice_number}).
  1. Grant Access to a Service Account
  1. Copy the Template in n8n (Google Drive Node)
  • Use the Google Drive node to duplicate the template and work with a fresh copy.
  1. Replace Placeholders with Actual Data (Google Docs Node)
  • The Google Docs node in n8n allows dynamic text replacement, personalizing the document. For example, you can find variable {client_name} inside your doc and replace it with John Doe text.
  1. Convert to PDF and Continue Processing (Google Drive Node)
  • Save the modified document as a PDF for further automation (e.g., emailing or storage) using Google Drive node.

Full step-by-step instructions, along with a ready-to-import JSON workflow, are available in the article:
Generating PDFs in n8n Using Google Docs.

Feel free to ask any questions about this flow.

I use it to generate docs for my Telegram Bot users.

2 Likes