This template is built for legal professionals, operations teams, and agencies that work with recurring document types — contracts, NDAs, invoices, lease agreements, proposals — and want to stop rebuilding templates from scratch. If you have an OpenAI API key, a Google Drive account, and a self-hosted Gotenberg instance, you can turn any uploaded document into a clean, reusable fill-in-the-blank template in seconds.
The workflow accepts any uploaded PDF or DOCX file, uses a two-pass AI process to identify the document type and extract variable fields, replaces all variable content with labeled [BRACKET] placeholders, renders the result to PDF, and returns a shareable Google Drive link — fully automated from upload to delivery.
A Webhook Trigger receives the uploaded file (PDF or DOCX) from your form or API client and passes the binary content downstream for processing.
Identify Document is a GPT-4o pass that reads the document and determines two things: the document type (e.g., Employment Contract, NDA, Lease Agreement, Project Proposal) and the specific variable fields that type of document typically contains. This classification step ensures the second pass has precise, context-aware instructions to work from.
Templatize Document is a second GPT-4o pass that uses the identified document type and field list to replace all variable content — names, dates, amounts, addresses, party details — with clearly labeled [BRACKET] placeholders, while preserving all static boilerplate and document structure verbatim.
Convert to PDF sends the finished template text to your self-hosted Gotenberg instance, which returns a clean, print-ready PDF — no third-party PDF service or API key required.
Upload to Google Drive saves the PDF to your designated Drive folder and sets public link sharing, so the template is immediately accessible and shareable.
Return Response delivers a JSON payload back to the caller containing the Google Drive file URL and any metadata, completing the webhook request.
general-template-creator).n8n-nodes-word2text for DOCX support (see the ⚠️ warning sticky in the workflow).n8n-nodes-word2text installed on your n8n instanceVisit automatedintelligentsolutions.com for more information and workflows.