AutomationFlowsAI & RAG › Automated Tweet Generator & Publisher with Gpt-4, Discord, and Google Sheets

Automated Tweet Generator & Publisher with Gpt-4, Discord, and Google Sheets

ByLukaszB @lukaszb on n8n.io

This workflow is perfect for creators, solopreneurs, and personal brands who want to consistently publish bold, high-performing content on X (Twitter) — without writing a single line themselves. After a one-time setup, it automatically generates tweet ideas, writes in your…

Event trigger★★★★★ complexityAI-powered44 nodesOpenAI ChatMemory Buffer WindowTool WorkflowAgentDiscordOutput Parser StructuredChain LlmGoogle Sheets Tool
AI & RAG Trigger: Event Nodes: 44 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Agent → Chainllm 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": "vmo7vbtthypEoBXC",
  "name": "AI Automated X (Twitter) post publisher- Build your personal brand",
  "tags": [],
  "nodes": [
    {
      "id": "ad01801d-b508-4bc9-bbd5-3927c199c2a6",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1620,
        820
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bae17025-e1ab-41c3-ae2e-c600cac67605",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1760,
        820
      ],
      "parameters": {
        "sessionKey": "1784315684",
        "sessionIdType": "customKey",
        "contextWindowLength": 25
      },
      "typeVersion": 1.3
    },
    {
      "id": "182833e2-dbca-4f27-adb8-8e440f5aea53",
      "name": "Get_Brand_Brief",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1900,
        820
      ],
      "parameters": {
        "name": "Get_Brand_Brief",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "NannfIKD8dUY1iOW",
          "cachedResultName": "Get Brand Brief"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5aaf4e5d-8448-4ab8-a447-056d08746003",
      "name": "Get_Content_Fedback",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        2060,
        820
      ],
      "parameters": {
        "name": "Get_Content_Fedback",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "xdg5KIv5xSaMXBAD",
          "cachedResultName": "Get Content Fedback"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "525bd859-2d75-4cc1-8589-b0b86916f8c6",
      "name": "AI Content creator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1800,
        560
      ],
      "parameters": {
        "text": "=Avalible idea for post:\n{{ $json['Post Idea'] }}",
        "options": {
          "maxIterations": 10,
          "systemMessage": "=You are a viral post creator for [YOUR NAME] as personal brand. Use the below steps to create content.\n\nSteps who alwas you must do :\n\n1.Always start by getting the brand brief using the Get_Brand_Brief tool.\n\n2.Create a post on the requested topic that aligns with the brand brief.\n\n3.Get feedback and a score on the post you created in step 2 by using the Get_Content_Feedback tool.\n\n4.If the score is below 0.7, use the feedback from step 3 to refine the post, then repeat steps 3 and 4.\n\n5. Check if this post was createed before usinmg history data form google sheets (Check History), if post was already publish find another  post.\n\n6.The final output should be the approved post.\n\nAlways go for all steps, don't skip any steps. always check post in use of get_content fedback  to check if poist is ok.\n\n\nMaintain a spartan tone of voice. Include emojis where necessary. Be confident, and conversational, creative and funny.This is for Twitter, keep responses 3 sentences maximum. Be offensive and controversial. Always output only lowercase letters. Do not be grammatically correct."
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "0a9670d5-81a4-447e-8e66-e2400ab90e5c",
      "name": "Discord confirm",
      "type": "n8n-nodes-base.discord",
      "position": [
        5680,
        520
      ],
      "parameters": {
        "content": "=Post Send \ud83d\ude0d:\n{{ $json.output }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1359075430514167838",
          "cachedResultUrl": "https://discord.com/channels/1241749058217971885/1359075430514167838",
          "cachedResultName": "n8n-post-approval"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "034438dd-a001-4a06-87c5-f2a803c7092c",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "position": [
        4000,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "86fa3efe-22c2-4689-a89d-3dc8559491c3",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0fe8cc50-a6a8-4c96-b6d0-b80af87c2bde",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        3860,
        680
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f78093f8-1c7f-486e-bd7a-9095ac16a801",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Try Again ').item.json.data.approved }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9afdf3aa-486d-4240-be87-1917140f696e",
      "name": "Get Brief",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        540,
        560
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "NannfIKD8dUY1iOW",
          "cachedResultName": "Get Brand Brief"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bd92b0a5-445f-4144-b7ef-aeb0efbffe37",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1060,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a5e0b3f6-a9b2-458d-83fd-ccef132fcc9f",
              "name": "Post Idea",
              "type": "array",
              "value": "={{ $json.output.suggestions }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "884baeb8-5840-4e06-a93b-d2fd5164500a",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        880,
        760
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"suggestions\": [\n    \"Create a post about AI in e-commerce.\",\n    \"Create a post about AI-powered sales tools.\"\n  ]\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "5a64cbd2-ffd0-4699-b69c-032f49f821e0",
      "name": "Idea creator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        700,
        560
      ],
      "parameters": {
        "text": "=You are a professional content writer. Create 10 topic suggestions that align with the provided brand brief.\n\nJSON output format:\n\n{\n  \"suggestions\": [\n    \"Create a post about [...]\",\n    ...\n  ]\n}\n\nBrand brief:\n{{ $json.content }}",
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "7f959c08-0eb2-42a7-a736-04379cda4da7",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        160,
        540
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f35cad4a-ebc7-4957-81c7-79ffe4c875cc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        300
      ],
      "parameters": {
        "color": 4,
        "width": 880,
        "height": 760,
        "content": "# Idea creator\n## AI Agent who finds relevant ideas for posts on social media. He finds ideas with help of the brand brief.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "11bca216-111e-49a7-8bf1-5b5a7135a6d6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        300
      ],
      "parameters": {
        "color": 4,
        "width": 1000,
        "height": 760,
        "content": "# Content creator\n## Writes the first draft of a post based on the brand brief, with feedback on which post will fit best.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b89b28e9-cbfb-45ab-b227-4d630bf72dcf",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2660,
        780
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c7fb63b2-aa90-4cd8-9967-bb117580aa56",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2820,
        780
      ],
      "parameters": {
        "sessionKey": "45323465",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a19e6ecf-736a-4d04-94d3-d3f93f0e60e7",
      "name": "Check History",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2240,
        820
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit#gid=0",
          "cachedResultName": "History"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit?usp=drivesdk",
          "cachedResultName": "Content Creator for X"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "2cbeefd8-2276-42f7-8a43-0705d6482210",
      "name": "Check Examples",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3120,
        780
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 193556585,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit#gid=193556585",
          "cachedResultName": "Examples"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit?usp=drivesdk",
          "cachedResultName": "Content Creator for X"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "8f4b55ce-1124-442b-9eb4-d1cbeafe42f1",
      "name": "Rewriter",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2840,
        560
      ],
      "parameters": {
        "text": "=Rewrite this post to my style:  {{ $json.output }}",
        "options": {
          "systemMessage": "=You are a viral post Rewriter for [YOUR NAME] as personal brand. Your task is rewrite existing post to his style of speaking and his style of writing. Use the below steps to create content.\n\nSteps who alwas you must do :\n\n1.Anylayze first draw on post in user prompt.\n2.Get Examples form tools  Get_Examples(google sheets) of already writing post,a nd anylaze style of speaking and writing.\n3.Rewrite post with all previus data, match style of user, be a lilt e clever and non to schematic.\n4.The final output should be the approved post.\n\nAlways go for all steps, don't skip any steps. always check post in use of get_content fedback  to check if poist is ok.\n\n\nMaintain a spartan tone of voice. Include emojis where necessary. Be confident, and conversational, creative and funny.This is for Twitter, keep responses 3 sentences maximum. Be offensive and controversial. Always output only lowercase letters. Do not be grammatically correct.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "79825dd7-874c-47ae-b106-c0baec9cd4ea",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        300
      ],
      "parameters": {
        "color": 4,
        "width": 900,
        "height": 780,
        "content": "# Rewriter\n## This agent rewrites posts to match your style using examples from a Google Sheet.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3d59febf-dca4-47e7-8dfa-9d14c4efb8fa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3560,
        300
      ],
      "parameters": {
        "color": 5,
        "width": 840,
        "height": 780,
        "content": "# Additional approval\n## Sends the post for approval in a Discord server, or you can use Telgram\u2014whichever you prefer. This step is optional.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "dab4e350-684d-44d4-8640-730938a7ee1e",
      "name": "Send post for approval",
      "type": "n8n-nodes-base.discord",
      "position": [
        3720,
        480
      ],
      "parameters": {
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "message": "=Aprove this post:\n{{ $json.output }}",
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1359075430514167838",
          "cachedResultUrl": "https://discord.com/channels/1241749058217971885/1359075430514167838",
          "cachedResultName": "n8n-post-approval"
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "cb3e9feb-4c39-4a1e-b666-d8830d1788f6",
      "name": "Try Again ",
      "type": "n8n-nodes-base.discord",
      "position": [
        3660,
        680
      ],
      "parameters": {
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1241749058217971885",
          "cachedResultUrl": "https://discord.com/channels/1241749058217971885",
          "cachedResultName": "Dark Dynasty"
        },
        "message": "=Try Again ?",
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "\u2713 Try",
            "disapproveLabel": "\u2717 Stop"
          }
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "dd1d7d66-52ea-4037-96e2-8fd156812e67",
      "name": "End of work",
      "type": "n8n-nodes-base.discord",
      "position": [
        3980,
        840
      ],
      "parameters": {
        "content": "End of workflow.",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1359075430514167838",
          "cachedResultUrl": "https://discord.com/channels/1241749058217971885/1359075430514167838",
          "cachedResultName": "n8n-post-approval"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "dd50213b-9b50-4806-b690-d331991df4ce",
      "name": "Confirm of next try",
      "type": "n8n-nodes-base.discord",
      "position": [
        4220,
        680
      ],
      "parameters": {
        "content": "Let's try Again",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1359075430514167838",
          "cachedResultUrl": "https://discord.com/channels/1241749058217971885/1359075430514167838",
          "cachedResultName": "n8n-post-approval"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "7d3f3496-0a0b-412f-b954-bad4190cb8a8",
      "name": "Post on X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        4700,
        600
      ],
      "parameters": {
        "text": "={{ $('Rewriter').item.json.output }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c9a69661-f7a7-472a-b68c-7f6b2f915374",
      "name": "Update history",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5240,
        640
      ],
      "parameters": {
        "columns": {
          "value": {
            "Post": "={{ $('AI Content creator').item.json.output }}",
            "Time": "={{ $now }}",
            "Published": "TRUE"
          },
          "schema": [
            {
              "id": "Post",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Published",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Published",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit#gid=0",
          "cachedResultName": "History"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit?usp=drivesdk",
          "cachedResultName": "Content Creator for X"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "4f1ef715-9e77-4aef-8955-5d81f97d489d",
      "name": "Add post to examples",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5220,
        420
      ],
      "parameters": {
        "columns": {
          "value": {
            "Examples": "={{ $('AI Content creator').item.json.output }}"
          },
          "schema": [
            {
              "id": "Examples",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Examples",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Examples"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 193556585,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit#gid=193556585",
          "cachedResultName": "Examples"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fe1JuLiHgjOQxFC95knZRLAh4y1gv3dF_HmE_cpgxE0/edit?usp=drivesdk",
          "cachedResultName": "Content Creator for X"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "62756c10-91f6-4748-a683-362b55b49948",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4520,
        300
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 780,
        "content": "# Post On X(Twitter)"
      },
      "typeVersion": 1
    },
    {
      "id": "13ced8cd-4128-41df-bd4a-ae2beaee7cb9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5080,
        300
      ],
      "parameters": {
        "color": 5,
        "width": 420,
        "height": 780,
        "content": "# Update History and Examples"
      },
      "typeVersion": 1
    },
    {
      "id": "0dd893d3-7341-4d9a-81ad-09d3f9b2dee8",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5540,
        300
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 780,
        "content": "# Confirm of End Workflow"
      },
      "typeVersion": 1
    },
    {
      "id": "966a3c48-78dc-458a-8afb-cbf952943b53",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        960,
        1580
      ],
      "parameters": {
        "inputSource": "passthrough"
      },
      "typeVersion": 1.1
    },
    {
      "id": "36290365-e2d8-4ead-adf2-4382699a80b0",
      "name": "Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1180,
        1580
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "url",
          "value": "[YOUR URL]"
        },
        "resource": "block",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "63902c08-9bfd-4c78-94d9-fabb92d7b948",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1400,
        1580
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "content"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0739a1b3-6e20-4a01-9fd2-32e843d78695",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        1580
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "827e1eab-4db9-4943-ae9e-f4a52b91342a",
              "name": "content",
              "type": "string",
              "value": "={{ $json.content.join() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6865e2f7-2099-456d-81f6-ab471c7ed44d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        1300
      ],
      "parameters": {
        "color": 2,
        "width": 1620,
        "height": 820,
        "content": "# Sub Workflow Get Brand Brief\n## Move to a separate workflow, add the trigger \"When Executed by Another Workflow\", and connect it to the main workflow \"AI Content Creator\".\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1971f2ca-55af-4e28-9af5-fdc00f5a0c80",
      "name": "Get brand brief",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        3200,
        1640
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "NannfIKD8dUY1iOW",
          "cachedResultName": "Get Brand Brief"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7bca5b92-66cd-45ff-9fd4-377ad5055f6c",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3400,
        1640
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=#RULES\nYou are tasked with evaluating a piece of content written for [YOUR NAME]. Your role is to assess how well the post aligns with \u0141ukasz personal brand, using the below brief as your guide.\n\nPlease analyze the post based on the following criteria:\n\nDoes the post have unwanted artifacts like \"Let's try again\" or \"Here's a new post\"?\n\nDoes the content reflect \u0141uaksz core values, voice, and style as described in the brief?\n\nDoes it engage \u0141uaksz target audience as described in the brief?\n\nDoes it emphasize \u0141uaksz expertise and domain authority as described in the brief?\n\nIs the tone, messaging, and approach consistent with the brief's objectives and positioning?\n\nAfter evaluation, output a score between 0 and 1, representing the alignment between the post and the brand brief. The score should be output in the following JSON format:\n\n\n{\n  \"description\": \"[short description here]\",\n  \"score\": [insert score here]\n}\n\n\n#Brand Brief:\n{{ $json.content }}"
            },
            {
              "content": "={{ $('When Executed by Another Workflow').item.json.query }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "b1116a8f-457e-4227-8f6c-ccd6f84ef0d9",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        3780,
        1640
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fee5f699-a3a7-431e-9d87-b6a0477ba3c8",
              "name": "feedback",
              "type": "string",
              "value": "={{ $json.message.content.description }}"
            },
            {
              "id": "47c14c4f-aefa-4fd4-b94e-64aaeba38b5a",
              "name": "score",
              "type": "number",
              "value": "={{ $json.message.content.score }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5ec7bc40-fe22-423f-86e9-7701b4faf35e",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2840,
        1320
      ],
      "parameters": {
        "color": 2,
        "width": 1660,
        "height": 800,
        "content": "# Sub Workflow Get Content Feedback\n## Move to a separate workflow, add the trigger \"When Executed by Another Workflow\", and connect it to the main workflow \"AI Content Creator\".\n"
      },
      "typeVersion": 1
    },
    {
      "id": "be9bbe69-6543-4c3d-8cb2-235078fab28e",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 6080,
        "height": 1200,
        "content": "# Main workflow"
      },
      "typeVersion": 1
    },
    {
      "id": "6f224827-8c2b-4b78-9a9f-0ac024af5404",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        680,
        780
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "907c004c-ea40-47de-a315-db88b2f44bd4",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4760,
        1280
      ],
      "parameters": {
        "color": 3,
        "width": 1220,
        "height": 1020,
        "content": "# \u2705 AI X Post Creator \u2013 Quick Start Guide\n\nThis workflow automatically generates viral posts for your personal brand on X (Twitter).  \nIt creates a content idea based on your brand brief, writes a short post, evaluates the post\u2019s alignment with your tone, checks if it was published before (via Google Sheets), rewrites if needed, sends it for approval on Discord, publishes to X, and updates history logs.\n\n---\n\n## \ud83d\udd27 What You Need to Replace\n\n| Placeholder              | Where to Update                                                       |\n|--------------------------|------------------------------------------------------------------------|\n| **[YOUR NAME]**          | Prompt nodes: `AI Content creator`, `Rewriter`, `OpenAI`              |\n| **[YOUR URL]**           | Node: `Notion` (if you use Notion for brief)                          |\n| **OpenAi API**           | All `OpenAI` nodes \u2013 add your actual OpenAI credentials               |\n| **Google Sheets **       | All Google Sheets nodes \u2013 connect your real spreadsheet               |\n| **Discord Bot **         | Discord nodes \u2013 replace with your bot token & correct channel IDs     |\n| **X**                    | Twitter node \u2013 add your real X (Twitter) OAuth2 credentials           |\n| **Get Brand Brief**      | Sub-workflow ID \u2013 must return brand brief as text                     |\n| **Get Content Feedback** | Sub-workflow ID \u2013 must return post evaluation in JSON (score + notes) |\n\n---\n\n## \ud83e\udde9 Required Subworkflows\n\n### 1. **Get Brand Brief**  \nCreate a sub-workflow that returns a brand tone/voice as a single `text` field.\n\n### 2. **Get Content Feedback**  \nCreate another sub-workflow that takes a post and brand brief, then returns:\n\n```json\n{\n  \"description\": \"Short evaluation of the post\",\n  \"score\": 0.0 \u2013 1.0\n}\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "272d7ee9-672f-482d-b77a-9ccd6bc7ee84",
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Confirm of next try",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "End of work",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Post on X",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Try Again ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rewriter": {
      "main": [
        [
          {
            "node": "Send post for approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Brief": {
      "main": [
        [
          {
            "node": "Idea creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post on X": {
      "main": [
        [
          {
            "node": "Add post to examples",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Try Again ": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "AI Content creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Idea creator": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check History": {
      "ai_tool": [
        [
          {
            "node": "AI Content creator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Content creator",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Check Examples": {
      "ai_tool": [
        [
          {
            "node": "Rewriter",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Rewriter",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Update history": {
      "main": [
        [
          {
            "node": "Discord confirm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get brand brief": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get_Brand_Brief": {
      "ai_tool": [
        [
          {
            "node": "AI Content creator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Content creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Content creator": {
      "main": [
        [
          {
            "node": "Rewriter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Rewriter",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Idea creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Confirm of next try": {
      "main": [
        [
          {
            "node": "AI Content creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get_Content_Fedback": {
      "ai_tool": [
        [
          {
            "node": "AI Content creator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Add post to examples": {
      "main": [
        [
          {
            "node": "Update history",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send post for approval": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Idea creator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Get Brief",
            "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 workflow is perfect for creators, solopreneurs, and personal brands who want to consistently publish bold, high-performing content on X (Twitter) — without writing a single line themselves. After a one-time setup, it automatically generates tweet ideas, writes in your…

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

How it Works

Memory Buffer Window, Agent, Output Parser Structured +9
AI & RAG

The best content automation template in the market is now even better—with “deep research” on time-sensitive topics\! Unlike most n8n content automation templates that are mainly for “demo purposes,”

OpenAI, HTTP Request, XML +11
AI & RAG

Typeform IA - YT. Uses typeformTrigger, agent, lmChatOpenAi, toolWorkflow. Event-driven trigger; 75 nodes.

Typeform Trigger, Agent, OpenAI Chat +7
AI & RAG

Agent Nodes. Uses lmChatOpenAi, slack, stopAndError, errorTrigger. Event-driven trigger; 72 nodes.

OpenAI Chat, Slack, Stop And Error +12
AI & RAG

Who is this for? Agencies, consultants, and service providers who conduct discovery calls and need to quickly turn conversations into professional proposals.

Tool Think, Tool Calculator, Agent Tool +18