AutomationFlowsAI & RAG › Post Daily Motivational Tweets to Twitter/x with Google Gemini AI

Post Daily Motivational Tweets to Twitter/x with Google Gemini AI

ByMuhammad Tauqeer Aslam @tauqeer786 on n8n.io

This n8n template demonstrates how to use AI to automatically generate and post content to Twitter/X on a schedule. It combines AI-generated text with workflow automation to help creators and businesses stay consistent on social media without manual posting.

Cron / scheduled trigger★★★★☆ complexityAI-powered12 nodesTwitterGoogle Gemini ChatChain Llm
AI & RAG Trigger: Cron / scheduled Nodes: 12 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Chainllm → 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
{
  "id": "Q6ZNayFnmOka43AY",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Daily Motivational Tweets",
  "tags": [],
  "nodes": [
    {
      "id": "9c7637cb-90aa-4967-9aac-9555fcf9a778",
      "name": "Parse Quotes",
      "type": "n8n-nodes-base.function",
      "position": [
        -624,
        32
      ],
      "parameters": {
        "functionCode": "// Get the raw text from LLM Chain\nlet output = items[0].json.text;\n\nif (!output) {\n  throw new Error(\"No output from LLM Chain. Check your Gemini node.\");\n}\n\n// Remove Markdown-style ```json ... ``` if present\noutput = output.replace(/```json\\s*|\\s*```/g, '').trim();\n\n// Parse the JSON array\nconst quotes = JSON.parse(output);\n\n// Return each quote as a separate item\nreturn quotes.map(q => ({\n  json: { quote: q.trim() }\n}));\n"
      },
      "typeVersion": 1
    },
    {
      "id": "45218bea-1692-4f76-a982-bc9efa1709cf",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.function",
      "position": [
        -464,
        32
      ],
      "parameters": {
        "functionCode": "const posted = new Set(items.map(i => i.json.value));\nreturn $items(\"Parse Quotes\").filter(i => !posted.has(i.json.quote));"
      },
      "typeVersion": 1
    },
    {
      "id": "422f9f79-0070-4f55-8240-7b2edd32549f",
      "name": "Wait Between Tweets",
      "type": "n8n-nodes-base.wait",
      "position": [
        176,
        144
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "024b8525-a23e-4c37-9f1d-5409e6039e5c",
      "name": "Post Tweet",
      "type": "n8n-nodes-base.twitter",
      "position": [
        0,
        144
      ],
      "parameters": {
        "text": "={{$json.quote}} ",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "aeeb7984-7c96-4f4c-8a94-21aabbb14a5e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -992,
        224
      ],
      "parameters": {
        "options": {
          "topP": 0.8
        }
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1ce7c940-9316-484c-be56-28a2ebde683b",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1184,
        32
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c26e7bf5-9076-4400-a060-4b526cd5a437",
      "name": "Generate Quotes",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -992,
        32
      ],
      "parameters": {
        "text": "Generate exactly 3 pieces of motivational content for Twitter/X.\n\nEach of the 3 outputs must be DIFFERENT in both style and length:\n\n1\ufe0f\u20e3 One very short, punchy line (under 80 characters)\n2\ufe0f\u20e3 One medium-length motivational thought (120\u2013180 characters)\n3\ufe0f\u20e3 One slightly longer reflective or action-driven message (180\u2013220 characters)\n\nRules:\n- Use simple, human language\n- Sound authentic and emotionally engaging\n- Avoid clich\u00e9s and overused phrases\n- No hashtags, no emojis\n- No quotation marks\n- No markdown\n- No lists or numbering in the output text\n- Each item must feel distinct in tone (e.g. bold, reflective, encouraging)\n\nFormat:\nReturn ONLY a valid JSON array of strings.\nNo explanations.\n",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "8cce527e-afad-4243-a157-20352355e55c",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -176,
        32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "4546eaf9-9d09-4b39-a947-7d3117b78bc0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -240
      ],
      "parameters": {
        "width": 480,
        "height": 688,
        "content": "## Daily Motivational Tweets (Gemini + LLM Chain)\n\nThis workflow automatically generates and posts 3 motivational quotes daily on Twitter/X using Google Gemini AI. It is ideal for content creators, solopreneurs, or anyone wanting to maintain a consistent social media presence with minimal effort.\n\n### How it works\n- Triggers daily using a schedule node.\n- Uses Gemini AI to generate 3 unique motivational quotes.\n- Parses the AI output into separate tweets.\n- Posts each quote to Twitter/X with a configurable delay (via Loop Over Items and Wait node).\n\n### Setup steps\n1. Connect your **Google Gemini API key** to the Gemini Chat Model node.\n2. Connect your **Twitter/X account** to the Post Tweet node.\n3. Adjust the **Cron node** for the first posting time and the **Wait node** for spacing between tweets.\n\n### Customization\n- Change the prompt to generate different quote styles or lengths.\n- Adjust the Loop and Wait settings for different posting intervals.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bcadfcc5-5fb3-4ab5-ad95-790247a4c3da",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 480,
        "content": "## 1. Quote Generation\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5b1af05c-68c2-40b0-96c0-91971d833ac9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 480,
        "content": "## 2. Data Processing\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ccbb3cde-d755-4d25-9c62-fa7e95c10202",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 480,
        "content": "## 3. Tweet Posting\n"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1d006651-25a0-47a7-97c3-7a468b4e8a65",
  "connections": {
    "Post Tweet": {
      "main": [
        [
          {
            "node": "Wait Between Tweets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Quotes": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Quotes": {
      "main": [
        [
          {
            "node": "Parse Quotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Post Tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Generate Quotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Between Tweets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Quotes",
            "type": "ai_languageModel",
            "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 n8n template demonstrates how to use AI to automatically generate and post content to Twitter/X on a schedule. It combines AI-generated text with workflow automation to help creators and businesses stay consistent on social media without manual posting.

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

Transform your festival marketing with this comprehensive automation workflow that creates and posts culturally authentic social media content across multiple platforms daily.

Google Sheets, Output Parser Structured, Chain Llm +5
AI & RAG

Automatically scan major financial newswires for biotech catalyst events, score them with AI sentiment analysis, and surface ranked trade candidates — all without manual monitoring.

RSS Feed Read, Data Table, HTTP Request +4
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

Who Is This For?

Telegram, Google Sheets Trigger, Lm Chat Mistral Cloud +17
AI & RAG

Ultimate Blogblizt is a powerhouse workflow that solves the tedious task of crafting and publishing SEO-optimized tech blog posts. It integrates AI models (OpenAI, Google Gemini), WordPress, and multi

Chain Llm, Telegram Trigger, OpenAI Chat +10