by Marcial Ambriz
Remixed Backup your workflows to GitHub from Solomon's work. Check out his templates. How it works This workflow will backup your workflows to GitHub. It uses the n8n API node to export all workflows. It then loops over the data, checks in GitHub to see if a file exists that uses the credential's ID. Once checked it will: update the file on GitHub if it exists; create a new file if it doesn't exist; ignore if it's the same. In addition, it also checks if any workflows have been deleted from n8n. If a workflow no longer exists in n8n, the corresponding file will be removed from the repository to keep everything in sync. Who is this for? People wanting to backup their workflows outside the server for safety purposes or to migrate to another server.
by I versus AI
WATCH THE n8n STARTER GUIDE 👇 This template is featured in the n8n Starter Guide series. The template is free, but comes with two additional PDFs and a Quick Start video if you grab the full download pack on gumroad. How it works This template is a visual map of many useful n8n nodes. It groups nodes like Triggers, AI tools, and App connectors onto the canvas. Explore the sections to learn about different nodes and easily copy them for your own workflows. It acts as a handy visual reference guide. Set up steps • Setup takes about 5 minutes. • Import the template into your n8n instance. • Explore the node categories visually on the canvas. • A Quick Start video is included in the download pack, along with a prompts PDF and PDF with links to other awesome n8n templates here on the n8n template gallery.
by CustomJS
n8n Workflow: Automating Website Screenshots from Google Sheets This n8n workflow captures screenshots of websites listed in a Google Sheet and saves them to Google Drive using the CustomJS PDF Toolkit. @custom-js/n8n-nodes-pdf-toolkit Features Monitors** a Google Sheet for new rows with website URLs. Captures** screenshots of the websites using the CustomJS PDF Toolkit. Uploads** the screenshots to a specified Google Drive folder. Notice Community nodes can only be installed on self-hosted instances of n8n. Requirements Self-hosted** n8n instance A Google Sheets document containing website URLs and Titles. A Google Drive folder to store the screenshots. A CustomJS API key for website screenshots. n8n credentials** for Google Sheets and Google Drive. Workflow Steps Google Sheets Trigger Monitors a specified sheet for new rows. Extracts the URL and Title from the row. Website Screenshot Node Uses CustomJS PDF Toolkit to take a screenshot of the given URL. Google Drive Upload Saves the screenshot to a specific Google Drive folder. Uses the Title column as the filename. Setup Guide 1. Connect Google Sheets Ensure your Google Sheet has a column named Url for website URLs and Name for website names. Set up Google Sheets credentials in n8n. 2. Configure CustomJS API Sign up at CustomJS. Retrieve your API key from the profile page. Add your API key as n8n credentials. 3. Set Up Google Drive Create a folder in Google Drive to store screenshots. Copy the folder ID and set it in the Google Drive node in n8n. Perfect for: Website monitoring** Generating visual archives of web pages** Automating content curation** This workflow streamlines the process of capturing and organizing website screenshots efficiently.
by Jez
🎯 Overview This n8n workflow automates the process of ingesting documents from multiple sources (Google Drive and web forms) into a Qdrant vector database for semantic search capabilities. It handles batch processing, document analysis, embedding generation, and vector storage - all while maintaining proper error handling and execution tracking. 🚀 Key Features Dual Input Sources**: Accepts files from both Google Drive folders and web form uploads Batch Processing**: Processes files one at a time to prevent memory issues and ensure reliability AI-Powered Analysis**: Uses Google Gemini to extract metadata and understand document context Vector Embeddings**: Generates OpenAI embeddings for semantic search capabilities Automated Cleanup**: Optionally deletes processed files from Google Drive (configurable) Loop Processing**: Handles multiple files efficiently with Split In Batches nodes Interactive Chat Interface**: Built-in chatbot for testing semantic search queries against indexed documents 📋 Use Cases Knowledge Base Creation**: Build searchable document repositories for organizations Document Compliance**: Process and index legal/regulatory documents (like Fair Work documents) Content Management**: Automatically categorize and store uploaded documents Research Libraries**: Create semantic search capabilities for research papers or reports Customer Support**: Enable instant answers to policy and documentation questions via chat interface 🔧 Workflow Components Input Methods Google Drive Integration Monitors a specific folder for new files Processes existing files in batch mode Supports automatic file conversion to PDF Web Form Upload Public-facing form for document submission Accepts PDF, DOCX, DOC, and CSV files Processes multiple file uploads in a single submission Processing Pipeline File Splitting: Separates multiple uploads into individual items Document Analysis: Google Gemini extracts document understanding Text Extraction: Converts documents to plain text Embedding Generation: Creates vector embeddings via OpenAI Vector Storage: Inserts documents with embeddings into Qdrant Loop Control: Manages batch processing with proper state handling Key Nodes Split In Batches**: Processes files one at a time with reset: false to maintain state Google Gemini**: Analyzes documents for context and metadata Langchain Vector Store**: Handles Qdrant insertion with embeddings HTTP Request**: Direct API calls for custom operations Chat Interface**: Interactive chatbot for testing vector search queries 🛠️ Technical Implementation Batch Processing Logic The workflow uses a clever looping mechanism: Split In Batches with batchSize: 1 ensures single-file processing reset: false maintains loop state across iterations Loop continues until all files are processed Error Handling All nodes include continueOnFail options where appropriate Execution logs are preserved for debugging File deletion only occurs after successful insertion Data Flow Form Upload → Split Files → Batch Loop → Analyze → Insert → Loop Back Google Drive → List Files → Batch Loop → Download → Analyze → Insert → Delete → Loop Back 📊 Performance Considerations Processing Time**: ~20-30 seconds per file Batch Size**: Set to 1 for reliability (configurable) Memory Usage**: Optimized for files under 10MB API Costs**: Uses OpenAI embeddings (text-embedding-3-large model) 🔐 Required Credentials Google Drive OAuth2: For file access and management OpenAI API: For embedding generation Qdrant API: For vector database operations Google Gemini API: For document analysis 💡 Implementation Tips Start Small: Test with a few files before processing large batches Monitor Costs: Track OpenAI API usage for embedding generation Backup First: Consider archiving instead of deleting processed files Check Collections: Ensure Qdrant collection exists before running 🎨 Customization Options Change Embedding Model**: Switch to text-embedding-3-small for cost savings Adjust Chunk Size**: Modify text splitting parameters for different document types Add Metadata**: Extend the Gemini prompt to extract specific fields Archive vs Delete**: Replace delete operation with move to "processed" folder 📈 Real-World Application This workflow was developed to process business documents and legal agreements, making them searchable through semantic queries. It's particularly useful for organizations dealing with large volumes of regulatory documentation that need to be quickly accessible and searchable. Chat Interface Testing The integrated chatbot interface allows users to: Query processed documents using natural language Test semantic search capabilities in real-time Verify document indexing and retrieval accuracy Ask questions about specific topics (e.g., "What are the pay rates for junior employees?") Get instant AI-powered responses based on the indexed content 🌟 Benefits Automation**: Eliminates manual document processing Scalability**: Handles individual files or bulk uploads Intelligence**: AI-powered understanding of document content Flexibility**: Multiple input sources and processing options Reliability**: Robust error handling and state management 👨💻 About the Creator Jeremy Dawes is the CEO of Jezweb, specializing in AI and automation deployment solutions. This workflow represents practical, production-ready automation that solves real business challenges while maintaining simplicity and reliability. 📝 Notes The workflow intelligently handles the n8n form upload pattern where multiple files create a single item with multiple binary properties (Files_0, Files_1, etc.) The Split In Batches pattern with reset: false is crucial for proper loop execution Direct API integration provides more control than pure Langchain implementations 🔗 Resources Qdrant Documentation OpenAI Embeddings n8n Documentation Jezweb - AI & Automation Solutions This workflow demonstrates practical automation that bridges document management with modern AI capabilities, creating intelligent document processing systems that scale with your needs.
by Sam Nesler
Syncs assignments and completion states to and fro between Canvas LMS and a Notion database. Automatically triggers every 2 hours during the schoolday by default (meaning 7 times a day), but also supports manual refreshing via webhooks. Setup You'll need a few things to get started: A Canvas API key. You can generate one by going to your Canvas account settings and clicking on the "New Access Token" button. The URL looks like https://canvas.wisc.edu/profile/settings You'll also need to replace URLs in Canvas nodes with your institution's domain, unless you're a student at UW-Madison. Canvas nodes are all the HTTP Request nodes except the one labelled "OpenAI Categorization", which is an OpenAI node and will require a key in a later step. A Notion integration token. You can find this by going to your Notion integrations page and clicking "Create new integration". You can make it a "Internal Integration". A Notion database to sync to. I made a template for use with the workflow, but you can use any database that has the following fields: Status (status): Status with at least the options "Not Started" and "Completed" - assignments start out "Not Started", and are marked "Completed" when they are submitted on Canvas. Estimate (select): Select with at least the options "XS", "S", "M", "L", "XL" - this is where the estimated time to complete the assignment will be stored. Even if you don't use AI, they'll start out as "M" Priority (select): Select with at least the options "Could Do", "Should Do", "Must Do" - assignments start out "Should Do" ID (text): this is where the ID of the assignment will be stored. We use this to sync without having a database on the server Due Date (date): this is where the due date of the assignment will be stored Class (text): this is where the name of the class will be stored Link (URL): this is where the link to the assignment will be stored The ID of the Notion database you want to sync to. You can find this by clicking "Share" in the top right of your database and copying the link. The ID is the part of the link that comes after https://www.notion.so/ and before ?v=. So for https://www.notion.so/tsuniiverse/1976e99d91128076b034e7379464560f?v=1976e99d911281e7bd4b000c2cbec692&pvs=4, the ID would be 1976e99d91128076b034e7379464560f. An OpenAI key for assignment length estimation or disable the node. Manual Refreshing Embed the production URL from the Webhook Trigger inside a "toggle list" or "toggle heading" inside Notion, then expand the heading to refresh, like so:
by Angel Menendez
Upload Public-Facing Images to an S3 Cloudflare Bucket via Slack Modal 🛠 Who is this for? This workflow is for teams that use Slack for internal communication and need a streamlined way to upload public-facing images to an S3 Cloudflare bucket. It's especially beneficial for DevOps, marketing, or content management teams who frequently share assets and require efficient cloud storage integration. 💡 What problem does this workflow solve? Manually uploading images to cloud storage can be time-consuming and disruptive, especially if you're already working in Slack. This workflow automates the process, allowing you to upload images directly from Slack via a modal popup. It reduces friction and keeps your workflow within a single platform. 🔍 What does this workflow do? This workflow connects Slack with an S3 Cloudflare bucket to simplify the image-uploading process: Slack Modal Interaction**: Users trigger a Slack modal to select images for upload. Dynamic Folder Management**: Choose to create a new folder or use an existing one for uploads. S3 Integration**: Automatically uploads the images to a specified S3 Cloudflare bucket. Slack Confirmation**: After upload, Slack sends a confirmation with the uploaded file URLs. 🚀 Setup Instructions Prerequisites Slack Bot with the following permissions: commands files:write files:read chat:write Cloudflare S3 Credentials: Create an API token with write access to your S3 bucket. n8n Instance: Ensure n8n is properly set up with webhook capabilities. Steps Configure Slack Bot: Set up a Slack app and enable the Events API. Add your n8n webhook URL to the Events Subscription section. Add Credentials: Add your Slack API and S3 Cloudflare credentials to n8n. Customize the Workflow: Open the Idea Selector Modal node and update folder options to suit your needs. Update the Post Image to Channel node with your Slack channel ID. Deploy the Workflow: Activate the workflow and test by triggering the Slack modal. 🛠 How to Customize This Workflow Adjust the Slack Modal You can modify the modal layout in the Idea Selector Modal node to add additional fields or adjust the styling. Change the Bucket Structure Update the Upload to S3 Bucket node to customize the folder paths or change naming conventions. 🔗 References and Helpful Links Slack API Documentation Cloudflare S3 Setup n8n Documentation 📓 Workflow Notes Key Features: Slack Integration**: Uses Slack modal interactions to streamline the upload process. Cloud Storage**: Automatically uploads to a Cloudflare S3 bucket. User Feedback**: Sends a Slack message with file URLs upon successful upload. Setup Dependencies: Slack API token Cloudflare S3 credentials n8n webhook configuration Sticky Notes Included Sticky notes are embedded within the workflow to guide you through configuration and explain node functionality. 🌟 Why Use This Workflow? This workflow keeps your image-uploading process intuitive, efficient, and fully integrated with tools you already use. By leveraging n8n's flexibility, you can ensure smooth collaboration and quick sharing of public-facing assets without switching contexts.
by Simon
Address Validation Workflow About This workflow automates the process of validating and correcting client shipping addresses in Billbee, ensuring accurate delivery information. It's ideal for e-commerce businesses looking to save time and reduce errors in their order fulfillment process. The workflow uses Billbee, an order management platform for small to medium-sized online retailers, and the Endereco API for address validation. Who Is This For? E-Commerce Businesses**: Streamline order fulfillment by automatically correcting common shipping address errors. Warehouse Teams**: Reduce manual work and ensure packages are shipped to the correct address. Small to Medium-Sized Retailers**: Businesses using Billbee to manage orders and requiring efficient, automated solutions for address validation. How it Works Trigger: Workflow starts via a Billbee Webhook when an order is imported. Fetch Data: Retrieve the client's shipping address using the Order ID. Validate Address: Send the address to the Endereco API for validation and correction (e.g., house number errors). Conditional Actions: Valid Address: Update the address in Billbee. Invalid Address: Tag the order with "Validation Error." Track Status: Add tags in Billbee for processed orders. Setup Steps API Keys: Obtain Billbee Developer/User API Keys and Endereco API Key. Billbee Rule: Create an automation rule: Trigger: Order imported. Action: Call External URL with OrderId to trigger n8n workflow. Optional: Use a secondary trigger (e.g., order state changes to "gepackt") for manual corrections. Customization Options Filter Delivery Addresses: Customize filters to exclude specific delivery types, such as pickup shops ("Postfiliale," "Paketshop," or "Packstation"). Filters can be adjusted within Billbee or in the workflow. Error Handling: Configure additional actions for orders that fail validation, such as notifying your team or flagging orders for manual review. Order Tags: Define custom tags in Billbee to better track order statuses (e.g., "Address Corrected," "Validation Error"). Trigger Types: Use additional triggers such as changes to order states (e.g., "gepackt" or "In Fulfillment") for manual corrections or validations. Address Fields: Modify the workflow to focus on specific address components, such as postal codes, city names, or country codes. Validation Rules: Adjust Endereco API settings or add custom logic to refine validation criteria based on your business needs. API Documentation Endereco**: Endereco API Docs Billbee**: Billbee API Docs
by Mark Shcherbakov
Video Guide I prepared a detailed guide explaining how to set up and implement this scenario, enabling you to chat with your documents stored in Supabase using n8n. Youtube Link Who is this for? This workflow is ideal for researchers, analysts, business owners, or anyone managing a large collection of documents. It's particularly beneficial for those who need quick contextual information retrieval from text-heavy files stored in Supabase, without needing additional services like Google Drive. What problem does this workflow solve? Manually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files. What this workflow does The workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include: Fetching and comparing files to avoid duplicate processing. Handling file downloads and extracting content based on the file type. Converting documents into vectorized data for contextual information retrieval. Storing and querying vectorized data from a Supabase vector store. File Extraction and Processing: Automates handling of multiple file formats (e.g., PDFs, text files), and extracts document content. Vectorized Embeddings Creation: Generates embeddings for processed data to enable AI-driven interactions. Dynamic Data Querying: Allows users to query their document repository conversationally using a chatbot. Setup N8N Workflow Fetch File List from Supabase: Use Supabase to retrieve the stored file list from a specified bucket. Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing. Compare and Filter Files: Aggregate the files retrieved from storage and compare them to the existing list in the Supabase files table. Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled. Handle File Downloads: Download new files using detailed storage configurations for public/private access. Adjust the storage settings and GET requests to match your Supabase setup. File Type Processing: Use a Switch node to target specific file types (e.g., PDFs or text files). Employ relevant tools to process the content: For PDFs, extract embedded content. For text files, directly process the text data. Content Chunking: Break large text data into smaller chunks using the Text Splitter node. Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks. Vector Embedding Creation: Generate vectorized embeddings for the processed content using OpenAI's embedding tools. Ensure metadata, such as file ID, is included for easy data retrieval. Store Vectorized Data: Save the vectorized information into a dedicated Supabase vector store. Use the default schema and table provided by Supabase for seamless setup. AI Chatbot Integration: Add a chatbot node to handle user input and retrieve relevant document chunks. Use metadata like file ID for targeted queries, especially when multiple documents are involved. Testing Upload sample files to your Supabase bucket. Verify if files are processed and stored successfully in the vector store. Ask simple conversational questions about your documents using the chatbot (e.g., "What does Chapter 1 say about the Roman Empire?"). Test for accuracy and contextual relevance of retrieved results.
by Daniel Nolde
What it is: An automation to plan→draft→finalize and publish your textual blog post ideas to your wordpress blog Works in stages and hand back control to you in between those You can use a Google Spreadsheet for planning topics and configuring LLM models and prompts What it does: plans→drafts→finalizes blog post topics you specify in a Google Spreadsheet using an LLM with prompts that also ar configured in that spreadsheet (even which model to use) savs the results in the corresponding columns of the "Schedule" sheet in the spreadsheet hands control back to the user for inspecting or changing the results and for setting the next "Action" for th workflow Finally publishes the blog post to your Wordpress instance Limitations Probably slightly over-engineered ;-) No media generation yet some LLM models don't work because of their output format How it works: The Workflow is triggered manually or scheduled every hour It ingests a Google Spreadsheet to get Config for prompts/context tc Blog-Topics and their status and next action Depending on each blog topics "Status" and "Action" it then either uses an LLM for th next action ("plan"→"draft"→"final" actions) or publishes the written content to your Wordpress instance ("publish" actions) Set up steps: Import the workflow Make your own copy of the Google Spreadsheet Update the credentials using your individual credentials for: Google Spreadsheets OpenRouter Edit the "Settings" node and enter your individual values for Your spreadsheet copy URL Your wordpress blog URL Your wordpress blog username Your wordpress blog app password (a 4x4 alphanumeric sequence), that you probably have to create first, for which your wordpress user has to have 2-factor-authentication enabled. In your own copy of the spreadsheet: individualize the "Config" sheet's "Value" column for the prompts/context/etc Populate the "Schedule" sheet with at least one line in which you specify a "Topic" a "Schedulded" date (YYYY-MM-DD HH:mm:ss) a "Status" of "idea" an "Action" of "plan" (to kick off that action)
by Mark Shcherbakov
Video Guide I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows. Youtube Link Who is this for? This workflow is designed for developers, data scientists, and business users who wish to automate document management and enable AI-powered interactions over their stored files. It's especially beneficial for scenarios where users need to process, analyze, and retrieve information from uploaded documents rapidly. What problem does this workflow solve? Managing files across multiple platforms often involves tedious manual processes. This workflow facilitates automated file handling, making it easier for users to upload, parse, and interact with documents through an AI agent. It reduces redundancy and enhances the efficiency of data retrieval and management tasks. What this workflow does This workflow integrates Supabase storage with Google Drive and employs an AI agent to manage files effectively. The agent can: Upload files to Supabase storage and activate processes based on file changes in Google Drive. Retrieve and parse documents, converting them into a structured format for easy querying. Utilize an AI agent to answer user queries based on saved document data. Data Collection: The workflow initially gathers files from Supabase storage, ensuring no duplicates are processed in the 'files' table. File Handling: It processes files to be parsed based on their type, leveraging LlamaParse for effective data transformation. Google Drive Integration: The workflow monitors a designated Google Drive folder to upload files automatically and refresh document records in the database with new data. AI Interaction: A webhook is established to enable the AI agent to converse with users, facilitating queries and leveraging stored document knowledge. Setup Supabase Storage Setup: Create a private bucket in Supabase storage, modifying the default name in the URL. Upload your files using the provided upload options. Database Configuration: Establish the 'file' and 'document' tables in Supabase with the necessary fields. Execute any required SQL queries for enabling vector matching features. N8N Workflow Logic: Start with a manual trigger for the initial workflow segment or consider alternative triggers like webhooks. Replace all relevant credentials across nodes with your own to ensure seamless operation. File Processing and Google Drive Monitoring: Set up file processing to take care of downloading and parsing files based on their types. Create triggers to monitor the designated Google Drive folder for file uploads and updates. Integrate AI Agent: Configure the webhook for the AI agent to accept chat inputs while maintaining session context for enhanced user interactions. Utilize PostgreSQL to store user interactions and manage conversation states effectively. Testing and Adjustments: Once everything is set up, run tests with the AI agent to validate its responses based on the documents in your database. Fine-tune the workflow and AI model as needed to achieve desired performance.
by Mateusz Kosiorek
AI powered content creation and WordPress publishing workflow Summary This workflow automates the entire process of blog content creation, from idea generation and article writing using Google Gemini, to sourcing images from Pexels and publishing directly to your WordPress site. It uses Google Sheets as a central hub for managing content ideas and tracking their status, all orchestrated through interactive n8n forms. Key features AI driven content:** Leverages Google Gemini for generating: Full blog articles based on prompts. Relevant keywords for image searching. New blog topic ideas. Automated image sourcing:** Searches Pexels for suitable images based on AI generated keywords and downloads them. WordPress integration:** Creates new posts with AI generated title and content. Uploads sourced images to the WordPress media library. Sets the uploaded image as the featured image for the post. Google Sheets management:** Fetches content ideas (prompts) marked as "not generated". Updates the sheet after a post is generated with the post ID, title, and generation date. Adds newly AI generated blog topic ideas to the sheet. Interactive forms:** Main trigger form to choose between generating content or adding new ideas. Forms to input topics for idea generation. Confirmation forms at the end of processes. Structured output parsing:** Ensures AI responses for topic generation are correctly formatted as JSON. How it works The workflow is initiated via an n8n Form Trigger: Select Action, allowing the user to choose one of two main paths: 1. Generate content path: Fetch idea: The Fetch unprocessed ideas (Google Sheets) node retrieves a row from your sheet where the "Generated" column is "no". Set prompt: The Set prompt node prepares the topic from the sheet for the AI. Generate article: The Generate article AI (Langchain Agent with Google Gemini) node takes the prompt and writes a full article. Generate image keyword: The Generate image keyword AI (Langchain Agent with Google Gemini) node creates a concise search term based on the article topic. Search image: The Search Pexels image (HTTP Request) node uses the generated keyword to find a relevant image via the Pexels API. Create WordPress post: The Create WordPress post node publishes the AI generated article and initial image metadata to your WordPress site. Download and upload image: The Download Pexels image (HTTP Request) node fetches the actual image file, and the Upload image (HTTP Request) node uploads it to your WordPress media library. Set featured image: The Set featured image (HTTP Request) node links the uploaded image as the featured image for the newly created post. Update sheet: The Update Google Sheet node marks the idea as "yes" in your Google Sheet and adds the WordPress post ID and title. Confirmation: A Form: End post generation node displays a completion message. 2. Add ideas path: Input topic: The Form: Enter topic for ideas node prompts the user to enter a general subject. Generate topics: The Generate blog topics AI (Langchain Agent with Google Gemini and Structured Output Parser) node generates five SEO friendly blog topic ideas based on the user's input, formatted as JSON. Process topics: The Split topics node separates the generated list of topics into individual items. Add to sheet: For each topic, the Add ideas to sheet (Google Sheets) node appends it as a new row, marked with "Generated: no". Loop or end: The Form: Add more topics? node asks the user if they want to generate more ideas or end the process. If "NEXT", it loops back to the Form: Enter topic for ideas. If "END", a Form: End idea generation node displays a completion message with the list of added topics. Nodes used Form Trigger If Google Sheets Set Langchain Agent (with Google Gemini Chat Model) Structured Output Parser (Langchain) HTTP Request (for Pexels API and WordPress Media/Post updates) WordPress Split Out Form (for user interaction and completion messages) Sticky Note (for instructions within the workflow) Setup instructions Credentials: Google Sheets: Configure your Google Sheets OAuth2 credentials in the Fetch unprocessed ideas, Update Google Sheet, and Add ideas to sheet nodes. WordPress: Configure your WordPress API credentials in the Create WordPress post, Upload image, and Set featured image nodes. Google Gemini: Configure your Google Gemini (PaLM) API key in the Gemini model for article, Gemini model for image keyword, and Gemini model for topics nodes. API keys and URLs: Pexels: In the Search Pexels image node, replace <YOUR_PEXELS_API_KEY> in the Authorization header with your actual Pexels API key. WordPress URL: In the Upload image and Set featured image nodes, replace <YOUR_WORDPRESS_URL> in the URL field with your WordPress site's domain (e.g., yourblog.com). Google Sheet configuration: Ensure your Google Sheet (specified by Document ID in Google Sheets nodes) has a sheet named Sheet1 (or update the Sheet Name parameter). The sheet should have at least the following columns: Prompt (for the blog idea/topic), Generated (to track status, e.g., "no" or "yes"), row_number (automatically populated by n8n when reading), Date, Title (for the final WordPress post title), Post ID. Activate the workflow. The Form Trigger: Select Action will provide a webhook URL to initiate the process. Customization ideas Modify the AI prompts in the Langchain Agent nodes for different tones, styles, or content structures. Change the Google Gemini models used for different cost/performance balances. Integrate other image sources instead of or in addition to Pexels. Add steps for social media sharing after a post is published. Extend the Google Sheet to track more metrics like word count or target keywords. Implement more sophisticated error handling. Use cases Automating blog content generation for personal or company blogs. Streamlining content marketing efforts. Quickly populating new websites with initial content. Assisting SEO agencies in creating draft content for clients. Helping solo bloggers maintain a consistent publishing schedule.
by Ozgur Karateke
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) 📝 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. 🎯 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. 🗣 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. ✅ Final Confirmation The bot summarizes the inputs → when the user clicks Confirm, the DocProcess sub-workflow starts. ⚙️ 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 | 📎 Delivery The master agent sends 🔗 Download PDF & ✏️ Open Google Doc links. 🚫 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 {{UPPER_CASE}} | No Turkish chars or spaces | | 3 | Wrap optional clauses with [[BLOCK_NAME:START]]…[[BLOCK_NAME:END]] | The START tag must have a blank line above | | 4 | Add a META_JSON 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) = <TEMPLATE_PARENT_ID> > > > We’ll paste this into the TemplateList node next. > Simple sample template → Template Link 🛠 B. Import the Workflow into n8n Settings ▸ Import Workflow ▸ DocAgent.json If nodes look Broken afterwards → no community-node problem; you only need to select credentials. 📑 C. Customize the TemplateList Node Open Template List node ⚙️ → replace '%3CYOUR_PARENT_ID%3E' in parents with the real folder ID in the URL. Right-click node > Execute Node. Copy the entire JSON response. 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. https://script.google.com/macros/s/ABC123/exec) | If this URL changes, update n8n | Apps Script source code → Notion Link 🔧 E. Wire the Script URL in n8n | Node | Field | Action | | --- | --- | --- | | GetMetaData | URL | <WEB_APP_URL>?mode=meta&id={{ $json["id"] }} | | FillDocument | URL | <WEB_APP_URL> | > 💡 Prefer using an .env file? Add GAS_WEBAPP_URL=… and reference it as {{ $env.GAS_WEBAPP_URL }}. > 🔐 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) Switch the workflow Active. In the chat panel type /start. Bot lists templates → pick one. Fill mandatory fields, optionally toggle blocks → Confirm. 🔗 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 (UPPER_CASE ASCII) | | Template ID not found | Prompt list is old | Rerun TemplateList → update both prompts | | Cannot find META_JSON | No meta block / wrong tag | Add [[META_JSON_START]] … [[META_JSON_END]], 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