# Generate legal documents via chat: answer questions, get PDF from template
This workflow automates the creation of standard legal and business documents using Google Docs templates. The user interacts via chat (Telegram), answers a series of questions, and receives a fully populated PDF document. An AI agent powered by Google Gemini and LangChain validates inputs, populates templates, and delivers results — ideal for professionals needing fast, accurate document generation without manual copying.
## Who it´s for
- Law firms creating standard contracts
- Entrepreneurs formalizing deals without a lawyer
- HR specialists preparing employment agreements
- Notaries and consultants with high document loads
- Business owners in Turkey working with local forms
## What the automation does
- Triggers on a new chat message in Telegram
- User selects a document type (e.g., sales agreement or NDA)
- AI agent (LangChain + Google Gemini) asks clarifying questions and collects data
- Validates inputs against template metadata fetched via Google Apps Script
- Fills the Google Docs template, converts to PDF, and stores in Google Drive
- Sends download link back to user via Telegram
- Stores all data in PostgreSQL for audit and reuse
## What´s included
- Ready-to-use n8n workflow
- Trigger and handler logic based on chat_message and execute_workflow_trigger
- Integrations with Google Drive, Google Docs, Telegram, Google Gemini API, and PostgreSQL
- Basic textual guide for launch and adaptation
## Requirements for setup
- n8n instance with external API access
- Active accounts: Google Workspace (Drive, Docs), Telegram Bot, Google Cloud (Gemini API)
- PostgreSQL database for data storage
- Configured Google Apps Script to fetch template metadata
## Benefits and outcomes
- Reduces document preparation time to minutes
- Minimizes errors through AI and metadata validation
- Scalable: one template, thousands of personalized outputs
- Easy for non-technical users to operate
- Centralized data and template management
- Supports local compliance (including Turkish business forms)
## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet