Библиотека / Документы, PDF и OCR
Документы, PDF и OCR
Агент шаблонов договоров для Google Docs с Gemini
Когда приходит сообщение в чате или его вызывает другой рабочий процесс, агент Gemini с памятью в Postgres находит и заполняет шаблоны договоров Google Docs, хранящиеся в Google Drive.
Что делает
## Description ## 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 META_JSON, 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 verbati
Шаги
- Google Gemini Chat Model
- GetMetaData
- When chat message received
- DocAgent
- DocProcess
- Postgres Chat Memory
- Template List
- When Executed by Another Workflow
- If
- Google Gemini Chat Model1
- Structured Output Parser
- Edit Fields
- If1
- Other Errors
Всего шагов: 30.
Похожие автоматизации
Чат-боты и боты для мессенджеровИИ-агент по продажам для Bitrix24 с Gemini и SupabaseШагов: 54Документы, PDF и OCRСоздание медицинских отчётов по запросам из Gmail с GeminiШагов: 11Документы, PDF и OCRПодготовка юридических документов о залоге для HOA с Gemini и ApifyШагов: 22RAG и базы знанийЧат с документами Google Drive с Gemini, Qdrant и TelegramШагов: 35