{
  "id": "s4PsHeDovyndd10O",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Generate and Publish WordPress Blog Posts with AI",
  "tags": [
    {
      "id": "Fur9Q2nIpUv2w23M",
      "name": "triple8labs",
      "createdAt": "2026-06-07T20:22:00.276Z",
      "updatedAt": "2026-06-07T20:22:00.276Z"
    }
  ],
  "nodes": [
    {
      "id": "ab513b9b-fcd7-4d76-b90f-d863fad5b9e5",
      "name": "Sticky Note 586d2dc7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 808,
        "height": 692,
        "content": "## Generate a draft SEO-optimised article on your Wordpress site\n\n### How it works\n\nSend a brief via webhook and Claude AI writes the article, Imagen 4 generates a featured image, a WordPress draft is created with Rank Math SEO set and a Slack notification is sent on completion with a link to the draft for review.\n\n**Activate the workflow** then POST to `/webhook/article-publisher`:\n```\n{ \"prompt\": \"Write an article about...\" }\n```\nOptional body fields: `category_id`, `tone_guide`, `style_guide`\n\n### Setup\n\n**1. Update the CONFIG node** with your:\n- `WORDPRESS_URL` \u2014 your WordPress site URL\n- `DEFAULT_CATEGORY_ID` \u2014 default category ID for new posts \n- `AUTHOR_ID` \u2014 WordPress user ID to assign as post author\n- `SLACK_CHANNEL` \u2014 your Slack channel ID (e.g. C0123456789)\n- `TONE_GUIDE` \u2014 your writing voice and persona (overridable per request)\n- `STYLE_GUIDE` \u2014 your article structure preferences (overridable per request)\n- `IMAGE_STYLE_PROMPT` \u2014 style prefix (prepended to every image prompt if image generation is enabled)\n- `WEBHOOK_SECRET` \u2014 optional Bearer token to secure the endpoint (leave blank to disable)\n\n**2. Link credentials** in every HTTP Request node:\n- Anthropic API \u2192 GENERATE ARTICLE CONTENT\n- Google AI (PaLM) API \u2192 GENERATE IMAGE\n- WordPress API \u2192 UPLOAD IMAGE, SET IMAGE ALT TEXT, UPSERT TAG, CREATE POST, SET RANK MATH SEO\n- Slack OAuth2 \u2192 SLACK NOTIFICATION\n\n### Customization\n**(Optional) Rank Math SEO:** Install the mu-plugin on your WordPress site to allow writing SEO fields via the REST API. See template docs."
      },
      "typeVersion": 1
    },
    {
      "id": "24df04db-8694-4386-9658-a91d20449129",
      "name": "Sticky Note 98f2054a",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        480
      ],
      "parameters": {
        "color": 5,
        "width": 572,
        "height": 220,
        "content": "### Image Generation (optional)\n\nSet `ENABLE_IMAGE_GENERATION` to `false` in CONFIG to skip.\n\nWhen enabled, Google Imagen 4 generates a 16:9 featured image.\nThe filename and alt text are derived from the focus keyword.\n\nRequires a Google AI (PaLM) API credential with Imagen 4 access."
      },
      "typeVersion": 1
    },
    {
      "id": "d064164d-d7f6-4d90-bb14-4d6b2b0e6c3c",
      "name": "Sticky Note 70f09bc0",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        480
      ],
      "parameters": {
        "color": 5,
        "width": 520,
        "height": 220,
        "content": "### Rank Math SEO (optional)\n\nSets focus keyword, SEO title, and meta description via the WordPress REST API.\n\nRequires the Rank Math plugin plus a custom mu-plugin to expose\nthe `rank_math_*` meta fields to the REST API.\n\nPlace `rank-math-rest.php` in `/wp-content/mu-plugins/`.\nFull plugin code is in the template documentation."
      },
      "typeVersion": 1
    },
    {
      "id": "b25d55fe-0230-4c79-96df-669abeb16097",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        96,
        1008
      ],
      "parameters": {
        "path": "article-publisher",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "3b22afac-e15d-4589-9921-245ca3788444",
      "name": "CONFIG",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        1008
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "WORDPRESS_URL",
              "type": "string",
              "value": "https://your-wordpress-site.com"
            },
            {
              "id": "2",
              "name": "DEFAULT_CATEGORY_ID",
              "type": "string",
              "value": "1"
            },
            {
              "id": "3",
              "name": "SLACK_CHANNEL",
              "type": "string",
              "value": ""
            },
            {
              "id": "4",
              "name": "AUTHOR_ID",
              "type": "string",
              "value": "1"
            },
            {
              "id": "5",
              "name": "ENABLE_IMAGE_GENERATION",
              "type": "string",
              "value": "true"
            },
            {
              "id": "6",
              "name": "IMAGE_STYLE_PROMPT",
              "type": "string",
              "value": "Flat design illustration, clean modern lines, no text, blog post featured image displayed full width at top in landscape orientation. Subject: "
            },
            {
              "id": "7",
              "name": "TONE_GUIDE",
              "type": "string",
              "value": "Write in first person as [Your Name/Persona]. [Describe your background briefly].\n\nVoice: [Describe your preferred tone \u2014 e.g. direct and warm, no hype, no filler openers]. Short declarative sentences mixed with longer ones for rhythm.\n\nFrame content as: here is what I tried, here is what I found, here is how you might apply it. Acknowledge trade-offs honestly.\n\nReader: [Describe your target audience \u2014 e.g. semi-technical professionals running their own projects].\n\n[Your site/brand name]: [Brief description of your site purpose and angle]."
            },
            {
              "id": "8",
              "name": "STYLE_GUIDE",
              "type": "string",
              "value": "Structure every article as follows:\n- Opening paragraph: start with an observation or friction point.\n- H2 sections for main topics, H3 for subsections where needed.\n- Use bullet lists sparingly \u2014 only for genuine lists of 3+ parallel items. Never use bullets to avoid writing proper sentences.\n- Tables for comparisons, not bullets.\n- Closing paragraph: one concrete takeaway or honest assessment. No \"In conclusion\" or summary restatement.\n- Do not use bold text for decoration. Bold only for genuinely critical terms or warnings.\n- Do not end sections with transition phrases like \"Lets explore...\" or \"Read on to find out...\".\n- Ideal length: 800-1400 words for most articles. Go longer only if the topic genuinely requires it."
            },
            {
              "id": "9",
              "name": "WEBHOOK_SECRET",
              "type": "string",
              "value": ""
            },
            {
              "id": "10",
              "name": "CLAUDE_MODEL",
              "type": "string",
              "value": "claude-sonnet-4-20250514"
            },
            {
              "id": "11",
              "name": "IMAGEN_MODEL",
              "type": "string",
              "value": "imagen-4.0-fast-generate-001"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6953d127-960a-4ab6-8f18-6d3530a6f564",
      "name": "VALIDATE AUTH",
      "type": "n8n-nodes-base.if",
      "position": [
        544,
        1008
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "1",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('CONFIG').item.json.WEBHOOK_SECRET }}",
              "rightValue": ""
            },
            {
              "id": "2",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Webhook').item.json.headers.authorization ?? '' }}",
              "rightValue": "={{ 'Bearer ' + $('CONFIG').item.json.WEBHOOK_SECRET }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3de89537-df8d-455a-9ea1-d19490dcaabd",
      "name": "PREPARE INPUT",
      "type": "n8n-nodes-base.set",
      "position": [
        768,
        912
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "prompt",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.prompt }}"
            },
            {
              "id": "2",
              "name": "title_override",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.title ?? '' }}"
            },
            {
              "id": "3",
              "name": "content_override",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.content ?? '' }}"
            },
            {
              "id": "4",
              "name": "category_id",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.category_id ?? $('CONFIG').item.json.DEFAULT_CATEGORY_ID }}"
            },
            {
              "id": "5",
              "name": "tone_guide",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.tone_guide ?? $('CONFIG').item.json.TONE_GUIDE }}"
            },
            {
              "id": "6",
              "name": "style_guide",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.style_guide ?? $('CONFIG').item.json.STYLE_GUIDE }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "487ba8e6-a16f-4906-a6b1-63484659e869",
      "name": "BUILD PROMPT",
      "type": "n8n-nodes-base.set",
      "position": [
        992,
        912
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "claude_prompt",
              "type": "string",
              "value": "=You are a content writer.\n\nTONE GUIDE:\n{{ $json.tone_guide }}\n\nSTYLE GUIDE:\n{{ $json.style_guide }}\n\nWrite an article based on this brief: {{ $json.prompt }}\n\nRequirements:\n- Follow the tone guide and style guide precisely\n- SEO title under 60 characters\n- Meta description under 155 characters\n- Tags should reference only tools and concepts actually discussed in the article\n\nReturn ONLY a valid JSON object (no markdown, no code fences), with these exact fields:\n{\n  \"title\": \"...\",\n  \"content\": \"...full HTML article body using h2, p, ul/li tags...\",\n  \"excerpt\": \"...two sentence summary...\",\n  \"tags\": [\"...\", \"...\"],\n  \"seo_title\": \"...under 60 chars...\",\n  \"seo_description\": \"...under 155 chars...\",\n  \"focus_keyword\": \"...single most important keyword phrase...\",\n  \"image_subject\": \"...one sentence describing a visual scene for the featured image...\",\n  \"affiliate_flag\": \"...note tools where affiliate links would be natural, or false if none...\"\n}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "37b2ba0f-7734-47f6-8c9f-fe5ce9865dcd",
      "name": "GENERATE ARTICLE CONTENT",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1216,
        912
      ],
      "parameters": {
        "url": "https://api.anthropic.com/v1/messages",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"model\": $('CONFIG').item.json.CLAUDE_MODEL, \"max_tokens\": 4000, \"messages\": [{ \"role\": \"user\", \"content\": $(\"BUILD PROMPT\").item.json.claude_prompt }] } }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "anthropic-version",
              "value": "2023-06-01"
            }
          ]
        },
        "nodeCredentialType": "anthropicApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "9bd81f60-faf0-4892-83c0-a70e888bc327",
      "name": "PARSE ARTICLE",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        912
      ],
      "parameters": {
        "jsCode": "const response = $input.item.json;\nconst rawText = response.content[0].text;\nconst cleaned = rawText\n  .replace(/^```json\\s*/i, '')\n  .replace(/^```\\s*/i, '')\n  .replace(/```\\s*$/i, '')\n  .trim();\ntry {\n  const article = JSON.parse(cleaned);\n  return [{\n    json: {\n      title:           article.title,\n      content:         article.content,\n      excerpt:         article.excerpt,\n      tags:            article.tags,\n      seo_title:       article.seo_title,\n      seo_description: article.seo_description,\n      focus_keyword:   article.focus_keyword || article.tags[0],\n      image_subject:   article.image_subject,\n      affiliate_flag:  article.affiliate_flag,\n    }\n  }];\n} catch (e) {\n  throw new Error('Claude response could not be parsed as JSON. Raw response: ' + rawText.substring(0, 500));\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "c818e7e1-eb8a-4e85-996b-9b8f5b03e172",
      "name": "CHECK IMAGE ENABLED",
      "type": "n8n-nodes-base.if",
      "position": [
        1664,
        912
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('CONFIG').item.json.ENABLE_IMAGE_GENERATION }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f89c0c58-b536-4556-87ca-9f0a71969dd2",
      "name": "GENERATE IMAGE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1888,
        816
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/{{ $('CONFIG').item.json.IMAGEN_MODEL }}:predict",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"instances\": [{ \"prompt\": $(\"CONFIG\").item.json.IMAGE_STYLE_PROMPT + $(\"PARSE ARTICLE\").item.json.image_subject }], \"parameters\": { \"sampleCount\": 1, \"aspectRatio\": \"16:9\" } } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "0ba7aa6c-d3f7-4111-b98f-2b55c763e8bc",
      "name": "DECODE IMAGE",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        816
      ],
      "parameters": {
        "jsCode": "const prediction = $input.item.json.predictions[0];\nconst base64 = prediction.bytesBase64Encoded;\nconst mimeType = prediction.mimeType || 'image/png';\nconst focusKeyword = $('PARSE ARTICLE').item.json.focus_keyword || 'featured';\nconst slug = focusKeyword.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/, '');\nconst filename = slug + '.png';\nconst binaryData = await this.helpers.prepareBinaryData(\n  Buffer.from(base64, 'base64'),\n  filename,\n  mimeType\n);\nreturn [{ json: { image_filename: filename }, binary: { data: binaryData } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "73ef1e22-d6e3-422d-9f75-0c6ac3971a13",
      "name": "UPLOAD IMAGE TO WORDPRESS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2336,
        816
      ],
      "parameters": {
        "url": "={{ $('CONFIG').item.json.WORDPRESS_URL }}/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "=attachment; filename=\"{{ $('DECODE IMAGE').item.json.image_filename }}\""
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "c1f7021f-f591-41f5-b8b8-67bd6947c0b2",
      "name": "SET IMAGE ALT TEXT",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2560,
        816
      ],
      "parameters": {
        "url": "={{ $('CONFIG').item.json.WORDPRESS_URL }}/wp-json/wp/v2/media/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"alt_text\": $('PARSE ARTICLE').item.json.focus_keyword } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "9b686a04-6697-4688-8687-0a16703efaef",
      "name": "SET MEDIA ID",
      "type": "n8n-nodes-base.set",
      "position": [
        2784,
        816
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "media_id",
              "type": "number",
              "value": "={{ $input.item.json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7b077f2c-44bf-495f-8fd3-835ede03a22e",
      "name": "MERGE IMAGE RESULT",
      "type": "n8n-nodes-base.merge",
      "position": [
        3008,
        912
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "7188a927-6243-457d-a344-cde91e8062cd",
      "name": "SET NO IMAGE",
      "type": "n8n-nodes-base.set",
      "position": [
        2784,
        1008
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "media_id",
              "type": "number",
              "value": "0"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "978343ee-c184-4859-a972-14aace196f75",
      "name": "REJECT REQUEST",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        768,
        1104
      ],
      "parameters": {
        "options": {
          "responseCode": 401
        },
        "respondWith": "json",
        "responseBody": "{\"error\":\"Unauthorized\"}"
      },
      "typeVersion": 1.5
    },
    {
      "id": "6f6269ff-e964-402a-904b-3038fab51083",
      "name": "SPLIT TAGS",
      "type": "n8n-nodes-base.code",
      "position": [
        3232,
        912
      ],
      "parameters": {
        "jsCode": "const tags = $('PARSE ARTICLE').item.json.tags || [];\nreturn tags.map(tag => ({ json: { tag_name: tag } }));"
      },
      "typeVersion": 2
    },
    {
      "id": "20bb29ff-957f-4d37-87d0-3b703c1724dc",
      "name": "UPSERT TAG",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3456,
        912
      ],
      "parameters": {
        "url": "={{ $('CONFIG').item.json.WORDPRESS_URL }}/wp-json/wp/v2/tags",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        },
        "jsonBody": "={{ { \"name\": $json.tag_name } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.4,
      "alwaysOutputData": true
    },
    {
      "id": "d51b00cf-c6ad-49d0-81ee-7dcac1db97e0",
      "name": "COLLECT TAG IDS",
      "type": "n8n-nodes-base.code",
      "position": [
        3680,
        912
      ],
      "parameters": {
        "jsCode": "const tagIds = $input.all().map(item => {\n  const r = item.json;\n  return r.id || (r.data && r.data.term_id) || null;\n}).filter(id => id !== null && id !== undefined && id !== 0);\nreturn [{ json: { tag_ids: tagIds } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "50edf9c5-c1f8-4ebb-97b0-89642f59dfd1",
      "name": "CREATE WORDPRESS POST",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3904,
        912
      ],
      "parameters": {
        "url": "={{ $('CONFIG').item.json.WORDPRESS_URL }}/wp-json/wp/v2/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"title\": $(\"PARSE ARTICLE\").item.json.title, \"content\": $(\"PARSE ARTICLE\").item.json.content, \"excerpt\": $(\"PARSE ARTICLE\").item.json.excerpt, \"status\": \"draft\", \"categories\": [Number($(\"PREPARE INPUT\").item.json.category_id)], \"tags\": $(\"COLLECT TAG IDS\").item.json.tag_ids, \"featured_media\": $(\"MERGE IMAGE RESULT\").item.json.media_id, \"author\": Number($(\"CONFIG\").item.json.AUTHOR_ID) } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "40f196eb-420c-4914-a569-078aa4fab4b6",
      "name": "SET RANK MATH SEO",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4320,
        912
      ],
      "parameters": {
        "url": "={{ $('CONFIG').item.json.WORDPRESS_URL }}/wp-json/wp/v2/posts/{{ $('CREATE WORDPRESS POST').item.json.id }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"meta\": { \"rank_math_focus_keyword\": $(\"PARSE ARTICLE\").item.json.focus_keyword, \"rank_math_title\": $(\"PARSE ARTICLE\").item.json.seo_title, \"rank_math_description\": $(\"PARSE ARTICLE\").item.json.seo_description } } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.4
    },
    {
      "id": "a5eb7311-4b48-4bbe-a282-bf720003ee26",
      "name": "SLACK NOTIFICATION",
      "type": "n8n-nodes-base.slack",
      "position": [
        4992,
        832
      ],
      "parameters": {
        "text": "=\ud83d\udcdd *New draft ready for review*\n*Title:* {{ $(\"PARSE ARTICLE\").item.json.title }}\n*Edit:* {{ $(\"CONFIG\").item.json.WORDPRESS_URL }}/wp-admin/post.php?post={{ $(\"CREATE WORDPRESS POST\").item.json.id }}&action=edit\n*Tags:* {{ $('PARSE ARTICLE').item.json.tags.join(', ') }}\n*Affiliate:* {{ $('PARSE ARTICLE').item.json.affiliate_flag }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('CONFIG').item.json.SLACK_CHANNEL }}"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "3b30bf72-e4d6-42e0-b639-ac3c7ce3e164",
      "name": "RESPOND TO WEBHOOK",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        5232,
        928
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        },
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"post_id\": $(\"CREATE WORDPRESS POST\").item.json.id, \"draft_url\": $(\"CONFIG\").item.json.WORDPRESS_URL + \"/?p=\" + $(\"CREATE WORDPRESS POST\").item.json.id } }}"
      },
      "typeVersion": 1.5
    },
    {
      "id": "0e8ad313-935b-490f-9e40-a1d6b99c2dc4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 1584,
        "height": 528,
        "content": "## 3) Create featured image"
      },
      "typeVersion": 1
    },
    {
      "id": "e5fa8931-a7a3-4846-8124-64ec4d834799",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 528,
        "content": "## 4) Create draft Wordpress post"
      },
      "typeVersion": 1
    },
    {
      "id": "5b3a686f-9c28-46de-aa70-b45fc983e4e7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4688,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 528,
        "content": "## 6) Notify on completion"
      },
      "typeVersion": 1
    },
    {
      "id": "b783b410-e097-4460-bfb3-0086c092fb9d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 576,
        "height": 528,
        "content": "## 5) Optimise SEO "
      },
      "typeVersion": 1
    },
    {
      "id": "714eff77-3fbe-46e1-a216-3421728a739d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 944,
        "height": 528,
        "content": "## 1) Initialise"
      },
      "typeVersion": 1
    },
    {
      "id": "b27389ca-6e07-4279-8be3-0927edb53972",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        720
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 528,
        "content": "## 2) Create article"
      },
      "typeVersion": 1
    },
    {
      "id": "cd431b72-e282-477a-9b02-f395f7c744e3",
      "name": "CHECK SLACK CHANNEL",
      "type": "n8n-nodes-base.if",
      "position": [
        4768,
        912
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $('CONFIG').item.json.SLACK_CHANNEL }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "749d6a8a-98f9-4507-b17a-51e5f4a7c207",
  "nodeGroups": [],
  "connections": {
    "CONFIG": {
      "main": [
        [
          {
            "node": "VALIDATE AUTH",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "CONFIG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SPLIT TAGS": {
      "main": [
        [
          {
            "node": "UPSERT TAG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPSERT TAG": {
      "main": [
        [
          {
            "node": "COLLECT TAG IDS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BUILD PROMPT": {
      "main": [
        [
          {
            "node": "GENERATE ARTICLE CONTENT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DECODE IMAGE": {
      "main": [
        [
          {
            "node": "UPLOAD IMAGE TO WORDPRESS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET MEDIA ID": {
      "main": [
        [
          {
            "node": "MERGE IMAGE RESULT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET NO IMAGE": {
      "main": [
        [
          {
            "node": "MERGE IMAGE RESULT",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "PARSE ARTICLE": {
      "main": [
        [
          {
            "node": "CHECK IMAGE ENABLED",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PREPARE INPUT": {
      "main": [
        [
          {
            "node": "BUILD PROMPT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VALIDATE AUTH": {
      "main": [
        [
          {
            "node": "PREPARE INPUT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "REJECT REQUEST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GENERATE IMAGE": {
      "main": [
        [
          {
            "node": "DECODE IMAGE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "COLLECT TAG IDS": {
      "main": [
        [
          {
            "node": "CREATE WORDPRESS POST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET RANK MATH SEO": {
      "main": [
        [
          {
            "node": "CHECK SLACK CHANNEL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MERGE IMAGE RESULT": {
      "main": [
        [
          {
            "node": "SPLIT TAGS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET IMAGE ALT TEXT": {
      "main": [
        [
          {
            "node": "SET MEDIA ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SLACK NOTIFICATION": {
      "main": [
        [
          {
            "node": "RESPOND TO WEBHOOK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CHECK IMAGE ENABLED": {
      "main": [
        [
          {
            "node": "GENERATE IMAGE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SET NO IMAGE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CHECK SLACK CHANNEL": {
      "main": [
        [
          {
            "node": "SLACK NOTIFICATION",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "RESPOND TO WEBHOOK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CREATE WORDPRESS POST": {
      "main": [
        [
          {
            "node": "SET RANK MATH SEO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GENERATE ARTICLE CONTENT": {
      "main": [
        [
          {
            "node": "PARSE ARTICLE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPLOAD IMAGE TO WORDPRESS": {
      "main": [
        [
          {
            "node": "SET IMAGE ALT TEXT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}