{
  "id": "t3iFGaDp5WlaLL9P",
  "name": "Brand Content Automation for Instagram using Seedream 4.0",
  "tags": [],
  "nodes": [
    {
      "id": "1cb52f2a-be19-482a-93bd-6cdfa488e987",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        1280
      ],
      "parameters": {
        "color": 7,
        "width": 1360,
        "height": 400,
        "content": "## STEP  3 -  Generate image\nGet your [Kie API Key](https://kie.ai?ref=188b79f5cb949c9e875357ac098e1ff5) for FREE and set Bearer Token"
      },
      "typeVersion": 1
    },
    {
      "id": "43599702-9000-4f10-886b-d7422afd88b3",
      "name": "Social Media Manager",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1280,
        976
      ],
      "parameters": {
        "text": "=Generate social content to the following text with title \"{{ $json.PROMPT }}\" ",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a social media content expert specialized in creating engaging posts for Instagram.\n\nYour goal is to generate platform-optimized content that reflects the company's expertise, providing value-driven insights, tutorials, reviews, and discussions that resonate with tech professionals, enthusiasts, and businesses.\n\n## Content Creation Guidelines\n\n- **Tone**: Professional yet approachable, inspiring trust and authority in the tech space.\n- **SEO & Hashtags**: Use a balanced mix of broad and niche hashtags to maximize reach and discoverability.\n- **Engagement focus**: Prioritize tech tutorials, IT industry updates, comparisons, reviews, and discussions that spark interaction.\n- **Consistency**: Maintain a coherent visual identity and voice, tailored to the platform's audience.\n\n## Platform Requirements\n\n### Instagram\n- **Style**: Visual storytelling\n- **Tone**: Inspiring and engaging\n- **Length**: 2\u20133 sentences maximum, paired with creative captions and relevant emojis\n- **Call to action**: Use phrases like \"Swipe to see more\", \"Tag your coworkers\", or \"Celebrate with us!\"\n- **Hashtags**: Include 10\u201315 hashtags relevant to the topic and audience\n\n## Output Format\n\nYou MUST return ONLY a valid JSON array. Do not include any explanation, markdown, or text outside the JSON.\n\nThe array must contain exactly one object per input, following this structure:\n\n[\n  {\n    \"instagram\": \"Post caption with emojis and hashtags\"\n  }\n]\n\nIf multiple inputs are provided, return one object per input inside the same array."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "0587528d-88d9-4278-9cff-91aedced3775",
      "name": "Instagram",
      "type": "n8n-nodes-postiz.postiz",
      "position": [
        3296,
        1216
      ],
      "parameters": {
        "date": "={{ $now.format('yyyy-LL-dd') }}T{{ $now.format('HH:ii:ss') }}",
        "type": "schedule",
        "posts": {
          "post": [
            {
              "value": {
                "contentItem": [
                  {
                    "image": {
                      "imageItem": [
                        {
                          "id": "={{ $json.id }}",
                          "path": "={{ $json.path }}"
                        }
                      ]
                    },
                    "content": "={{ $('Get caption').item.json.instagram }}"
                  }
                ]
              },
              "settings": {
                "setting": [
                  {
                    "key": "__type",
                    "stringValue": "instagram"
                  },
                  {
                    "key": "post_type",
                    "stringValue": "post"
                  }
                ]
              },
              "integrationId": "cmey1h1dz007onx0ynxb3e8ag"
            }
          ]
        },
        "shortLink": true
      },
      "credentials": {
        "postizApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cdd5c8db-be86-413f-a201-683a505008e0",
      "name": "Upload IG Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3072,
        1216
      ],
      "parameters": {
        "url": "https://api.postiz.com/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bb9625fa-f928-4b70-b62e-83f6b9b16165",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1248,
        1152
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d56fca7d-c0c7-402a-940c-b1c5efe6552c",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        288,
        1216
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c7658f09-c116-4d84-ba17-b29a60fa3666",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2752,
        1216
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "f06107e8-1abd-4d26-8b26-2b3bf1ca7383",
      "name": "Set params",
      "type": "n8n-nodes-base.set",
      "position": [
        592,
        1216
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bdd6f0e5-1a05-4825-92ba-32bd327ba936",
              "name": "PROMPT",
              "type": "string",
              "value": "Refer to this logo and create a single visual showcase for an outdoor sports brand named \u2018KIE AI\u2019. Display five branded items together in one image: a packaging bag, a hat, a carton box, a wristband, and a lanyard. Use blue as the main visual color, with a fun, simple, and modern style."
            },
            {
              "id": "018d35fa-9296-4ec4-8759-5828e265a595",
              "name": "IMAGES",
              "type": "string",
              "value": "https://file.aiquickdraw.com/custom-page/akr/section-images/1757930552966e7f2on7s.png"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4029dfed-a56a-4f1d-8800-df56ad1f41dc",
      "name": "Normalize",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        1216
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n  const prompt = item.json.PROMPT;\n  const imagesRaw = item.json.IMAGES;\n\n  // Splitta le URL per virgola e pulisce gli spazi\n  const imagesArray = imagesRaw\n    .split(',')\n    .map(url => url.trim())\n    .filter(url => url.length > 0);\n\n  results.push({\n    json: {\n      PROMPT: prompt,\n      IMAGES: JSON.stringify(imagesArray),\n    }\n  });\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "d72297d4-2ca8-4b34-87e7-4f7761df228f",
      "name": "Get caption",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        976
      ],
      "parameters": {
        "jsCode": "const text = $input.first().json.text;\n\nconst cleaned = text.trim();\n\nconst parsed = JSON.parse(cleaned);\n\nreturn parsed.map(item => ({ json: item }));"
      },
      "typeVersion": 2
    },
    {
      "id": "a49a92a6-5048-40c0-a6ab-952b72beff51",
      "name": "Get ImageUrl",
      "type": "n8n-nodes-base.code",
      "position": [
        2048,
        1424
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n  const resultJson = JSON.parse(item.json.data.resultJson);\n  const imageUrl = resultJson.resultUrls[0];\n\n  results.push({\n    json: {\n      imageUrl: imageUrl,\n    }\n  });\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "4b16a652-8543-4c61-9ed1-d2f260d257cf",
      "name": "Get Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2336,
        1424
      ],
      "parameters": {
        "url": "={{ $json.imageUrl }}",
        "options": {}
      },
      "typeVersion": 4.4
    },
    {
      "id": "bf750788-6c39-4b7d-854d-534256b1be79",
      "name": "Seedream 4.0 Edit",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        1424
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/jobs/createTask",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"bytedance/seedream-v4-edit\",\n  \"callBackUrl\": \"{{ $execution.resumeUrl }}\",\n  \"input\": {\n    \"prompt\": \"{{ $json.PROMPT }}\",\n    \"image_urls\": {{ $json.IMAGES }},\n    \"image_size\": \"square_hd\",\n    \"image_resolution\": \"1K\",\n    \"max_images\": 1,\n    \"nsfw_checker\": true\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "d9a49254-632e-4d56-81f4-f314a2c18d12",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2976,
        1088
      ],
      "parameters": {
        "color": 7,
        "width": 576,
        "height": 352,
        "content": "## STEP  4 -  Postiz\nGet your [Postiz API Key](https://postiz.pro/n3witalia) for FREE and set Token"
      },
      "typeVersion": 1
    },
    {
      "id": "ed54d6b4-f0dd-4f2c-ad41-c888e990a611",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1536,
        1424
      ],
      "parameters": {
        "resume": "webhook",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "14a20d8b-90b0-4016-96bf-4797d0b75a05",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        1072
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 352,
        "content": "## STEP  1 - Set vars\nInitial prompt and start image(s) separated with comma"
      },
      "typeVersion": 1
    },
    {
      "id": "bb542001-9d9e-4881-ba12-6b69e6a33a1b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        864
      ],
      "parameters": {
        "color": 7,
        "width": 1360,
        "height": 400,
        "content": "## STEP  2 - Social Media Manager\nGenerate caption for Instagram\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fdb24945-4dab-4055-8646-f8170bd20bfb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        336
      ],
      "parameters": {
        "width": 736,
        "height": 496,
        "content": "## AI Marketing Brand Content Automation for Instagram using Seedream 4.0 & Postiz\nThis workflow is designed to fully automate the creation and publishing of Instagram marketing content by combining AI-powered text generation, image creation, and social media scheduling into a single streamlined pipeline.\n\n### How it works\n\nThis workflow automates Instagram content production from a prompt and reference image input through to final publishing. After a manual trigger, it sets the creative prompt and logo/reference image, normalizes image URLs, and then splits into two parallel branches: one generates the branded visual through Kie AI Seedream 4.0 with async wait/resume handling, while the other uses an OpenAI chat model and a Social Media Manager chain to generate an Instagram-ready caption with emojis and hashtags. The workflow then merges the finished image and caption, uploads the image to Postiz, and schedules or publishes the post to Instagram.\n\n### Setup steps\n\nAdd and verify the required credentials for OpenAI, Kie AI, and Postiz before testing the workflow. Optionally update the `Set params` node to change the image prompt, confirm the `Wait` node\u2019s resume webhook is reachable for async image generation, and check that the Instagram/Postiz integration ID is correct. If you want automated scheduling instead of manual testing, replace the Manual Trigger with a schedule trigger. Run a manual execution first to validate the full flow from prompt generation to image creation, caption output, upload, and Instagram publishing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d2afaa5e-6c7c-4f20-942d-ad763c173805",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        -32
      ],
      "parameters": {
        "width": 576,
        "height": 864,
        "content": "### BEFORE:\n![image](https://file.aiquickdraw.com/custom-page/akr/section-images/1757930552966e7f2on7s.png) \n\n### AFTER:\n ![image](https://file.aiquickdraw.com/custom-page/akr/section-images/1757930760810t07o2esg.png) "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "447e6c65-61c6-4d94-9468-4c6fce40f485",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get ImageUrl",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Upload IG Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Normalize": {
      "main": [
        [
          {
            "node": "Seedream 4.0 Edit",
            "type": "main",
            "index": 0
          },
          {
            "node": "Social Media Manager",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set params": {
      "main": [
        [
          {
            "node": "Normalize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get caption": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get ImageUrl": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload IG Image": {
      "main": [
        [
          {
            "node": "Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Social Media Manager",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Seedream 4.0 Edit": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Social Media Manager": {
      "main": [
        [
          {
            "node": "Get caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Set params",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}