AutomationFlowsAI & RAG › Auto-generate and Post Tweet Threads Based on Google Trends Using Gemini AI

Auto-generate and Post Tweet Threads Based on Google Trends Using Gemini AI

ByAmjid Ali @amjid on n8n.io

This template is designed for: Content creators Tech influencers Educators and marketers who want to automatically tweet trend-based threads using AI and stay relevant without spending time on manual research and content writing.

Cron / scheduled trigger★★★★☆ complexityAI-powered21 nodesTwitterMemory Buffer WindowGoogle Gemini ChatOutput Parser AutofixingOutput Parser StructuredOpenAI ChatAgentGoogle BigQuery
AI & RAG Trigger: Cron / scheduled Nodes: 21 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Google Gemini Chat 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e10711db-583a-4a73-adea-8aeef68a8456",
      "name": "X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        2240,
        520
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2efd476e-bea4-4828-bc8c-c1491a408646",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        420,
        840
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "7933cf3b-7319-4d55-919b-a9852cc2855b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        200,
        860
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0f981a60-1f9b-4e36-b113-950a6177e1ba",
      "name": "Auto-fixing Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        600,
        640
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2c0e008a-e481-47d1-b07f-ded9cffa61f1",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        800,
        880
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "fa0194e7-77d7-48be-aef5-2f8325acf278",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -280,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1ed80dbc-d7ec-45ec-97ec-cd281ac409dc",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        600,
        860
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "f7c657aa-7c9e-4a74-aa39-135bcea2348b",
      "name": "Trend Selector",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        400,
        380
      ],
      "parameters": {},
      "typeVersion": 1.9,
      "alwaysOutputData": false
    },
    {
      "id": "21ee7af9-5a90-4ef1-99f5-41d175847143",
      "name": "Tweet Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1240,
        380
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "4a9a81fb-1233-4c62-87f0-acea3ee1437a",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1140,
        740
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2a5789a8-b5a8-46b1-8665-ad22473b803d",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1620,
        500
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "98356e89-3436-47c9-b604-e9775dc53c29",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1980,
        500
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "6a6f6a88-0f73-458d-bce2-881f3f5902f6",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2560,
        520
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "288e8945-82b7-4f7e-9bb8-cda7235bac62",
      "name": "Google Trends AUS",
      "type": "n8n-nodes-base.googleBigQuery",
      "position": [
        -300,
        460
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "2045aa98-f272-451a-95bb-79a169e5b5fc",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1060,
        780
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2e9e885e-91ae-4d44-8d1c-1f30560451ec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1500,
        600
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c72f2bd8-2307-4e3d-bfd2-655c07816c9f",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1500,
        60
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6ccbc315-5c53-4fea-b2d7-30fc99fd606e",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6a089814-9049-45a6-a9d8-e51f0fe0b77c",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d486f77b-989e-4aca-9655-92342333e46f",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1000,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e8a61916-59fe-4aaa-b39d-99fa682e3064",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "X": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Trend Selector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Trend Selector",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Trend Selector": {
      "main": [
        [
          {
            "node": "Tweet Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "X",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tweet Generator": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Trends AUS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Trends AUS": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Trend Selector",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Trend Selector",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Tweet Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

This template is designed for: Content creators Tech influencers Educators and marketers who want to automatically tweet trend-based threads using AI and stay relevant without spending time on manual research and content writing.

Source: https://n8n.io/workflows/3978/ — 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

This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty

Telegram, Google Sheets Trigger, Agent +26
AI & RAG

This workflow was born out of a very real problem.

Output Parser Structured, OpenAI Chat, Memory Buffer Window +11
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14
AI & RAG

This workflow automatically monitors marketing job boards to identify growing companies and potential business opportunities. It saves you time by eliminating the need to manually check job listings a

N8N Nodes Mcp, Agent, OpenAI Chat +4
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Mailgun, OpenAI, OpenAI Chat +8