{
  "name": "Wix Blog Post",
  "nodes": [
    {
      "parameters": {
        "toolDescription": "Use this tool to search the web. ",
        "method": "POST",
        "url": "https://api.tavily.com/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"query\": \"{searchTerm}\",\n  \"topic\": \"general\",\n  \"search_depth\": \"advanced\",\n  \"chunks_per_source\": 3,\n  \"max_results\": 1,\n  \"time_range\": null,\n  \"days\": 7,\n  \"include_answer\": true,\n  \"include_raw_content\": false,\n  \"include_images\": false,\n  \"include_image_descriptions\": false,\n  \"include_domains\": [],\n  \"exclude_domains\": []\n}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "searchTerm",
              "description": "What the user is searching for. "
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1.1,
      "position": [
        -1280,
        500
      ],
      "id": "21facff8-7289-4099-97ab-fc2e879d0d20",
      "name": "Tavily",
      "credentials": {
        "httpHeaderAuth": {
          "id": "LZ1q0rTnk5xZrbCE",
          "name": "Tavily - Blog Poster"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Blog Post: \n{{ $json.output }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=# Overview\nYou are an AI agent that transforms blog posts into visual prompt descriptions for generating graphic marketing materials. These visuals are designed to be paired with the post, helping communicate the message in a visually engaging, brand-aligned way.\n\n## Objective:\n- Read and analyze the given blog post.\n- Identify the main message, insight, or takeaway from the post.\n- Create a clear and compelling graphic prompt that can be used with a text-to-image generator.\n- The result should be a marketing-style graphic — not a literal scene or hyperrealistic photo — that:\n1) Visually supports or illustrates the key idea of the post\n2) Looks appropriate for use in a professional LinkedIn feed\n3) Feels polished, modern, and engaging\n\n## Output Instructions:\n- Output two fields: \n1) title (2-4 words) \n2) prompt\n- Output only the final image prompt. Do not output quotation marks.\n- Do not repeat or rephrase the blog post.\n- Do not add any explanations or extra content — just the image prompt.\n- Never leave things blank like \"Header area reserved for customizable callout text\"\n- Output numeric stats when available in the original post\n\n## Style Guidelines:\n- Think like a brand designer or marketing creative.\n- Visuals may include: text, charts, icons, abstract shapes, overlays, modern illustrations, motion-like effects, bold typography elements (described, not rendered), or metaphorical concepts.\n- You can mention layout suggestions (e.g., \"split screen design,\" \"header with bold title and subtle background illustration\").\n- Assume the output will be generated using AI image tools — your prompt should guide those tools effectively.\n\n## Example Prompt Format:\nA modern flat-style graphic showing a human brain connected to mechanical gears, representing the fusion of AI and automation. Minimalist background, soft gradients, clean sans-serif text placement space at the top.\n\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        -860,
        220
      ],
      "id": "e6bdad97-f828-4f20-b73f-d3872066aa36",
      "name": "Image Prompt Agent"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/generations",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "={{ $('Image Prompt Agent').item.json.output.prompt.replace(/\"/g, '') }}"
            },
            {
              "name": "size",
              "value": "1024x1024"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -180,
        220
      ],
      "id": "3b828926-60ed-4a0d-89e9-b7f32206d436",
      "name": "Generate Image",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BlFWrcIzOrYdCYrU",
          "name": "OpenAI Header Auth - LinkedIn - Nate Herk"
        }
      }
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        20,
        220
      ],
      "id": "321bf88b-b3d4-409d-abf8-556ae5b0264e",
      "name": "Convert to Binary"
    },
    {
      "parameters": {
        "content": "# Content Generation",
        "height": 260,
        "width": 380
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1360,
        120
      ],
      "id": "19d5ec47-ea68-45dc-add2-c5e9bd132beb",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "# Generate Image\n",
        "height": 260,
        "width": 460,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -260,
        120
      ],
      "id": "ba183917-9760-4aef-b684-d9c5a6947cf3",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# Image Prompt\n",
        "height": 260,
        "width": 440,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -960,
        120
      ],
      "id": "449699c0-8508-4523-bbd6-0642215c9b52",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Brain",
        "height": 240,
        "width": 380,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1360,
        400
      ],
      "id": "74665f5f-a6b8-493f-b7c4-be7cccbcd03d",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "blogTopic"
            },
            {
              "name": "targetAudience"
            },
            {
              "name": "chatID"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -1560,
        220
      ],
      "id": "4bfebbc2-9e91-4213-a62f-4bed41d05ae2",
      "name": "When Executed by Another Workflow",
      "disabled": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Topic of Blog: {{ $json.blogTopic }}\n\nTarget Audience: {{ $json.targetAudience }}",
        "options": {
          "systemMessage": "=# Overview\nYou are an AI agent specialized in creating professional, educational, and engaging blog articles based on any topic provided by the user.\n\n## Contraints\nArticles must not exeed 4000 characters \n\n## Objectives:\nAlways begin by conducting a real-time search using the Tavily tool to gather the most accurate, up-to-date information on the topic. The blog article should be written to appeal to the provided target audience.\n\nBased on your research, generate a well-structured blog post that:\n- Starts with an engaging and informative introduction that sets up the importance of the topic\n- Maintains a professional, clear, and easy-to-read tone\n- Is educational, insightful, and provides depth\n- Uses headers, subheaders, and paragraphs to create good readability\n- Incorporates real data, examples, or case studies, properly attributing sources (e.g., “according to [source]”)\n- Light on emojis (use only if highly relevant and minimal)\n- Includes a natural conclusion that summarizes key takeaways\n- (Optional but encouraged) Suggests next steps for the reader, such as related articles, resources, or actionable advice\n\n## Output Instructions:\n- Your ONLY output should be the final blog article text.\n- Do not include explanations, notes, or anything beyond the blog content itself.\n\n## Example Workflow:\n1) Receive a topic (e.g., “The ROI of warehouse automation”)\n2) Use Tavily to search and gather recent information, studies, or examples\n3) Draft a blog post using that research\n4) Format it with an engaging intro, structured sections, source citations, and a natural conclusion"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        -1300,
        220
      ],
      "id": "e47897f2-daeb-4045-a26b-470ed9bd39cd",
      "name": "Blog Post Agent"
    },
    {
      "parameters": {
        "content": "## Structured Output",
        "height": 240,
        "width": 400,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -960,
        400
      ],
      "id": "4ef211f6-ddd0-4549-bb32-8689298357de",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "# Trigger\n",
        "height": 260,
        "width": 260,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1640,
        120
      ],
      "id": "fffb6dc5-ea9b-4ef8-85ea-6e009e05fb58",
      "name": "Sticky Note5",
      "disabled": true
    },
    {
      "parameters": {
        "content": "## Post to Wix",
        "height": 260,
        "width": 560,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        220,
        120
      ],
      "id": "bc689616-8a82-4060-bcf7-661078b664e4",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "model": "openai/o3-mini",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -1140,
        500
      ],
      "id": "08b4b51c-de95-4a57-8751-df57bcf26cc2",
      "name": "GPT_o3-mini",
      "credentials": {
        "openRouterApi": {
          "id": "vJi4UqIDb0uv9Er9",
          "name": "OpenRouter account - LinkedIn Nate Herk"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.wixapis.com/site-media/v1/files/generate-upload-url",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "wix-site-id",
              "value": "a3a97ced-edad-4891-ad9b-22dd5da37ae7"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "mimeType",
              "value": "={{ $('Image Prompt Agent').item.json.output.mimeType }}"
            },
            {
              "name": "fileName",
              "value": "={{ $('Image Prompt Agent').item.json.output.imageFileName }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -440,
        220
      ],
      "id": "6da8a279-5a54-47f9-977b-ef451c79c944",
      "name": "Generate Upload URL2",
      "credentials": {
        "oAuth2Api": {
          "id": "SXGZrsXKDHn9KD6c",
          "name": "Xero - Oauth2"
        },
        "httpHeaderAuth": {
          "id": "OJzgcsl3Q6KOxGEk",
          "name": "Wix - HybrIT NZ"
        }
      }
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "={{ $('Generate Upload URL2').item.json.uploadUrl }}",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "filename",
              "value": "={{ $('Image Prompt Agent').item.json.output.imageFileName }}"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "={{  $('Convert to Binary').item.binary.data.mimeType }}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        280,
        220
      ],
      "id": "6ad29ad8-0c67-4703-9756-5108c350502d",
      "name": "Upload Image"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.wixapis.com/blog/v3/draft-posts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "wix-site-id",
              "value": "a3a97ced-edad-4891-ad9b-22dd5da37ae7"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"draftPost\": {\n    \"title\": \"{{ $('Image Prompt Agent').item.json.output.title }}\",\n    \"seoSlug\":\"{{ $('Image Prompt Agent').item.json.output.seoSlug }}\",\n    \"seoData\": {\n      \"tags\": [\n        {\n          \"type\": \"meta\",\n          \"props\": {\n            \"name\": \"description\",\n            \"content\": \"{{ $('Image Prompt Agent').item.json.output.seoMetaDescription }}\"\n          }\n        }\n      ]\n    },\n    \"memberId\": \"12278993-6945-4d28-af2b-a061bce3e538\",\n    \"media\": {\n      \"displayed\": true,\n      \"wixMedia\": {\n        \"image\": {\n          \"id\": \"{{ $('Upload Image').item.json.file.id }}\",\n          \"altText\": \"{{ $('Image Prompt Agent').item.json.output.altText }}\"\n        }\n      }\n    },\n    \"richContent\": {\n      \"nodes\": [\n        {\n          \"type\": \"IMAGE\",\n          \"nodes\": [],\n          \"imageData\": {\n            \"altText\": \"{{ $('Image Prompt Agent').item.json.output.altText }}\",\n            \"containerData\": {\n              \"alignment\": \"CENTER\",\n              \"textWrap\": true,\n              \"width\": {\n                \"size\": \"CONTENT\"\n              }\n            },\n            \"image\": {\n              \"height\":\"1024\",\n              \"width\":\"1024\",\n              \"src\": {\n                \"id\": \"{{ $('Upload Image').item.json.file.id }}\"\n              }\n            }\n          }\n        },\n        {\n          \"type\": \"PARAGRAPH\",\n          \"nodes\": [\n            {\n              \"type\": \"TEXT\",\n              \"textData\": { \"text\": \"{{ $('Blog Post Agent').item.json.output.replace(/\\r?\\n/g, \"\\\\n\") }}\", \n              \"decorations\": [] }\n            }\n          ],\n          \"paragraphData\": {}\n        }\n      ]\n    },\n    \"heroImage\": {\n      \"id\": \"{{ $('Upload Image').item.json.file.id }}\",\n      \"altText\": \"{{ $('Image Prompt Agent').item.json.output.altText }}\"\n    }\n  },\n  \"fieldsets\": [\"URL\", \"RICH_CONTENT\"]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        540,
        220
      ],
      "id": "3a259725-e9c8-406f-b19f-00ef8c96725d",
      "name": "Create Draft Blog Post",
      "credentials": {
        "oAuth2Api": {
          "id": "SXGZrsXKDHn9KD6c",
          "name": "Xero - Oauth2"
        },
        "httpHeaderAuth": {
          "id": "OJzgcsl3Q6KOxGEk",
          "name": "Wix - HybrIT NZ"
        }
      }
    },
    {
      "parameters": {
        "content": "## Post to Wix",
        "height": 260,
        "width": 220,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -500,
        120
      ],
      "id": "5eef51ca-3128-46d8-8248-06b86f292a03",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"title\": \"<2-4 word creative title for the image>\",\n  \"prompt\": \"<full detailed image generation prompt>\",\n  \"imageFileName\": \"<file name for generated image>\",\n  \"mimeType\": \"<mimeType to match image e.g. image/png>\",\n  \"altText\": \"<alt text to mate the generated image>\",\n  \"seoSlug\": \"<create an seo slug to match the Article title with hyphens to replace the spaces>\",\n  \"seoMetaTitle\":\"<Create a suitable meta title between between 50-60 characters>\",\n  \"seoMetaDescription\":\"<set suitable meta description for google between 130-160 characters>\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        -740,
        500
      ],
      "id": "3d6adf3c-98a9-41ba-be5e-457b265171ed",
      "name": "Structured Output"
    },
    {
      "parameters": {
        "formTitle": "Blog Idea Form",
        "formDescription": "Fill in the blog topic and target audience to automatically create an SEO optimised draft blog post in Wix",
        "formFields": {
          "values": [
            {
              "fieldLabel": "blogTopic",
              "requiredField": true
            },
            {
              "fieldLabel": "targetAudience",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -1580,
        480
      ],
      "id": "95815f45-fac9-49f2-971d-2941e5aac9c5",
      "name": "On form submission",
      "webhookId": "c037b804-3380-40c4-852d-ea9903280ac1"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1600,
        800
      ],
      "id": "e75f1b29-b617-4319-b507-7bf2eeeb60ce",
      "name": "When clicking ‘Test workflow’",
      "disabled": true
    },
    {
      "parameters": {
        "url": "https://www.wixapis.com/members/v1/members",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "wix-site-id",
              "value": "a3a97ced-edad-4891-ad9b-22dd5da37ae7"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1300,
        800
      ],
      "id": "29353545-30bd-4334-a1d6-44a8d1c812e4",
      "name": "Get Members (Blog Author ID)",
      "credentials": {
        "oAuth2Api": {
          "id": "SXGZrsXKDHn9KD6c",
          "name": "Xero - Oauth2"
        },
        "httpHeaderAuth": {
          "id": "OJzgcsl3Q6KOxGEk",
          "name": "Wix - HybrIT NZ"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "content": "## Get Member ID Currently Hard Coded in Blog Post Node",
        "height": 300,
        "width": 600
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1640,
        700
      ],
      "id": "f6956453-2aa7-42d7-a742-2c1ca28c2c4b",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "## Setup\n\n### Download and Import The workflow\n\n### Hook up Credentials\n- Taviliy API Key\n- Open Router API Key\n- Wix API Key\n- O\n\n### Get Details for Blog Posting\n\n- Get Site ID (from browser URL)\n- Get Member ID of the Blog Author (Using the members api endpoint)\n",
        "height": 440,
        "width": 320,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2020,
        120
      ],
      "id": "98794196-08fa-4a95-b02f-19b719413db8",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "content": "## Possible Enhancements\n\n### Blog Formating\n- Update the prompt and structured output of the Post Agent to handle Wix formatting better\n- Structure the JSON content to match the structured output so that the blog is not a single paragraph\n\n",
        "height": 400,
        "width": 320,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2020,
        600
      ],
      "id": "821f5378-06f3-45ba-82cd-06eb86246a6e",
      "name": "Sticky Note10"
    }
  ],
  "pinData": {},
  "connections": {
    "Tavily": {
      "ai_tool": [
        [
          {
            "node": "Blog Post Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Agent": {
      "main": [
        [
          {
            "node": "Generate Upload URL2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Convert to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Blog Post Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Post Agent": {
      "main": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Binary": {
      "main": [
        [
          {
            "node": "Upload Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT_o3-mini": {
      "ai_languageModel": [
        [
          {
            "node": "Blog Post Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Image Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Upload URL2": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image": {
      "main": [
        [
          {
            "node": "Create Draft Blog Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Blog Post Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get Members (Blog Author ID)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "474d2e38-896d-4d16-825f-a02f06558560",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": ""
  },
  "id": "mHDcBRJ97MPf6jwD",
  "tags": []
}