{
  "nodes": [
    {
      "id": "45607d74-1a8a-41ab-9186-2432311c15e9",
      "name": "Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1520,
        544
      ],
      "parameters": {
        "path": "plots-eeat-blog",
        "options": {},
        "formTitle": "Create E-E-A-T WordPress Blog (Example)",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Topic / Working Title",
              "requiredField": true
            },
            {
              "fieldLabel": "Primary (Focus) Keyword",
              "requiredField": true
            },
            {
              "fieldLabel": "Secondary Keywords (comma-separated)"
            },
            {
              "fieldLabel": "Target Audience (who is this for?)",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Search Intent",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Informational"
                  },
                  {
                    "option": "Commercial"
                  },
                  {
                    "option": "Transactional"
                  },
                  {
                    "option": "Local"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Tone of Voice",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Friendly expert"
                  },
                  {
                    "option": "Professional"
                  },
                  {
                    "option": "Investor focused"
                  },
                  {
                    "option": "Sales-driven"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Preferred Word Count (e.g. 1500)",
              "requiredField": true
            },
            {
              "fieldLabel": "Author / Brand Name",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Author Credentials / Experience (for E-E-A-T)",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Real Experience / Project Notes (bullet style)"
            }
          ]
        },
        "responseMode": "responseNode",
        "formDescription": "Fill this form to generate an SEO + E-E-A-T optimized blog post for example.com."
      },
      "typeVersion": 2
    },
    {
      "id": "4b11a1e4-defe-4ccb-8b8b-c6c0303a7c55",
      "name": "Store Values",
      "type": "n8n-nodes-base.set",
      "position": [
        -1232,
        544
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "WP_URL",
              "type": "string",
              "value": "https://example.com"
            },
            {
              "name": "topic",
              "type": "string",
              "value": "={{ $json['Topic / Working Title'] }}"
            },
            {
              "name": "focus_keyword",
              "type": "string",
              "value": "={{ $json['Primary (Focus) Keyword'] }}"
            },
            {
              "name": "secondary_keywords",
              "type": "string",
              "value": "={{ $json['Secondary Keywords (comma-separated)'] }}"
            },
            {
              "name": "target_audience",
              "type": "string",
              "value": "={{ $json['Target Audience (who is this for?)'] }}"
            },
            {
              "name": "search_intent",
              "type": "string",
              "value": "={{ $json['Search Intent'] }}"
            },
            {
              "name": "tone",
              "type": "string",
              "value": "={{ $json['Tone of Voice'] }}"
            },
            {
              "name": "word_count",
              "type": "number",
              "value": "={{ $json['Preferred Word Count (e.g. 1500)'] }}"
            },
            {
              "name": "author_name",
              "type": "string",
              "value": "={{ $json['Author / Brand Name'] }}"
            },
            {
              "name": "author_experience",
              "type": "string",
              "value": "={{ $json['Author Credentials / Experience (for E-E-A-T)'] }}"
            },
            {
              "name": "experience_notes",
              "type": "string",
              "value": "={{ $json['Real Experience / Project Notes (bullet style)'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "256ee1bd-caba-4d42-bf77-ceefb5e99243",
      "name": "AI: Create Metadata + Outline",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -944,
        544
      ],
      "parameters": {
        "modelId": "gpt-4o-mini",
        "options": {
          "maxTokens": 2048
        },
        "messages": {
          "values": [
            {
              "content": "=You are an SEO and real-estate content strategist.\nYou MUST return ONLY valid JSON. No markdown, no explanations.\nIf something is missing, use an empty string or empty array.\n\nAssume the article will be published on example.com, a site selling BMRDA-approved residential plots around Mysore Road, Bangalore.\n\nINPUT DATA (from form):\n{\n  \"topic\": \"{{ $json.topic }}\",\n  \"focus_keyword\": \"{{ $json.focus_keyword }}\",\n  \"secondary_keywords_raw\": \"{{ $json.secondary_keywords }}\",\n  \"target_audience\": \"{{ $json.target_audience }}\",\n  \"search_intent\": \"{{ $json.search_intent }}\",\n  \"tone\": \"{{ $json.tone }}\",\n  \"word_count\": {{ $json.word_count }},\n  \"author_name\": \"{{ $json.author_name }}\",\n  \"author_experience\": \"{{ $json.author_experience }}\",\n  \"experience_notes\": \"{{ $json.experience_notes }}\"\n}\n\nReturn JSON with this exact structure:\n{\n  \"metaTitle\": \"\",          // <= 60 characters, include focus keyword, clicky but natural\n  \"metaDescription\": \"\",    // <= 160 characters, include focus keyword once, natural\n  \"focusKeyword\": \"\",       // cleaned primary keyword\n  \"secondaryKeywords\": [],   // cleaned array, max 6\n  \"h1\": \"\",                 // main page H1\n  \"slug\": \"\",               // SEO slug, lowercase, hyphenated\n  \"outline\": [\n    {\n      \"id\": \"intro\",        // string id\n      \"heading\": \"\",        // H2 heading\n      \"purpose\": \"\",        // what this section does for reader\n      \"estimatedWordCount\": 0\n    }\n  ],\n  \"faqQuestions\": [],        // 3-7 long-tail questions\n  \"eeatNotes\": {\n    \"authorBio\": \"\",        // 1\u20132 sentence bio\n    \"trustSignals\": [],      // 3\u20136 short strings (e.g., years of experience, project count)\n    \"experienceToHighlight\": [] // 3\u20136 bullet-style points from notes\n  },\n  \"imagePrompt\": \"\"          // visual description for featured image, no text overlays\n}\n\nGuidelines:\n- Outline should roughly fit total word_count.\n- Focus on Bangalore, Mysore Road, BMRDA approvals, bank loans, and practical buyer advice when relevant.\n- The JSON MUST be directly parsable."
            }
          ]
        },
        "jsonOutput": true
      },
      "typeVersion": 1
    },
    {
      "id": "038597a2-cfe1-46f2-8d72-00975c1d4ab3",
      "name": "Validate Output",
      "type": "n8n-nodes-base.if",
      "position": [
        -592,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.content.metaTitle }}",
              "rightValue": ""
            },
            {
              "id": "c2",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.content.metaDescription }}",
              "rightValue": ""
            },
            {
              "id": "c3",
              "operator": {
                "type": "array",
                "operation": "lengthGte",
                "rightType": "number"
              },
              "leftValue": "={{ $json.message.content.outline }}",
              "rightValue": "={{ 1 }}"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "54668a31-ed14-4f77-a107-0ef0792c3091",
      "name": "AI: Write Full Article",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -32,
        144
      ],
      "parameters": {
        "modelId": "gpt-4o",
        "options": {
          "maxTokens": 4096
        },
        "messages": {
          "values": [
            {
              "content": "=You are a senior SEO content writer specialized in Bangalore real estate.\nWrite the full blog post body in clean HTML only (no <html>, <head>, <body> tags).\n\nUse this metadata JSON:\n{{ $json.message.content | json }}\n\nContext:\n- Website: example.com (BMRDA-approved plots around Mysore Road, Bangalore)\n- Target audience: {{ $('Store Values').first().json.target_audience }}\n- Search intent: {{ $('Store Values').first().json.search_intent }}\n- Tone: {{ $('Store Values').first().json.tone }}\n- Desired word count: {{ $('Store Values').first().json.word_count }}\n- Author: {{ $('Store Values').first().json.author_name }} with experience: {{ $('Store Values').first().json.author_experience }}\n- Real notes: {{ $('Store Values').first().json.experience_notes }}\n\nGuidelines:\n- Start with an engaging introduction that naturally uses the focus keyword.\n- For each item in outline[], create an <h2> with that heading and detailed paragraphs underneath.\n- You may use <h3> subheadings where helpful.\n- Weave in first-hand style tips about buying BMRDA plots, site visits, bank loans, and local insights on Mysore Road.\n- Emphasise transparency, legal safety, and long-term value.\n- At the end, add a section \"FAQ\" with each faqQuestions[] item as an <h3> question and a helpful answer.\n- Add a small author/E-E-A-T note block at the bottom summarising eeatNotes.authorBio and key trustSignals.\n- Use only <p>, <h2>, <h3>, <ul>, <li>, <strong>, <em> tags.\n- Do NOT include meta title/description or JSON in the output.\n- Return ONLY the HTML body."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5dbdcfcf-e41f-4aae-ad9a-8827afe095f3",
      "name": "Compile Post",
      "type": "n8n-nodes-base.code",
      "position": [
        -192,
        352
      ],
      "parameters": {
        "jsCode": "const meta = $('AI: Create Metadata + Outline').first().json.message.content;\nconst body = $('AI: Write Full Article').first().json.message.content;\n\nreturn [\n  {\n    title: meta.metaTitle,\n    h1: meta.h1 || meta.metaTitle,\n    slug: meta.slug,\n    metaDescription: meta.metaDescription,\n    focusKeyword: meta.focusKeyword,\n    secondaryKeywords: meta.secondaryKeywords,\n    imagePrompt: meta.imagePrompt,\n    bodyHtml: body\n  }\n];"
      },
      "typeVersion": 1
    },
    {
      "id": "6d663829-0954-4f94-a2e8-6ef2f5fb9a26",
      "name": "Create WP Draft",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        64,
        352
      ],
      "parameters": {
        "title": "={{ $json.h1 }}",
        "additionalFields": {
          "slug": "={{ $json.slug }}",
          "status": "draft",
          "content": "={{ $json.bodyHtml }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5d8143d0-ee46-48f5-bbc4-77b6f313045b",
      "name": "Generate Featured Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        336,
        352
      ],
      "parameters": {
        "prompt": "=Featured image for a blog about: {{ $json.title }}. {{ $json.imagePrompt }}. Realistic, high quality, no text, landscape composition.",
        "options": {
          "size": "1024x1792"
        },
        "resource": "image"
      },
      "typeVersion": 1
    },
    {
      "id": "c338951a-112a-4fdb-bef2-46e736b984d3",
      "name": "Upload to WordPress",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        656
      ],
      "parameters": {
        "url": "https://example.com/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "attachment; filename=\"featured-image.jpg\""
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.1
    },
    {
      "id": "b4f8935f-7687-4b31-bbb0-885e2bfd274e",
      "name": "Assign Featured Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        656
      ],
      "parameters": {
        "url": "={{ 'https://example.com/wp-json/wp/v2/posts/' + $('Create WP Draft').first().json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.1
    },
    {
      "id": "2903269e-5180-4e1a-80b0-0149074b5884",
      "name": "Respond: Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        320,
        656
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={ \"message\": \"\u2705 Draft created on example.com with AI content and featured image.\" }"
      },
      "typeVersion": 1
    },
    {
      "id": "f9fa7511-d20d-40aa-b233-e401bfd8ffe3",
      "name": "Respond: Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -224,
        992
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={ \"message\": \"\u274c There was a problem generating metadata / outline. Please tweak the inputs and try again.\" }"
      },
      "typeVersion": 1
    },
    {
      "id": "7498fee1-eafb-4f88-9920-7174c892170c",
      "name": "\ud83d\udcdd Blog Form",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2096,
        272
      ],
      "parameters": {
        "width": 480,
        "height": 512,
        "content": "## About the Workflow\n\nThis workflow automatically creates a complete, SEO-ready WordPress blog post using AI  from idea to published draft.\n\nYou fill out a simple form with your topic, keywords, audience, tone, word count, and author details. The workflow then plans the article, generates SEO metadata, writes the content in clean HTML, creates a featured image, and publishes everything as a WordPress draft.\n\nIts goal is to save time while maintaining high standards for SEO quality, structure, and E-E-A-T. The result is a fully packaged blog post ready for review and publishing.\n\nIdeal for:\n\u2022 SEO teams  \n\u2022 Content writers and agencies  \n\u2022 Real estate and local business websites  \n\u2022 Website owners scaling content production  \n\nBefore running the workflow, generate a WordPress Application Password for an administrator user and store it in the WordPress credentials in n8n. Once set up, the process runs end-to-end with no manual publishing steps.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c4b99eae-df38-4e05-8a5d-c8ac4a7599ef",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        336
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 368,
        "content": "## 1.Form & Input Handling\n\nThe workflow starts with a form that collects the topic, keywords, audience, tone, and author experience. The Store Values node standardises this data so every following step receives clean and predictable input.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6945c8a2-453b-4444-901e-7032a23501fb",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        336
      ],
      "parameters": {
        "color": 7,
        "width": 576,
        "height": 368,
        "content": "## 2.SEO Planning & Structure\n\nThis section builds the SEO foundation: metadata, headings, article outline, trust signals, and validation checks. The workflow stops early if essential SEO elements are missing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "63d0a0ec-51a9-4430-8fbf-246018596c91",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 832,
        "height": 736,
        "content": "## 3.Write \u2192 Package \u2192 Create Draft \u2192 Generate Image\n\nUsing the approved structure, the workflow writes the full article, packages all post data, creates a WordPress draft, and generates a featured image so the post is content-complete.\n\n## IMPORTANT\n\nGenerate an Application Password in WordPress for an administrator user.\n\nName your application: n8n-auto-blog  \nClick Generate.\n\nYou will receive a password like:\nABCD EFGH IJKL MNOP\n\nSave this password and add it to the WordPress credentials in n8n for this workflow to function correctly.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "48fef7d4-1f5c-43da-88ad-fac14c97675f",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 640,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 4.Image Upload, Linking & Final Response\n\nThe featured image is uploaded to WordPress and assigned to the post. A clear success or error response is returned so the user always knows the final result.\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Form": {
      "main": [
        [
          {
            "node": "Store Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compile Post": {
      "main": [
        [
          {
            "node": "Create WP Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Values": {
      "main": [
        [
          {
            "node": "AI: Create Metadata + Outline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create WP Draft": {
      "main": [
        [
          {
            "node": "Generate Featured Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Output": {
      "main": [
        [
          {
            "node": "AI: Write Full Article",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond: Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to WordPress": {
      "main": [
        [
          {
            "node": "Assign Featured Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign Featured Image": {
      "main": [
        [
          {
            "node": "Respond: Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Write Full Article": {
      "main": [
        [
          {
            "node": "Compile Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Featured Image": {
      "main": [
        [
          {
            "node": "Upload to WordPress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Create Metadata + Outline": {
      "main": [
        [
          {
            "node": "Validate Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}