AutomationFlowsAI & RAG › Generate Linkedin Posts Using Google Gemini, Mongodb Atlas, Google Drive and…

Generate Linkedin Posts Using Google Gemini, Mongodb Atlas, Google Drive and…

Original n8n title: Generate Linkedin Posts Using Google Gemini, Mongodb Atlas, Google Drive and Sheets

ByNitesh @niteshdk11 on n8n.io

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

Event trigger★★★★☆ complexityAI-powered18 nodesVector Store Mongo DbatlasAgentGoogle Gemini EmbeddingsGoogle Gemini ChatDocument Default Data LoaderGoogle DriveGoogle Drive TriggerChat Trigger
AI & RAG Trigger: Event Nodes: 18 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13782 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "c3704437-9960-470b-be03-69b769e0b450",
      "name": "Sticky Note: Ingestion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        448
      ],
      "parameters": {
        "width": 400,
        "height": 260,
        "content": "### 1. DATA INGESTION PHASE\nThis section watches a Google Drive folder for new post examples (CSV). When a file is updated, it automatically embeds the text and stores it in MongoDB Atlas for long-term memory."
      },
      "typeVersion": 1
    },
    {
      "id": "1e843974-b012-42ca-9051-5f5218b72c98",
      "name": "Sticky Note: Vector",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        400
      ],
      "parameters": {
        "width": 380,
        "height": 260,
        "content": "### 2. METHOD A: VECTOR SEARCH\nThis agent uses Semantic Search. It finds posts that are *thematically* similar to your prompt, even if they don't share the same keywords. Best for matching 'Vibe' and 'Tone'."
      },
      "typeVersion": 1
    },
    {
      "id": "0a23b11e-dd30-488e-92cf-242ed7ecdfab",
      "name": "Sticky Note: Sheets",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        448
      ],
      "parameters": {
        "width": 380,
        "height": 260,
        "content": "### 3. METHOD B: DIRECT SHEET TOOL\nThis agent has a direct line to your Google Sheet. It can pull specific rows or data points, ensuring 100% accuracy from your spreadsheet source."
      },
      "typeVersion": 1
    },
    {
      "id": "3578ec95-a96f-45b0-a300-8bf548779637",
      "name": "MongoDB Vector Store Inserter",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        -1872,
        656
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_rag_data",
          "cachedResultName": "n8n_rag_data"
        },
        "vectorIndexName": "data_index"
      },
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b5f3fa2c-315f-4858-ac92-49b84dbfebc5",
      "name": "MongoDB Vector Search",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        -1040,
        784
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "toolName": "n8n_rag",
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_rag_data",
          "cachedResultName": "n8n_rag_data"
        },
        "toolDescription": "retreive documentation",
        "vectorIndexName": "data_index"
      },
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "560b4782-fbd9-4c12-8883-01a2e14f0fb6",
      "name": "Knowledge Base Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1296,
        592
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a senior LinkedIn content strategist... (System prompt truncated for brevity)"
        }
      },
      "typeVersion": 1.9
    },
    {
      "id": "5282a1f2-3899-4124-82f5-fbb0f2f1f6cc",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -1856,
        880
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a6271ae8-9228-4007-944a-ba6a67a8ddfa",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1360,
        864
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "613b72b6-ad68-4b89-af1d-6a37353d3919",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -1728,
        880
      ],
      "parameters": {
        "options": {},
        "dataType": "binary",
        "binaryMode": "specificField"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c7ac7c3e-878a-49cd-b134-88ef7938f04b",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -2096,
        656
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "00878485-4242-4b67-92ef-21a9c0c92740",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -2320,
        656
      ],
      "parameters": {
        "event": "fileUpdated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1Yabi9e0BkBarkD945Yk_3WQQl-c7BgKX"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3988fa5-66bb-423a-a667-4346a2b23356",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -656,
        624
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.4
    },
    {
      "id": "c643af0e-5aa8-40be-971b-c819d6c458e9",
      "name": "Embeddings Google Gemini1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -1088,
        976
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "47ec6512-7b51-4dfe-8b60-242f66c01a69",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1184,
        832
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "4cb99463-37aa-4d61-a5b8-0c0bed6f2b8e",
      "name": "Knowledge Base Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -256,
        672
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an expert LinkedIn ghostwriter... (System prompt truncated)"
        }
      },
      "typeVersion": 1.9
    },
    {
      "id": "1cc62e89-8cce-4463-85b5-ca797ae0826f",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -320,
        848
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "13205b10-c807-400a-bd87-43b075680f53",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -192,
        896
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "98927dac-609f-44b5-9dba-931b089d75d7",
      "name": "Google Sheets Tool",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        0,
        880
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1F5u5F3Bsgzs-xS9HrUlluQ9xb-PBDC6RbPfJRDZHOsk"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "connections": {
    "Download file": {
      "main": [
        [
          {
            "node": "MongoDB Vector Store Inserter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Knowledge Base Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Knowledge Base Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Tool": {
      "ai_tool": [
        [
          {
            "node": "Knowledge Base Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "MongoDB Vector Store Inserter",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Vector Search": {
      "ai_tool": [
        [
          {
            "node": "Knowledge Base Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "MongoDB Vector Store Inserter",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Knowledge Base Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini1": {
      "ai_embedding": [
        [
          {
            "node": "MongoDB Vector Search",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Knowledge Base Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Knowledge Base Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

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

Source: https://n8n.io/workflows/13782/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Chat with docs - 5minAI New version. Uses httpRequest, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Event-driven trigger; 62 nodes.

HTTP Request, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +10
AI & RAG

I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows.

HTTP Request, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +10
AI & RAG

🤖 AI Powered RAG Chatbot for Your Docs + Google Drive + Gemini + Qdrant. Uses documentDefaultDataLoader, textSplitterTokenSplitter, vectorStoreQdrant, splitInBatches. Event-driven trigger; 50 nodes.

Document Default Data Loader, Text Splitter Token Splitter, Qdrant Vector Store +10
AI & RAG

This workflow creates a powerful RAG (Retrieval-Augmented Generation) chatbot that can process, store, and interact with documents from Google Drive using Qdrant vector storage and Google's Gemini AI.

Document Default Data Loader, Text Splitter Token Splitter, Qdrant Vector Store +10
AI & RAG

This template is a complete, hands-on tutorial for building a RAG (Retrieval-Augmented Generation) pipeline. In simple terms, you'll teach an AI to become an expert on a specific topic—in this case, t

Memory Buffer Window, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +7