{"workflow":{"id":12881,"name":"Post daily motivational tweets to Twitter/X with Google Gemini AI","views":174,"recentViews":0,"totalViews":174,"createdAt":"2026-01-21T18:21:01.857Z","description":"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.\n\nUse cases include posting motivational quotes, daily tips, brand updates, announcements, or any short-form text content. The workflow is flexible and can be easily customized to fit different tones, niches, and posting frequencies.\n\n## Good to know\n\n* This workflow uses an AI text model, so usage may incur costs depending on your provider’s pricing.\n\n* Rate limits apply when posting to Twitter/X. Posting frequency should be kept within platform guidelines.\n\n* The template uses official n8n nodes and is compatible with n8n Cloud.\n\n## How it works\n\n* The workflow is triggered on a schedule using a schedule trigger.\n\n* An AI model generates multiple pieces of tweet-ready text in a single run.\n\n* The generated content is processed and split into individual tweets.\n\n* Tweets are posted one by one with a configurable delay between each post.\n\n## How to use\n\n* Replace the trigger if needed (for example, use a webhook instead of a schedule).\n\n* Adjust the AI prompt to control tone, topic, or length of tweets.\n\n* Modify the delay to control how often tweets are posted.\n\n## Requirements\n\n* An AI provider account (for example, Google Gemini)\n\n* A connected Twitter/X account\n\n## Customizing this workflow\n\nThis template can be adapted for many use cases, such as posting educational threads, curated content, or scheduled announcements. You can also extend it to support other platforms like LinkedIn or Threads with minimal changes.","workflow":{"id":"Q6ZNayFnmOka43AY","meta":{"instanceId":"99e293a7810a79f1ee0e601c52f535055b45d0b11a39f49e1e80a702ed477c5b","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],"webhookId":"a414b5de-26a4-4487-b08b-504e15b35c8b","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":{"id":"TLRbFnxRHgwLFuHu","name":"X account"}},"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":{"id":"HguTQIWY1C9qT3eH","name":"Google Gemini(PaLM) Api account"}},"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️⃣ One very short, punchy line (under 80 characters)\n2️⃣ One medium-length motivational thought (120–180 characters)\n3️⃣ One slightly longer reflective or action-driven message (180–220 characters)\n\nRules:\n- Use simple, human language\n- Sound authentic and emotionally engaging\n- Avoid clichés 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,"pinData":{},"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}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":12,"nodeTypes":{"n8n-nodes-base.wait":{"count":1},"n8n-nodes-base.twitter":{"count":1},"n8n-nodes-base.function":{"count":2},"n8n-nodes-base.stickyNote":{"count":4},"n8n-nodes-base.splitInBatches":{"count":1},"n8n-nodes-base.scheduleTrigger":{"count":1},"@n8n/n8n-nodes-langchain.chainLlm":{"count":1},"@n8n/n8n-nodes-langchain.lmChatGoogleGemini":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"Muhammad Tauqeer Aslam","username":"tauqeer786","bio":"Agentic AI developer","verified":false,"links":[""],"avatar":"https://gravatar.com/avatar/19851c3678bbb48347c123711908c564de99ae8bdcd79beb3ac2b3b525111774?r=pg&d=retro&size=200"},"nodes":[{"id":14,"icon":"fa:code","name":"n8n-nodes-base.function","codex":{"data":{"alias":["Code","Javascript","Custom Code","Script","cpde"],"details":"The Function node allows you to execute JavaScript in your workflow. Unlike the Function Item node, this node does not operate on incoming node data per-item. Instead, you must iterate over multiple items of incoming data yourself. This can be useful if you're performing data transformation where you want to manipulate the number of items being outputted by the node (i.e. 1 item is inputted in with nested object, 10 items are outputted without any nested objects)","resources":{"generic":[{"url":"https://n8n.io/blog/2021-goals-level-up-your-vocabulary-with-vonage-and-n8n/","icon":"🎯","label":"2021 Goals: Level Up Your Vocabulary With Vonage and n8n"},{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/why-i-chose-n8n-over-zapier-in-2020/","icon":"😍","label":"Why I chose n8n over Zapier in 2020"},{"url":"https://n8n.io/blog/how-to-host-virtual-coffee-breaks-with-n8n/","icon":"☕️","label":"How to host virtual coffee breaks with n8n"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/database-monitoring-and-alerting-with-n8n/","icon":"📡","label":"Database Monitoring and Alerting with n8n"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/creating-triggers-for-n8n-workflows-using-polling/","icon":"⏲","label":"Creating triggers for n8n workflows using polling"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/how-to-automatically-give-kudos-to-contributors-with-github-slack-and-n8n/","icon":"👏","label":"How to automatically give kudos to contributors with GitHub, Slack, and n8n"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/tracking-time-spent-in-meetings-with-google-calendar-twilio-and-n8n/","icon":"🗓","label":"Tracking Time Spent in Meetings With Google Calendar, Twilio, and n8n"},{"url":"https://n8n.io/blog/creating-error-workflows-in-n8n/","icon":"🌪","label":"Creating Error Workflows in n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Function","color":"#FF9922"},"iconData":{"icon":"code","type":"icon"},"displayName":"Function","typeVersion":1,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":39,"icon":"fa:sync","name":"n8n-nodes-base.splitInBatches","codex":{"data":{"alias":["Loop","Concatenate","Batch","Split","Split In Batches"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Loop Over Items","color":"#007755"},"iconData":{"icon":"sync","type":"icon"},"displayName":"Loop Over Items (Split in Batches)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":325,"icon":"file:x.svg","name":"n8n-nodes-base.twitter","codex":{"data":{"alias":["Tweet","Twitter","X","X API"],"resources":{"generic":[{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.twitter/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/twitter/"}]},"categories":["Marketing"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"output\"]","defaults":{"name":"X"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzLjMxNzEgMTYuOTM3M0wzNy45MDI2IDBIMzQuNDQ2M0wyMS43ODE3IDE0LjcwNjRMMTEuNjY2NiAwSDBMMTUuMjk2MSAyMi4yMzg3TDAgNDBIMy40NTY0OEwxNi44MzA2IDI0LjQ2OTZMMjcuNTEyOSA0MEgzOS4xNzk1TDIzLjMxNjMgMTYuOTM3M0gyMy4zMTcxWk0xOC41ODMgMjIuNDM0NkwxNy4wMzMyIDIwLjIyMDFMNC43MDE5IDIuNTk5MzZIMTAuMDEwOEwxOS45NjIzIDE2LjgxOTlMMjEuNTEyMiAxOS4wMzQ0TDM0LjQ0NzkgMzcuNTE4OUgyOS4xMzlMMTguNTgzIDIyLjQzNTRWMjIuNDM0NloiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo="},"displayName":"X (Formerly Twitter)","typeVersion":2,"nodeCategories":[{"id":27,"name":"Marketing"}]},{"id":514,"icon":"fa:pause-circle","name":"n8n-nodes-base.wait","codex":{"data":{"alias":["pause","sleep","delay","timeout"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Wait","color":"#804050"},"iconData":{"icon":"pause-circle","type":"icon"},"displayName":"Wait","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":839,"icon":"fa:clock","name":"n8n-nodes-base.scheduleTrigger","codex":{"data":{"alias":["Time","Scheduler","Polling","Cron","Interval"],"resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"trigger\",\"schedule\"]","defaults":{"name":"Schedule Trigger","color":"#31C49F"},"iconData":{"icon":"clock","type":"icon"},"displayName":"Schedule Trigger","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":1123,"icon":"fa:link","name":"@n8n/n8n-nodes-langchain.chainLlm","codex":{"data":{"alias":["LangChain"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Chains","Root Nodes"]}}},"group":"[\"transform\"]","defaults":{"name":"Basic LLM Chain","color":"#909298"},"iconData":{"icon":"link","type":"icon"},"displayName":"Basic LLM Chain","typeVersion":2,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1262,"icon":"file:google.svg","name":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatgooglegemini/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]}}},"group":"[\"transform\"]","defaults":{"name":"Google Gemini Chat Model"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDggNDgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNNDQuNSAyMEgyNHY4LjVoMTEuOEMzNC43IDMzLjkgMzAuMSAzNyAyNCAzN2MtNy4yIDAtMTMtNS44LTEzLTEzczUuOC0xMyAxMy0xM2MzLjEgMCA1LjkgMS4xIDguMSAyLjlsNi40LTYuNEMzNC42IDQuMSAyOS42IDIgMjQgMiAxMS44IDIgMiAxMS44IDIgMjRzOS44IDIyIDIyIDIyYzExIDAgMjEtOCAyMS0yMiAwLTEuMy0uMi0yLjctLjUtNCIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBmaWxsPSIjRkJCQzA1IiBkPSJNMCAzN1YxMWwxNyAxM3oiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiNFQTQzMzUiIGQ9Im0wIDExIDE3IDEzIDctNi4xTDQ4IDE0VjBIMHoiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiMzNEE4NTMiIGQ9Im0wIDM3IDMwLTIzIDcuOSAxTDQ4IDB2NDhIMHoiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiM0Mjg1RjQiIGQ9Ik00OCA0OCAxNyAyNGwtNC0zIDM1LTEweiIgY2xpcC1wYXRoPSJ1cmwoI2IpIi8+PC9zdmc+"},"displayName":"Google Gemini Chat Model","typeVersion":1,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]}],"categories":[{"id":33,"name":"Social Media"},{"id":51,"name":"Multimodal AI"}],"image":[]}}