AutomationFlowsAI & RAG › Generate Multi-platform Social Media Posts with Gpt-4.1 and Postpulse

Generate Multi-platform Social Media Posts with Gpt-4.1 and Postpulse

ByDmytro @dmytro-hnatiuk on n8n.io

This workflow allows you to turn any idea for a post into platform-specific content using AI. You simply provide the concept, topic, or description of a post, and the AI generates drafts adapted to multiple social media platforms — LinkedIn, Telegram, TikTok, YouTube, X/Twitter,…

Event trigger★★★★☆ complexityAI-powered16 nodes@Postpulse/N8N Nodes PostpulseOpenAI
AI & RAG Trigger: Event Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

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

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": "FS1zmh5zmaLSg0jw",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Social Publisher via PostPulse",
  "tags": [],
  "nodes": [
    {
      "id": "c5aa58f2-1be9-405e-93d3-d5011b6dfa05",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6900757a-86f1-45ed-a976-e041383e510b",
      "name": "Get connected accounts",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        768,
        448
      ],
      "parameters": {
        "resource": "account"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cb6c4037-384f-4cff-b31e-8d2a1a5b2934",
      "name": "idea",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1279a713-d71c-44a0-a65e-01679663007c",
              "name": "idea",
              "type": "string",
              "value": "Write a post for my restaurant called \"West Coast\", write that oysters and squid have appeared on our menu and many new items from Asian cuisine, in honor of this, a discount on Asian cuisine and seafood dishes minus 40 percent!"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b2b9f6da-0586-4fc8-9c7b-88cdf4b638ac",
      "name": "AI Content Adapter",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        784,
        -80
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert in creating content for social media, adapting content for different platforms while maintaining the core message and maximizing engagement for each platform's unique audience. Write in English only."
            },
            {
              "content": "={{$json[\"text\"]}}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4bf62121-7d1b-45c0-88da-25d61eee5c72",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1440,
        176
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "platform"
      },
      "typeVersion": 3.2
    },
    {
      "id": "ef889214-42cf-4346-afea-fed139035937",
      "name": "Publish Post",
      "type": "@postpulse/n8n-nodes-postpulse.postPulse",
      "position": [
        1664,
        144
      ],
      "parameters": {
        "isDraft": true,
        "publications": {
          "publication": [
            {
              "posts": {
                "post": [
                  {
                    "content": "={{ (function(){\n    const fullText = $json.text || '';\n    const p = $json.platform;\n    let max = 500;\n    if(p==='X_TWITTER') max = 280;\n    if(p==='BLUE_SKY') max = 300;\n    if(fullText.length <= max) return fullText;\n    const d = fullText.lastIndexOf('.', max),\n          e = fullText.lastIndexOf('!', max),\n          q = fullText.lastIndexOf('?', max),\n          s = Math.max(d,e,q),\n          l = max*0.6;\n    if(s>0 && s>=l) return fullText.substring(0,s+1);\n    const w = fullText.lastIndexOf(' ', max);\n    return fullText.substring(0, w>0?w:max) + '...';\n})() }}\n"
                  }
                ]
              },
              "platformSettings": "={{ (function() { const platformMapping = { 'X_TWITTER': 'TWITTER', 'YOUTUBE': 'YOUTUBE', 'THREADS': 'THREADS', 'TIKTOK': 'TIK_TOK', 'INSTAGRAM': 'INSTAGRAM', 'FACEBOOK': 'FACEBOOK', 'LINKEDIN': 'LINKEDIN', 'BLUE_SKY': 'BLUE_SKY', 'TELEGRAM': 'TELEGRAM' }; return JSON.stringify({ \"type\": platformMapping[$json.platform] }); })() }}",
              "socialMediaAccountId": "={{ $json.id }}"
            }
          ]
        },
        "scheduledTime": "={{$now.toUTC()}}"
      },
      "credentials": {
        "postPulseOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a7072966-6003-4e56-a918-8a8e3a195300",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -416
      ],
      "parameters": {
        "width": 624,
        "height": 144,
        "content": "## AI Social Publisher via PostPulse\nThis workflow automatically adapts your ideas into social media posts with AI, adjusts content for different platforms (Twitter, LinkedIn, TikTok, Telegram, YouTube, etc.), and schedules them as drafts in PostPulse for further review or publishing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "87a7b4cb-a406-4afa-9aea-9781419ac9d2",
      "name": "Setting Restrictions and Hashtags",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        -32
      ],
      "parameters": {
        "jsCode": "// Get the user's idea from the previous Set node\nlet idea = items[0].json.idea;\n\n// Define platforms with character limits\nconst platforms = {\n  TELEGRAM: 800,\n  TIKTOK: 800,\n  LINKEDIN: 800,\n  X_TWITTER: 280,\n  YOUTUBE: 400\n};\n\n// Return one item per platform with platform name + text\nreturn Object.entries(platforms).map(([platform, maxLength]) => {\n  return {\n    json: {\n      platform: platform, // THIS IS IMPORTANT\n      text: `${idea} \\nCreate a post for ${platform} within ${maxLength} characters and add 3-4 relevant hashtags based on the topic. Write in English only.`\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8cc19030-7f06-4f7a-b01f-cc00cdba5503",
      "name": "Unification of Platforms and Text",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        -48
      ],
      "parameters": {
        "jsCode": "// Define platforms in the same \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0449\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0432\u0441\u044f \u043f\u0435\u0440\u0435\u0434 OpenAI\nconst platforms = [\"TELEGRAM\", \"TIKTOK\", \"LINKEDIN\", \"X_TWITTER\", \"YOUTUBE\"];\n\n// Output array from OpenAI\nconst aiItems = items; // items \u2014 \u0446\u0435 \u0432\u0445\u0456\u0434\u043d\u0456 \u0434\u0430\u043d\u0456 \u0437 OpenAI \u043d\u043e\u0434\u0438\n\n// We iterate and add platform to each item\nreturn aiItems.map((item, index) => {\n    return {\n        json: {\n            platform: platforms[index] || \"unknown\", // protection in case there are more or less items\n            text: item.json?.message?.content || \"\" // text from OpenAI\n        }\n    };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "89db40dc-4dbc-46c2-bf97-b52acf6486b4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        176
      ],
      "parameters": {
        "width": 176,
        "height": 96,
        "content": "## Idea  \nEnter your post idea here.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "472b4241-842b-4bb5-86ba-7b7531d98c68",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -208
      ],
      "parameters": {
        "width": 464,
        "content": "## Setting Restrictions and Hashtags  \nHere the idea is adapted for each platform with limits and hashtags.  \nOptionally, you can change character limits (within each platform\u2019s max), adjust hashtag count, or tweak prompts.  \nBy default, everything works fine \u2014 changes are optional.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "08b3e28e-798c-4c6f-abc3-89fbf65a21ef",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -224
      ],
      "parameters": {
        "width": 272,
        "height": 128,
        "content": "## AI Content Adapter  \nThis is the AI node that generates platform-specific content variations.  \nIt adapts the idea into ready posts.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f171cec9-22dc-4e90-b705-1ca03aca4304",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -192
      ],
      "parameters": {
        "width": 288,
        "height": 128,
        "content": "## Unification of Platforms and Text  \nCombines AI-generated text with the corresponding platform for publishing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "47116afa-50d0-4ab0-b1c8-c3346b10c71d",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        304
      ],
      "parameters": {
        "width": 352,
        "height": 128,
        "content": "## PostPulse Get Connected Accounts\nRetrieves your linked social media accounts for publishing posts.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ec553756-5bfa-42c6-b2f9-c624b698cea8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        336
      ],
      "parameters": {
        "width": 288,
        "height": 144,
        "content": "## Merge  \nMerges the platform info from connected accounts with the AI-generated posts, preparing data for publishing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d47184a4-74f7-40ec-b79a-2b8b15dba73b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        16
      ],
      "parameters": {
        "width": 304,
        "height": 112,
        "content": "## Publish Post  \nSends the prepared posts to PostPulse as drafts, ready for scheduling or publishing.  \n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ef6f4402-3c77-4ec4-8df8-b3df02ba6208",
  "connections": {
    "idea": {
      "main": [
        [
          {
            "node": "Setting Restrictions and Hashtags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Publish Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Content Adapter": {
      "main": [
        [
          {
            "node": "Unification of Platforms and Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get connected accounts": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Setting Restrictions and Hashtags": {
      "main": [
        [
          {
            "node": "AI Content Adapter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unification of Platforms and Text": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get connected accounts",
            "type": "main",
            "index": 0
          },
          {
            "node": "idea",
            "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 allows you to turn any idea for a post into platform-specific content using AI. You simply provide the concept, topic, or description of a post, and the AI generates drafts adapted to multiple social media platforms — LinkedIn, Telegram, TikTok, YouTube, X/Twitter,…

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

Ask questions like “How much did I spend on food last month?” and get instant answers from your financial data — directly in Telegram.

Telegram Trigger, OpenAI, Google Sheets +2
AI & RAG

The Problem That it Solves

Google Drive Trigger, OpenAI, Google Drive +5
AI & RAG

This intelligent email automation workflow helps you maximize engagement through domain-based outreach. It utilizes AI-powered personalization and strategic follow-ups to increase response rates. The

Gmail, HTTP Request, Google Sheets +1
AI & RAG

Note: Now includes an Apify alternative for Rapid API (Some users can't create new accounts on Rapid API, so I have added an alternative for you. But immediately you are able to get access to Rapid AP

Form Trigger, Google Sheets Trigger, OpenAI +2
AI & RAG

Scrape ads – Pulls Facebook Ad Library data for "ai automation" keywords using Apify Filter & sort – Filters ads by page likes (&gt;1,000) and separates into videos, images, and text ads Analyze creat

HTTP Request, Google Drive, OpenAI +3