Skip to main content

Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets

Workflow preview

Workflow preview
100%
Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets preview
Open on n8n.io

1. Workflow Overview

How the System Works This automation operates in three distinct phases: Ingestion , Storage , and Generation . Phase Component What Happens 1. The Trigger Google Drive Ever...

Best for

  • Content Creation automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.vectorstoremongodbatlas, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.embeddingsgooglegemini, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.documentdefaultdataloader, n8n-nodes-base.googledrive, n8n-nodes-base.googledrivetrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Nitesh.

Original n8n.io source

1.1 Workflow description

Title
Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets
Workflow name
Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets

🚀 How the System Works

This automation operates in three distinct phases: Ingestion, Storage, and Generation.

Phase Component What Happens
1. The Trigger Google Drive Every time you update your rag_posts.csv in your Drive folder, the system wakes up.
2. The Brain Gemini Embeddings It turns your text into "Vectors" (numbers) so the AI understands the meaning of your writing style, not just the words.
3. The Vault MongoDB Atlas Your posts are stored in a vector database, acting as a "Style Library" the AI can browse instantly.
4. The Writer AI Agents When you ask for a post, the AI searches your vault, finds the best matches, and mimics the formatting exactly.

🛠️ Step-by-Step Setup Guide

1. Prepare Your Data Source

  • Create a Google Drive Folder and note its ID (the long string of characters in the URL).
  • Create a CSV file named rag_posts.csv.
  • Columns needed: Post Text, Hook Type, Engagement, Category.
  • Upload it to that folder.

2. Configure MongoDB Atlas (The Vector Store)

  • Sign up for a free MongoDB Atlas account.
  • Create a Cluster and a Database named n8n_rag_data.
  • Crucial Step: Create an Atlas Vector Search Index on your collection.
  • Name the index data_index.

3. Google Gemini API

  • Go to the Google AI Studio.
  • Generate an API Key. This will power both the "Embeddings" (understanding the text) and the "Chat" (writing the post).

4. Connect the n8n Nodes

  • Google Drive Trigger: Paste your Folder ID and select fileUpdated.
  • MongoDB Nodes: Enter your Connection String (SRV) and credentials.
  • Gemini Nodes: Paste your API Key into the Credentials section.
  • Google Sheets Tool: Link your specific spreadsheet ID so the "Knowledge Base Agent 1" can read specific rows.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note: Ingestion

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note: Vector

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note: Sheets

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - MongoDB Vector Store Inserter

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas - vectorStoreMongoDBAtlas
Config choices
Version 1.1

Block 5 - MongoDB Vector Search

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas - vectorStoreMongoDBAtlas
Config choices
Version 1.1

Block 6 - Knowledge Base Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 7 - Embeddings Google Gemini

Type / Role
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - embeddingsGoogleGemini
Config choices
Version 1

Block 8 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 9 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 10 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 11 - Google Drive Trigger

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 12 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 13 - Embeddings Google Gemini1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - embeddingsGoogleGemini
Config choices
Version 1

Block 14 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 15 - Knowledge Base Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 16 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 17 - Simple Memory1

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 18 - Google Sheets Tool

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

3. Summary Table

Workflow Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets
Complexity advanced
Nodes 18
Categories Content Creation, AI RAG
Author Nitesh
Published 01 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13782/13782.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate LinkedIn posts using Google Gemini, MongoDB Atlas, Google Drive and Sheets do?

How the System Works This automation operates in three distinct phases: Ingestion , Storage , and Generation . Phase Component What Happens 1. The Trigger Google Drive Ever...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI RAG use case.