AutomationMart
Home/Browse/Create custom PDF documents from templates with Gemini & Google Drive
n8n

Create custom PDF documents from templates with Gemini & Google Drive

n8nn8n30 modulesv1.0
NotionOpenAIGoogle DriveLinkedInGemini

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. 1 — What Does It Do / Which Problem Does It Solve? This workflow turns Google Docs-based contract & form templates into ready-to-sign PDFs in minutes—all from a single chat flow. - Automates repetitive document creation. Instead of copying a rental, sales, or NDA template and filling it by hand every time, the bot asks for the required values and fills them in. - Eliminates huma

At a glance

Create custom PDF documents from templates with Gemini & Google Drive is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Notion, OpenAI, Google Drive, LinkedIn. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Notion, OpenAI, Google Drive, LinkedIn, Gemini
Modules
30
Price
Free
Version
v1.0
Create custom PDF documents from templates with Gemini & Google Drive workflow diagram

About this workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. 1 — What Does It Do / Which Problem Does It Solve? This workflow turns Google Docs-based contract & form templates into ready-to-sign PDFs in minutes—all from a single chat flow. - Automates repetitive document creation. Instead of copying a rental, sales, or NDA template and filling it by hand every time, the bot asks for the required values and fills them in. - Eliminates human error. It lists every mandatory field so nothing is missed, and removes unnecessary clauses via conditional blocks. - Speeds up approvals. The final draft arrives as a direct PDF link—one click to send for signing. - One template → unlimited variations. Every new template you drop in Drive is auto-listed with zero workflow edits—it scales effortlessly. - 100 % no-code. Runs on n8n + Google Apps Script—no extra backend, self-hosted or cloud. --- 2 — How It Works (Detailed Flow) 1. 📝 Template Discovery 📂 The TemplateList node scans the Drive folder you specify via the ?mode=meta endpoint and returns an id / title / desc list. The bot shows this list in chat. 2. 🎯 Selection & Metadata Fetch The user types a template name. 🔍 GetMetaData opens the chosen Doc, extracts METAJSON, placeholders, and conditional blocks, then lists mandatory & optional fields. 3. 🗣 Data-Collection Loop - The bot asks for every placeholder value. - For each conditional block it asks 🟢 Yes / 🔴 No. Answers are accumulated in a data JSON object. 4. ✅ Final Confirmation The bot summarizes the inputs → when the user clicks Confirm, the DocProcess sub-workflow starts. 5. ⚙️ DocProcess Sub-Workflow | 🔧 Step | Node | Task | | --- | --- | --- | | 1 | User Choice Match Check | Verifies name–ID match; throws if wrong | | 2 | GetMetaData (renew) | Gets the latest placeholder list | | 3 | Validate JSON Format | Checks for missing / unknown fields | | 4 | CopyTemplate | Copies the Doc via Drive API | | 5 | FillDocument | Apps Script fills placeholders & removes blocks | | 6 | Generate PDF Link | Builds an export?format=pdf URL | 6. 📎 Delivery The master agent sends 🔗 Download PDF & ✏️ Open Google Doc links. 7. 🚫 Error Paths - status:"ERROR", missing:[…] → bot lists missing fields and re-asks. - unknown:[…] → template list is outdated; rerun TemplateList. - Any Apps Script error → the returned message is shown verbatim in chat. --- 3 — 🚀 Setup Steps (Full Checklist) > Goal: Get a flawless PDF on the first run. > > > Mentally tick the ☑️ in front of every line as you go. > ☁️ A. Google Drive Preparation | Step | Do This | Watch Out For | | --- | --- | --- | | 1 | Create a Templates/ folder → put every template Doc inside | Exactly one folder; no sub-folders | | 2 | Placeholders in every Doc are {{UPPERCASE}} | No Turkish chars or spaces | | 3 | Wrap optional clauses with [[BLOCKNAME:START]]…[[BLOCKNAME:END]] | The START tag must have a blank line above | | 4 | Add a METAJSON block at the very end | Script deletes it automatically after fill | | 5 | Right-click Doc > Details ▸ Description = 1-line human description | Shown by the bot in the list | | 6 | Create a second Generated/ folder (for copies) | Keeps Drive tidy | > 🔑 Folder ID (long alphanumerical) = <TEMPLATEPARENTID> > > > We’ll paste this into the TemplateList node next. > Simple sample template → Template Link --- 🛠 B. Import the Workflow into n8n If nodes look Broken afterwards → no community-node problem; you only need to select credentials. --- 📑 C. Customize the TemplateList Node 1. Open Template List node ⚙️ → replace '%3CYOURPARENTID%3E' in parents with the real folder ID in the URL. 2. Right-click node > Execute Node. 3. Copy the entire JSON response. 4. In the editor paste it into: - DocAgent → System Prompt (top) - User Choice Match Check → System Prompt (top) Save. > ⚠️ Why manual? Caching the list saves LLM tokens. Whenever you add a template, rerun the node and update the prompts. > --- 🔗 D. Deploy the Apps Script | Step | Screen | Note | | --- | --- | --- | | 1 | Open Gist files GetMetaData.gs + FillDocument.gs → File ▸ Make a copy | Both files may live in one project | | 2 | Project Settings > enable Google Docs API ✔️ & Google Drive API ✔️ | Otherwise you’ll see 403 errors | | 3 | Deploy ▸ New deployment ▸ Web app | | | • Execute as | Me | | | • Who has access | Anyone | | | 4 | On the consent screen allow scopes:• …/auth/documents• …/auth/drive | Click Advanced › Go if Google warns | | 5 | Copy the Web App URL (e.g. | If this URL changes, update n8n | Apps Script source code → Notion Link --- 🔧 E. Wire the Script URL in n8n | Node | Field | Action | | --- | --- | --- | | GetMetaData | URL | <WEBAPPURL>?mode=meta&id={{ $json["id"] }} | | FillDocument | URL | <WEBAPPURL> | > 💡 Prefer using an .env file? Add GASWEBAPPURL=… and reference it as {{ $env.GASWEBAPPURL }}. > --- 🔐 F. Add Credentials - Google Drive OAuth2 → Drive API (v3) Full Access - Google Docs OAuth2 → same account - LLM key (OpenAI / Gemini) - (Optional) Postgres Chat Memory credential for the corresponding node --- 🧪 G. First Run (Smoke Test) 1. Switch the workflow Active. 2. In the chat panel type /start. 3. Bot lists templates → pick one. 4. Fill mandatory fields, optionally toggle blocks → Confirm. 5. 🔗 Download PDF link appears → ☑️ setup complete. --- ❌ H. Common Errors & Fixes | 🆘 Error | Likely Cause | Remedy | | --- | --- | --- | | 403: Apps Script permission denied | Web app access set to User | Redeploy as Anyone, re-authorize scopes | | placeholder validation failed | Missing required field | Provide the listed values → rerun DocProcess | | unknown placeholders: … | Template vs. agent mismatch | Check placeholder spelling (UPPERCASE ASCII) | | Template ID not found | Prompt list is old | Rerun TemplateList → update both prompts | | Cannot find METAJSON | No meta block / wrong tag | Add [[METAJSONSTART]] … [[METAJSONEND]], retry | --- ✅ Final Checklist - [ ] Drive folder structure & template rules ready - [ ] Workflow imported, folder ID set in node - [ ] TemplateList output pasted into both prompts - [ ] Apps Script deployed, URL set in nodes - [ ] OAuth credentials & LLM key configured - [ ] /start test passes, PDF link received --- 🙋‍♂️ Need Help with Customizations? Reach out for consulting & support on LinkedIn: Özgür Karateke Full Documentation → Notion Simple sample template → Template Link Apps Script source code → Notion Link

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Process & summarize PDFs from email & messaging apps with OpenAI GPT

Process PDFs from Gmail, Outlook, Telegram and WhatsApp with OpenAI Transform PDF documents into actionable insights automatically across multiple platforms. This workflow monitors emails and messaging platforms for PDF attachments, extracts content, and delivers AI-powered summaries. Who's it for Business professionals, teams, and organizations needing automated PDF analysis from emails and messaging platforms. Perfect for processing contracts, reports, invoices, and documents requiring quick r

Free

Technical stock analysis with Telegram, Airtable and a GPT-powered AI agent

Video Guide I prepared a detailed guide that demonstrates the complete process of building a trading agent automation using n8n and Telegram, seamlessly integrating various functions for stock analysis. []( Youtube Link Who is this for? This workflow is perfect for traders, financial analysts, and developers looking to automate stock analysis interactions via Telegram. It’s especially valuable for those who want to leverage AI tools for technical analysis without needing to write complex code. W

Free

Instant infographic generator (LINE + Nano Banana Pro)

About This Template This workflow turns complex data or topics sent via LINE into beautiful, easy-to-understand Infographics. It combines Gemini (to analyze data and structure the visual layout) and Nano Banana Pro (accessed via Kie.ai API) to generate high-quality, data-rich graphics (Charts, timelines, processes). How It Works 1. Input: User sends a topic or data points via LINE (e.g., "Japan's Energy Mix: 20% Solar, 10% Wind..."). 2. Data Visualization Logic: Gemini acts as an Information Des

Free

Create high quality UGC images with Nano Banana (Cheaper & Faster)

Who’s it for? - Content Creators - E-commerce Stores - Marketing Team Description: Generate unique UGC images for your products. Simply upload a product image into a Google Drive folder, and the workflow will instantly generate 50 unique, high-quality AI UGC images using Nano Banana via Fal.ai. All results are automatically saved back into the same folder, ready to use across social media, e-commerce stores, and marketing campaigns. --- How it works? 📺 YouTube Video Tutorial:

Free

Generate AI document titles for Paperless-ngx with GPT-4o Mini

What it does This template automatically generates a professional, structured title for newly-ingested Paperless-ngx documents using AI (OpenAI GPT), then removes a processing tag to mark the document as handled. How it works 1. A webhook fires when a document needs titling (e.g., from a Paperless post-consumption script) 2. The document URL is validated, then the OCR text is fetched from the Paperless API 3. All PII is scrubbed from the text using n8n's Guardrails node before sending to AI 4. G

Free

Send LinkedIn lead form responses to your preferred destination with data processing

Automatically process LinkedIn lead form responses, set variables, and send data to your chosen destination using LinkedIn Lead Gen Forms and HTTP modules.

Free

Evaluate AI agent response relevance using OpenAI and cosine similarity

This n8n template demonstrates how to calculate the evaluation metric "Relevance" which in this scenario, measures the relevance of the agent's response to the user's question. The scoring approach is adapted from the open-source evaluations project RAGAS and you can see the source here How it works This evaluation works best for Q&A agents. For our scoring, we analyse the agent's response and ask another AI to generate a question from it. This generated question is then compared to the origi

Free

Automated resume job matching engine with Bright Data MCP & OpenAI 4o mini

Notice Community nodes can only be installed on self-hosted instances of n8n. Who this is for The Automated Resume Job Matching Engine is an intelligent workflow designed for career platforms, HR tech startups, recruiting firms, and AI developers who want to streamline job-resume matching using real-time data from LinkedIn and job boards. This workflow is tailored for: - HR Tech Founders - Building next-gen recruiting products - Recruiters & Talent Sourcers - Seeking automated candidate-job fit

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free