{
  "id": "tKu7HzCQdvpzOn29",
  "name": "AI-Powered Social Media Campaign Generator (End-to-End Workflow)",
  "tags": [],
  "nodes": [
    {
      "id": "6876d436-ca2d-4a21-8622-b853be706781",
      "name": "Receive Product Details via Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1024,
        -96
      ],
      "parameters": {
        "path": "691cefdb-6770-40db-9b6a-1da2350088fe",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "938a9a28-e3fb-4ae7-84d1-2a85d56a35a8",
      "name": "Clean & Normalize Product Input Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -720,
        -96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "996fa0d7-7b74-4476-ace5-afe9b7775372",
              "name": "body.product_name",
              "type": "string",
              "value": "={{ $json.body.product_name.replace(/\\\\\"/g, \"\").replace(/\"$/, \"\").trim() }}\n"
            },
            {
              "id": "5963aff9-38b7-42cd-bbd7-6b7a1cffd2ea",
              "name": "body.product_description",
              "type": "string",
              "value": "={{ $json.body.product_description.replace(/\\\\\\\"$/, \"\").trim() }}\n"
            },
            {
              "id": "e94b719b-9c41-42fb-92ad-f8471714b3cd",
              "name": "body.target_audience",
              "type": "string",
              "value": "={{ $json.body.target_audience.replace(/\\\\\\\"$/, \"\").replace(/,$/, \"\").trim() }}\n"
            },
            {
              "id": "336ade46-4639-418e-af0f-41e3f6adb2d1",
              "name": "body.brand_voice",
              "type": "string",
              "value": "={{ $json.body.brand_voice.trim() }}\n"
            },
            {
              "id": "7042d1af-e503-4efb-ab09-6875410f70e4",
              "name": "body.benefits",
              "type": "string",
              "value": "={{ $json.body.benefits.replace(/\\\\\\\"$/, \"\").trim() }}\n"
            },
            {
              "id": "9d163f49-e7b0-447c-a5e3-5a0cdd3f9414",
              "name": "body.reference_image",
              "type": "string",
              "value": "={{ $json.body.reference_image }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ed341bd1-ba0d-4903-acc5-7747ffe2e826",
      "name": "Generate Campaign Blueprint Using AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -336,
        -96
      ],
      "parameters": {
        "text": "=You are a senior marketing strategist and JSON-only generator.\n\nYou MUST return output ONLY in valid JSON that EXACTLY matches the schema provided by the Structured Output Parser.\nNo explanations.  \nNo markdown.  \nNo text before or after JSON.  \nNo comments.  \nIf any field does not have a value, return an empty string.\n\n---------------------\nINPUT PRODUCT DETAILS\n---------------------\nProduct Name: {{ $json.body.product_name }}\nDescription: {{ $json.body.product_description }}\nTarget Audience: {{ $json.body.target_audience }}\nBrand Voice: {{ $json.body.brand_voice }}\nKey Benefits: {{ $json.body.benefits }}\n\n---------------------\nYOUR TASK\n---------------------\nGenerate a JSON object containing:\n\n{\n  \"article_summary\": {\n    \"title\": \"string\",\n    \"url\": \"string\",\n    \"author\": \"string\",\n    \"target_audience\": \"string\",\n    \"tone_of_voice\": \"string\",\n    \"insights\": [\n      \"string\",\n      \"string\",\n      \"string\"\n    ]\n  },\n  \"posts\": [\n    {\n      \"platform\": \"string\",\n      \"post_text\": \"string\",\n      \"image_prompt\": \"string\",\n      \"cta\": \"string\",\n      \"suggested_delay_minutes\": 0\n    }\n  ]\n}\n\nReturn ONLY valid JSON. Do not wrap it in text or code blocks.\nDo not output anything else.\n",
        "options": {
          "systemMessage": "=You are a senior marketing strategist and social media campaign expert. \nYour task is to analyze the provided product details and create a complete \ncampaign blueprint that will later be used to generate captions, hashtags, \nimage prompts, and scheduling.\n\nRules:\n- Read the product details carefully.\n- Understand the core value proposition.\n- Identify the strongest marketing angle.\n- Keep the writing style clean, modern, and conversion-focused.\n- Do not invent benefits that were not mentioned.\n- Keep output structured, simple, and JSON-valid.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "3eb10add-58cb-4e90-9622-871b5cf85339",
      "name": "Parse Campaign Blueprint JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -128,
        128
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"article_summary\": {\n    \"title\": \"string\",\n    \"url\": \"string\",\n    \"author\": \"string\",\n    \"target_audience\": \"string\",\n    \"tone_of_voice\": \"string\",\n    \"insights\": [\n      \"string\",\n      \"string\",\n      \"string\"\n    ]\n  },\n  \"posts\": [\n    {\n      \"platform\": \"LinkedIn | Instagram | X\",\n      \"post_text\": \"string\",\n      \"image_prompt\": \"string\",\n      \"cta\": \"string\",\n      \"suggested_delay_minutes\": 0\n    }\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "3a015119-8d21-4e17-b1cd-eb034194f65b",
      "name": "LLM Engine for Campaign Blueprint",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -368,
        128
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {},
        "responsesApiEnabled": false
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "dd55d843-764a-439f-9b4d-5b779894f135",
      "name": "Generate Instagram Captions Using AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        432,
        48
      ],
      "parameters": {
        "text": "=Generate 5 unique Instagram-ready captions based on the campaign blueprint and product details below.\n\nEach caption must:\n- Be 2\u20133 lines maximum.\n- Include 0\u20132 emojis.\n- Start with a strong hook.\n- Clearly highlight the product benefit.\n- Include a CTA in a separate field at the end.\n- NOT include hashtags.\n\nCampaign Blueprint:\n{{ JSON.stringify($json.output.article_summary) }}\n\nReturn ONLY valid JSON in this format:\n\n{\n  \"captions\": [\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    },\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    },\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    },\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    },\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    }\n  ]\n}\n\nDo NOT return markdown. Do NOT wrap in ```json```. Only return pure JSON.\n",
        "options": {
          "systemMessage": "=You are a senior social media copywriter who specializes in writing high-converting, modern Instagram captions.\n\nYour goals:\n- Understand the brand voice and campaign blueprint.\n- Write short, punchy captions that hook the viewer in 1\u20132 seconds.\n- Keep captions concise, emotionally engaging, and benefit-driven.\n- Use emojis sparingly (0\u20132 per caption).\n- Include a strong CTA at the end of each caption.\n- Do NOT include hashtags. They will be generated separately.\n- Do NOT repeat insights verbatim\u2014reinterpret them creatively.\n- Return ONLY valid JSON matching the required schema.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "cbd8f6f3-e966-4507-b41c-8b0977698ae0",
      "name": "LLM Engine for Caption Writing",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        368,
        304
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {},
        "responsesApiEnabled": false
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "62d66694-7170-4d60-9cfd-51eed3891857",
      "name": "Parse Caption Output JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        640,
        336
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"captions\": [\n    {\n      \"caption\": \"string\",\n      \"cta\": \"string\"\n    }\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6e1709f9-b31d-434b-965a-0633b51a04a6",
      "name": "Generate Hashtag Set Using AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        432
      ],
      "parameters": {
        "text": "=Generate a set of high-performing Instagram hashtags based on the campaign blueprint and product insights below.\n\nCampaign Blueprint:\n{{ JSON.stringify($(\"Generate Campaign Blueprint Using AI\").first().json.output.article_summary) }}\n\n\nCaptions:\n{{ JSON.stringify($json.output.captions) }}\n\nRequirements:\n- Return 12 to 18 hashtags\n- Mix of large, medium, and niche tags\n- No banned or spammy tags\n- No duplicates\n- Only lowercase (Instagram best practice)\n- No spaces, only underscores if needed\n- Do NOT include explanations\n\nReturn the result in this exact JSON format:\n\n{\n  \"hashtags\": [\"string\", \"string\", \"string\"]\n}\n",
        "options": {
          "systemMessage": "=You are a social media growth strategist who specializes in Instagram hashtag optimization.\n\nYour goal is to generate a high-performing set of hashtags that:\n- Improve reach, discovery, and engagement\n- Combine high-volume, mid-volume, and niche hashtags\n- Are relevant to the product and campaign blueprint\n- Avoid banned, spammy, or ultra-generic hashtags\n- Do NOT repeat words unnecessarily\n- Stay readable and brand-safe\n- Return only JSON\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "e31af71d-6a17-4926-81c4-053730af405b",
      "name": "LLM Engine for Hashtag Generation",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1056,
        704
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {},
        "responsesApiEnabled": false
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2c187067-dac4-4278-9965-7a70afac1314",
      "name": "Parse Hashtag Output JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1296,
        688
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"hashtags\": [\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\",\n    \"string\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a31dc9b4-7b47-4415-8d6a-ee43da395dcb",
      "name": "Split Campaign Posts for Image Generation",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        560,
        -624
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output.posts"
      },
      "typeVersion": 1
    },
    {
      "id": "1c026a9d-62fc-4091-9f05-1ad5a3ae6f60",
      "name": "Generate Social Media Image Using AI",
      "type": "n8n-nodes-base.openAi",
      "position": [
        896,
        -624
      ],
      "parameters": {
        "model": "dall-e-3",
        "prompt": "=Generate ONE high-quality commercial social media image for the brand, following the exact image description below.\n\nOnly generate a visual scene.  \nDo NOT add text.  \nDo NOT rewrite the caption.  \nDo NOT include logos or watermarks.\n\n====================\nIMAGE INPUT\n====================\n\nPlatform: {{ $json.platform }}\nBrand Theme: {{ $('Generate Campaign Blueprint Using AI').item.json.output.article_summary.title }}\nAudience: {{ $('Generate Campaign Blueprint Using AI').item.json.output.article_summary.target_audience }}\nTone: {{ $('Generate Campaign Blueprint Using AI').item.json.output.article_summary.tone_of_voice }}\n\nImage Concept: {{ $json.image_prompt }}\n\n====================\nSTYLE REQUIREMENTS\n====================\n\n- Ultra-realistic photography  \n- Clean lighting, cinematic shadows  \n- Professional commercial quality  \n- Sharp details, natural colors  \n- Modern lifestyle / product aesthetic  \n- 8K look, crisp textures  \n\nReturn ONLY the final visual image description. No explanation.\n",
        "options": {
          "n": 1,
          "size": "1792x1024",
          "style": "vivid",
          "quality": "hd"
        },
        "resource": "image",
        "requestOptions": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "08230b5d-9034-4f06-a7b6-133a545600de",
      "name": "Upload Generated Image to Cloudinary",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 5,
      "position": [
        1200,
        -624
      ],
      "parameters": {
        "url": "https://api.cloudinary.com/v1_1/dpuvigpmt/image/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "upload"
            }
          ]
        },
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "fad9fad1-d74c-4083-b140-fa3c7ff14d28",
      "name": "Generate Optimal Posting Schedule Using AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1744,
        416
      ],
      "parameters": {
        "text": "=Generate an optimal posting schedule for the campaign.\n\nHere is the campaign blueprint and post data:\n\nTarget Audience:\n{{ $('Generate Campaign Blueprint Using AI').item.json.output.article_summary.target_audience }}\n{{ JSON.stringify($('Generate Campaign Blueprint Using AI').item.json.output.posts, null, 2) }}\n\n\nYour task:\n- Recommend the BEST single posting time for each platform.\n- Use timezone: Asia/Kolkata.\n- Use audience behavior patterns (millennials, gym-goers, working professionals).\n- Give a short reasoning for each posting time.\n- Do NOT repeat any captions or CTAs \u2014 only scheduling.\n\nReturn the output ONLY in valid JSON following the schema.\n",
        "options": {
          "systemMessage": "=You are a senior social media strategist specializing in growth campaigns.\nYour job is to generate the BEST posting schedule for each platform based on:\n\n- Target audience behavior\n- Platform engagement trends\n- Product category (energy drink, fitness lifestyle, wellness)\n- Tone of voice and insights\n- Location relevance (India-based audiences)\n\nRules:\n- Always return posting times optimized for maximum reach.\n- Use timezone: \"Asia/Kolkata\".\n- Provide a short reasoning for each recommended time.\n- Each platform must have one recommended posting slot.\n- Keep output simple, clean, and actionable.\n- RETURN ONLY valid JSON matching the exact required schema. No prose.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "f81544f4-be3e-4894-824b-b585058fc0ac",
      "name": "Parse Posting Schedule Output JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1952,
        624
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"schedule\": [\n    {\n      \"platform\": \"string\",\n      \"recommended_time\": \"string\",\n      \"timezone\": \"string\",\n      \"reasoning\": \"string\"\n    }\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "12a761c9-6502-4161-a602-49f3b68a7458",
      "name": "LLM Engine for Posting Schedule",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1728,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {},
        "responsesApiEnabled": false
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "cf1e4330-ccec-4b6d-8cc4-47aab0abd6ad",
      "name": "Combine All Campaign Assets",
      "type": "n8n-nodes-base.merge",
      "position": [
        2304,
        -96
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "f731dacd-be71-4976-9154-f572f910cd36",
      "name": "Send Final Campaign Package to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2848,
        -64
      ],
      "parameters": {
        "text": "=\ud83c\udf89 *Your EcoBoost Campaign Package is Ready!*  \n\n---------------------------------------\n\n\ud83d\udcf8 *Images*\n{{ $json.images.join(\"\\n\") }}\n\n---------------------------------------\n\n\u270d\ufe0f *Captions + CTA*\n{{ $json.captions.map(c => `\u2022 ${c.caption}\\n   _CTA:_ ${c.cta}`).join(\"\\n\\n\") }}\n\n---------------------------------------\n\n#\ufe0f\u20e3 *Hashtags*\n{{ \"#\" + $json.hashtags.join(\" #\") }}\n\n---------------------------------------\n\n\ud83d\udd52 *Posting Schedule*\n{{ $json.schedule.map(s => `\u2022 *${s.platform}*: ${s.recommended_time} (${s.timezone}) \u2014 ${s.reasoning}`).join(\"\\n\") }}\n\n---------------------------------------\n\n\ud83d\ude80 All assets generated successfully. Ready to publish!\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09GNB90TED",
          "cachedResultName": "general-information"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7bc41c5a-4250-4f89-b22b-8fa8e68f6e30",
      "name": "Prepare Final Campaign Package JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        -64
      ],
      "parameters": {
        "jsCode": "let images = [];\nlet captions = [];\nlet hashtags = [];\nlet schedule = [];\n\nfor (const entry of items) {\n  const item = entry.json;   // << IMPORTANT FIX\n\n  // Cloudinary images \u2192 detect secure_url\n  if (item.secure_url) {\n    images.push(item.secure_url);\n  }\n\n  // Captions\n  if (item.output?.captions) {\n    captions = item.output.captions;\n  }\n\n  // Hashtags\n  if (item.output?.hashtags) {\n    hashtags = item.output.hashtags;\n  }\n\n  // Schedule\n  if (item.output?.schedule) {\n    schedule = item.output.schedule;\n  }\n}\n\nreturn [\n  {\n    json: {\n      images,\n      captions,\n      hashtags,\n      schedule\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9287f621-d5da-4fa3-bf50-ca1efdd6a7ff",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2272,
        -928
      ],
      "parameters": {
        "width": 736,
        "height": 464,
        "content": "## \ud83d\ude80 AI-Powered Social Media Campaign Generator (End-to-End Workflow)\nThis workflow converts raw product details into a complete, production-ready social media\ncampaign package. It receives product info via webhook \u2192 cleans & normalizes fields \u2192\ncreates a campaign blueprint \u2192 generates captions, hashtags, images, and posting schedules\nusing multiple AI agents \u2192 merges them \u2192 and finally sends a neatly formatted campaign\npackage to Slack.\n\nThe system automates:\n\u2022 Product input cleaning & validation  \n\u2022 AI-based campaign blueprint creation  \n\u2022 Instagram captions (5 versions)  \n\u2022 High-performance hashtag set  \n\u2022 Ultra-realistic commercial images (via DALL\u00b7E 3)  \n\u2022 Cloudinary upload for media hosting  \n\u2022 Optimal posting schedule per platform (India timezone)  \n\u2022 Final combined campaign JSON assembly  \n\u2022 Slack delivery of the entire campaign package  \n\nThis replaces hours of manual creative work and produces a consistent, professional,\nend-to-end marketing campaign ready to publish.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b474768c-4d0a-4805-b1cc-6b3d24bf05ba",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -416
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 560,
        "content": "## \ud83e\uddfc Product Intake & Normalization\nReceives product details and cleans messy escape characters before sending to AI.\n\n\u2022 Receive Product Details via Webhook  \n  Captures incoming request containing product name, description, benefits, and audience.\n\n\u2022 Clean & Normalize Product Input Fields  \n  Removes escaped characters, trims whitespace, and prepares clean values for AI agents.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6813555e-1672-47d1-bcde-80f916ce09ec",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -480
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 832,
        "content": "## \ud83e\udde0 AI Campaign Blueprint Creation\nBuilds the strategic foundation for the entire marketing campaign.\n\n\u2022 Generate Campaign Blueprint Using AI  \n  Produces structured JSON including article summary, insights, and platform posts.\n\n\u2022 LLM Engine for Campaign Blueprint  \n  Supplies GPT-4o model specifically for blueprint generation tasks.\n\n\u2022 Parse Campaign Blueprint JSON  \n  Validates and converts AI output into strict JSON for downstream nodes.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5ae2cef7-296d-48e6-b239-07e1b5ae6b7f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 768,
        "content": "## \u270d\ufe0f Instagram Caption Generation\nCreates 5 modern, short, engaging captions with CTAs.\n\n\u2022 Generate Instagram Captions Using AI  \n  Produces concise Instagram-ready captions based on blueprint insights.\n\n\u2022 LLM Engine for Caption Writing  \n  Powers the caption-writing agent using GPT-4o.\n\n\u2022 Parse Caption Output JSON  \n  Ensures captions and CTAs follow the required JSON schema.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "661dc5ba-5c0c-4f57-be13-729f5e0c4b13",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 720,
        "content": "## #\ufe0f\u20e3 High-Performing Hashtag Generation\nCreates a targeted set of 12\u201318 discovery-optimized hashtags.\n\n\u2022 Generate Hashtag Set Using AI  \n  Builds a hashtag mix (broad + niche) tailored to the product.\n\n\u2022 LLM Engine for Hashtag Generation  \n  Provides the GPT-4o model optimized for social growth strategy.\n\n\u2022 Parse Hashtag Output JSON  \n  Validates hashtags and ensures JSON output is clean.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "eefefa58-31e4-43c9-91b1-554ab8c1d61e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -880
      ],
      "parameters": {
        "color": 7,
        "width": 1248,
        "height": 432,
        "content": "## \ud83c\udfa8 AI Image Generation for Campaign Posts\nCreates high-quality visual assets for each campaign post.\n\n\u2022 Split Campaign Posts for Image Generation  \n  Breaks the posts array into individual items for image generation.\n\n\u2022 Generate Social Media Image Using AI  \n  Uses DALL\u00b7E 3 to create vivid, ultra-realistic brand-specific visuals.\n\n\u2022 Upload Generated Image to Cloudinary  \n  Hosts the generated image and returns a secure public URL.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "73715b8d-e0a4-421d-8c68-e657446db0b0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 736,
        "content": "## \ud83d\udd52 Optimal Posting Schedule Generation\nDetermines the best posting times for each platform.\n\n\u2022 Generate Optimal Posting Schedule Using AI  \n  Selects highest-engagement times for each platform (IST timezone).\n\n\u2022 LLM Engine for Posting Schedule  \n  Powers the scheduling intelligence using GPT-4o.\n\n\u2022 Parse Posting Schedule Output JSON  \n  Ensures the schedule matches strict schema and is ready for use.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "88819ce9-ece5-4d06-ba35-56240e50fcb0",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        -368
      ],
      "parameters": {
        "color": 7,
        "width": 1008,
        "height": 528,
        "content": "## \ud83d\udce6 Assemble Final Campaign Package\nCombines all elements \u2014 images, captions, hashtags, schedule \u2014 into a unified payload.\n\n\u2022 Combine All Campaign Assets  \n  Merges outputs from captions, hashtags, images, and scheduling nodes.\n\n\u2022 Prepare Final Campaign Package JSON  \n  Formats final JSON containing images, captions, hashtags, and posting schedule.\n\n\u2022 Send Final Campaign Package to Slack  \n  Sends a beautifully formatted campaign package to your Slack channel.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "33f76b4f-c9de-4f17-be4a-8b9545d84186",
      "name": "Error Handler Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -816,
        1136
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b3a750db-193c-4772-bc7a-8982ffd4bc9c",
      "name": "Slack: Send Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -464,
        1136
      ],
      "parameters": {
        "text": "=\u274c *Error in API Error Catalog Workflow* *Node:* {{ $json.node.name }} *Message:* {{ $json.error.message }} *Time:* {{ $json.timestamp }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09GNB90TED",
          "cachedResultName": "general-information"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "45d5e615-b35c-4e02-89e0-09a33909ba72",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 336,
        "content": "## \ud83d\udea8 Error Handling \n\n \nCatches any workflow failure and posts an alert to Slack.  \nIncludes node name, error message, and timestamp for quick debugging.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "14e66d8a-c4db-464b-ab72-032f1b960166",
  "connections": {
    "Error Handler Trigger": {
      "main": [
        [
          {
            "node": "Slack: Send Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Caption Output JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Instagram Captions Using AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Parse Hashtag Output JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Hashtag Set Using AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Combine All Campaign Assets": {
      "main": [
        [
          {
            "node": "Prepare Final Campaign Package JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Hashtag Set Using AI": {
      "main": [
        [
          {
            "node": "Generate Optimal Posting Schedule Using AI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine All Campaign Assets",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Parse Campaign Blueprint JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Campaign Blueprint Using AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Caption Writing": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Instagram Captions Using AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Posting Schedule": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Optimal Posting Schedule Using AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Campaign Blueprint": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Campaign Blueprint Using AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Hashtag Generation": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Hashtag Set Using AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse Posting Schedule Output JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Optimal Posting Schedule Using AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Final Campaign Package JSON": {
      "main": [
        [
          {
            "node": "Send Final Campaign Package to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Product Details via Webhook": {
      "main": [
        [
          {
            "node": "Clean & Normalize Product Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Campaign Blueprint Using AI": {
      "main": [
        [
          {
            "node": "Generate Instagram Captions Using AI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Campaign Posts for Image Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Instagram Captions Using AI": {
      "main": [
        [
          {
            "node": "Generate Hashtag Set Using AI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine All Campaign Assets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate Social Media Image Using AI": {
      "main": [
        [
          {
            "node": "Upload Generated Image to Cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Generated Image to Cloudinary": {
      "main": [
        [
          {
            "node": "Combine All Campaign Assets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean & Normalize Product Input Fields": {
      "main": [
        [
          {
            "node": "Generate Campaign Blueprint Using AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Campaign Posts for Image Generation": {
      "main": [
        [
          {
            "node": "Generate Social Media Image Using AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Optimal Posting Schedule Using AI": {
      "main": [
        [
          {
            "node": "Combine All Campaign Assets",
            "type": "main",
            "index": 3
          }
        ]
      ]
    }
  }
}