From 878a1b6b60f91b38ea8696190ffe82b056a4d669 Mon Sep 17 00:00:00 2001 From: nusquama Date: Wed, 12 Nov 2025 12:50:46 +0100 Subject: [PATCH] creation --- ...i-platform_social_media_posts_with_gpt-4.1_and_postpulse.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 workflows/Generate Multi-Platform Social Media Posts with GPT-4.1 and PostPulse-9195/generate_multi-platform_social_media_posts_with_gpt-4.1_and_postpulse.json diff --git a/workflows/Generate Multi-Platform Social Media Posts with GPT-4.1 and PostPulse-9195/generate_multi-platform_social_media_posts_with_gpt-4.1_and_postpulse.json b/workflows/Generate Multi-Platform Social Media Posts with GPT-4.1 and PostPulse-9195/generate_multi-platform_social_media_posts_with_gpt-4.1_and_postpulse.json new file mode 100644 index 000000000..f4015e132 --- /dev/null +++ b/workflows/Generate Multi-Platform Social Media Posts with GPT-4.1 and PostPulse-9195/generate_multi-platform_social_media_posts_with_gpt-4.1_and_postpulse.json @@ -0,0 +1 @@ +{"id":"FS1zmh5zmaLSg0jw","meta":{"instanceId":"bf246f909c2b838648f333c22c98b9bde186937bc00a5918bd9a27f4ec3914d3","templateCredsSetupCompleted":true},"name":"AI Social Publisher via PostPulse","tags":[],"nodes":[{"id":"c5aa58f2-1be9-405e-93d3-d5011b6dfa05","name":"When clicking ‘Execute workflow’","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":{"id":"nrEYznJjQaKGajyK","name":"PostPulse account"}},"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":{"id":"PSmGB8tfEOzisT6A","name":"OpenAi account 2"}},"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":{"id":"nrEYznJjQaKGajyK","name":"PostPulse account"}},"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 порядок, що використовувався перед OpenAI\nconst platforms = [\"TELEGRAM\", \"TIKTOK\", \"LINKEDIN\", \"X_TWITTER\", \"YOUTUBE\"];\n\n// Output array from OpenAI\nconst aiItems = items; // items — це вхідні дані з OpenAI ноди\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’s max), adjust hashtag count, or tweak prompts. \nBy default, everything works fine — 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,"pinData":{},"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 ‘Execute workflow’":{"main":[[{"node":"Get connected accounts","type":"main","index":0},{"node":"idea","type":"main","index":0}]]}}} \ No newline at end of file