{ "id": "17j2efAe10uXRc4p", "meta": { "instanceId": "workflow-9e4dd749", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:51.342092", "updatedAt": "2025-09-29T07:07:51.342106", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "Auto WordPress Blog Generator (GPT + Postgres + WP Media)", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "f71a8a34-5d88-48b0-bf56-44c95d970abd", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -1120, -560 ], "parameters": { "rule": { "interval": [ { "field": "hours", "triggerAtMinute": {} } ] } }, "typeVersion": 1.2, "notes": "This scheduleTrigger node performs automated tasks as part of the workflow." }, { "id": "8ce11fcd-806c-44ea-aa5f-015599eacc98", "name": "OpenAI Chat Model", "type": "n8n-nodes-base.noOp", "position": [ 2060, -20 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4.1-2025-04-14", "cachedResultName": "gpt-4.1-2025-04-14" }, "options": {} }, "credentials": { "openAiApi": { "id": "BSiASwH9CasrT3uK", "name": "OpenAi account" } }, "typeVersion": 1.2, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow." }, { "id": "c9450a63-a89e-46eb-b083-b0f40d7b797c", "name": "Download Image", "type": "n8n-nodes-base.httpRequest", "position": [ 2620, 100 ], "parameters": { "url": "{{ $env.BASE_URL }}", "options": { "response": { "response": { "responseFormat": "file", "outputPropertyName": "imagedownloaded" } } } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "f477482d-d9b6-4d83-b707-dd19da90e25e", "name": "Prepare Post JSON", "type": "n8n-nodes-base.code", "position": [ 3440, -520 ], "parameters": { "jsCode": "const items = $input.all();\n\nlet image = null;\nlet contentBlock = null;\nlet categoryBlock = null;\nlet titleBlock = null;\n\n// Inspect all incoming JSON\nfor (const item of items) {\n const json = item.json;\n\n // Detect image\n if (json?.source_url && json?.media_type === 'image') {\n image = json;\n continue;\n }\n\n // Detect GPT-generated content\n if (typeof json.content === 'string' && json.content.includes(' ... \n- Level 3 headings inside: ... \n- Level 4 headings inside: ... \n- Lists inside: ... \n- Table of contents using: with anchor links\n- Final section: conclusion in list format\n- Final block: call-to-action with the link \"{{ $('Combines full post meta').item.json.link }}\" or {{$node[\"Config\"].json[\"domain\"]}}\n\nπ― Use the topic info from:\n- name: {{ $json.name }}\n- description: {{ $json.description }}\n- link: {{ $('Combines full post meta').item.json.link }}\n\n---\n\nβοΈ General writing guidelines:\n- The main theme always follows `name` and `description`\n- Each post must focus on a new subtopic (narrower than the main theme)\n- The article must be useful, professional, and well-structured\n- Avoid fluff or repetition β deliver actionable advice\n- Output should follow valid WordPress HTML blocks strictly\n\n---\n\nπ‘ Examples of subtopics for \"{{ $json.name }}\":\n- Top 5 beginner tools in {{ $json.name }}\n- How to choose the right {{ $json.name }} without risks\n- Common mistakes in using {{ $json.name }}\n- How to monetize with CPA or RevShare in {{ $json.name }}\n- Smart strategies to scale {{ $json.name }} traffic in 2025\n- Proven international platforms in {{ $json.name }} β worth trying?\n- What leads to account bans in {{ $json.name }}\n- Top scaling errors in {{ $json.name }}\n\nIn every post, generate a **new and unique** subtopic β no repeats.\n\n---\n\nπ¨ Important:\nOnly output raw WordPress blocks β no additional formatting or notes.\n\nπ§± Structure Example:\n\n1. Introduction:\n\n
A short, attention-grabbing intro explaining what the article covers and why it matters.
\n\n\n2. Table of Contents:\n\nInformative paragraph with practical insights.
\n\n\n\nOptional second paragraph β avoid repetition.
\n\n\n4. Actionable Tips:\n\nSummarize key takeaways and motivate the reader to take action.
\n\n\n6. Call to Action:\n\nRead more at {{$node[\"Config\"].json[\"domain\"]}}/
\n", "options": {}, "promptType": "define" }, "typeVersion": 1.9, "notes": "This agent node performs automated tasks as part of the workflow." }, { "id": "5b1efebe-f9e7-4088-9363-75280ba36528", "name": "Merge heading", "type": "n8n-nodes-base.merge", "position": [ 1280, -540 ], "parameters": {}, "typeVersion": 3.1, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "187423ce-b80a-4e28-bdd1-02818a6dcd8f", "name": "Combines full post meta", "type": "n8n-nodes-base.code", "position": [ 1520, -540 ], "parameters": { "jsCode": "let data = {};\n$input.all().forEach(item => {\n Object.assign(data, item.json);\n});\nreturn [{ json: data }];\n" }, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow." }, { "id": "85c0e9e2-6f2b-4bd4-9f71-f7efe940ed14", "name": "Updating posts DB", "type": "n8n-nodes-base.postgres", "position": [ 1760, -540 ], "parameters": { "table": { "__rl": true, "mode": "list", "value": "used_categories", "cachedResultName": "used_categories" }, "schema": { "__rl": true, "mode": "list", "value": "public" }, "columns": { "value": { "name": "={{ $json.name }}", "title": "={{ $json.title }}", "used_at": "={{ new Date().toISOString() }}", "category_id": "={{ $json.id }}", "description": "={{ $json.description }}" }, "schema": [ { "id": "id", "type": "number", "display": true, "removed": true, "required": false, "displayName": "id", "defaultMatch": true, "canBeUsedToMatch": true }, { "id": "category_id", "type": "number", "display": true, "removed": false, "required": false, "displayName": "category_id", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "name", "type": "string", "display": true, "required": false, "displayName": "name", "defaultMatch": false, "canBeUsedToMatch": false }, { "id": "used_at", "type": "dateTime", "display": true, "required": false, "displayName": "used_at", "defaultMatch": false, "canBeUsedToMatch": false }, { "id": "description", "type": "string", "display": true, "required": false, "displayName": "description", "defaultMatch": false, "canBeUsedToMatch": false }, { "id": "title", "type": "string", "display": true, "required": false, "displayName": "title", "defaultMatch": false, "canBeUsedToMatch": false } ], "mappingMode": "defineBelow", "matchingColumns": [ "category_id" ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {}, "operation": "upsert" }, "credentials": { "postgres": { "id": "JKCOXnEh1Bqg4Gad", "name": "YOUR_POSTGRES_CREDENTIAL" } }, "typeVersion": 2.6, "notes": "This postgres node performs automated tasks as part of the workflow." }, { "id": "73975cf0-165c-4f53-aff9-12872a4dd228", "name": "Extracting output", "type": "n8n-nodes-base.code", "position": [ 2380, -280 ], "parameters": { "jsCode": "return [{\n json: {\n content: $input.first().json.output,\n }\n}];\n" }, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow." }, { "id": "a5030427-0bc1-499a-903e-e10ba81a9b0d", "name": "Placeholder creator", "type": "n8n-nodes-base.code", "position": [ 2380, 100 ], "parameters": { "jsCode": "const name = $('Updating posts DB').first().json.name || \"{{ $json.domain }}\";\nconst encoded = encodeURIComponent(name); \n\nreturn {\n image_url: `{{ $env.WEBHOOK_URL }}{encoded}&font=montserrat`\n};\n" }, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow." }, { "id": "6f0f0202-3803-48ef-b8f5-dd56a023c43f", "name": "Media Upload to WP", "type": "n8n-nodes-base.httpRequest", "position": [ 2860, 100 ], "parameters": { "url": "{{ $env.BASE_URL }}", "method": "POST", "options": {}, "sendBody": true, "contentType": "binaryData", "sendHeaders": true, "authentication": "{{ $credentials.predefinedCredentialType }}", "headerParameters": { "parameters": [ { "name": "Content-Disposition", "value": "attachment; filename=crypto.webp" }, { "name": "Content-Type", "value": "image/png" } ] }, "inputDataFieldName": "imagedownloaded", "nodeCredentialType": "YOUR_CREDENTIAL_HERE" }, "credentials": { "wordpressApi": { "id": "7NOAxTvRC1RY2TSN", "name": "Wordpress account" } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "0621bad7-e7bf-4aae-bbf3-2e1f571d81d8", "name": "Post to WP", "type": "n8n-nodes-base.httpRequest", "position": [ 3680, -520 ], "parameters": { "url": "{{ $env.BASE_URL }}", "method": "POST", "options": {}, "sendBody": true, "authentication": "{{ $credentials.predefinedCredentialType }}", "bodyParameters": { "parameters": [ { "name": "title", "value": "={{ $json[\"title\"] }}" }, { "name": "content", "value": "={{ $json.content }}" }, { "name": "status", "value": "={{ $json.status }}" }, { "name": "featured_media", "value": "={{ $json[\"featured_media\"] }}" }, { "name": "categories[0]", "value": "={{ $json[\"categories\"][0] }}" } ] }, "nodeCredentialType": "YOUR_CREDENTIAL_HERE" }, "credentials": { "wordpressApi": { "id": "7NOAxTvRC1RY2TSN", "name": "Wordpress account" } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "28f3b69a-22a2-4448-a9d0-a5fd42e1ed2c", "name": "No Operation, do nothing", "type": "n8n-nodes-base.noOp", "position": [ 3900, -520 ], "parameters": {}, "typeVersion": 1, "notes": "This noOp node performs automated tasks as part of the workflow." }, { "id": "c98d9193-1dd9-493c-bf76-b72de8e53e28", "name": "Sticky Note22", "type": "n8n-nodes-base.stickyNote", "position": [ -940, -740 ], "parameters": { "color": 4, "width": 220, "height": 360, "content": "! Set your WordPress domain inside the βConfigβ Set node.\n" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "1c881f9f-dcf1-4bf0-889b-0738d1ff49a4", "name": "Config", "type": "n8n-nodes-base.set", "position": [ -880, -560 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "d7165db3-6fc8-4398-aa16-29a34ff27d78", "name": "domain", "type": "string", "value": "{{ $env.WEBHOOK_URL }}" } ] } }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "f787c571-bcc3-47d6-82ca-f138fa2922e1", "connections": { "c9450a63-a89e-46eb-b083-b0f40d7b797c": { "main": [ [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-3cca06e8", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-9354f86b", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-e531c499", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-50de646c", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-09e5fc49", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-4992aa82", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-5201cd69", "type": "main", "index": 0 } ], [ { "node": "error-handler-c9450a63-a89e-46eb-b083-b0f40d7b797c-20669bd8", "type": "main", "index": 0 } ] ] }, "3f90d8c5-7dd9-41c4-a862-e21942fdc87d": { "main": [ [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-f2bb639c", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-ed185a73", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-9cf0fc84", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-c32cf15e", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-861a4cf5", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-451b22a1", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-64df5a2b", "type": "main", "index": 0 } ], [ { "node": "error-handler-3f90d8c5-7dd9-41c4-a862-e21942fdc87d-e564d7e2", "type": "main", "index": 0 } ] ] }, "6f0f0202-3803-48ef-b8f5-dd56a023c43f": { "main": [ [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-e0fa7b69", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-2aeea1d5", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-eddadb0e", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-31b32071", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-319918b2", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-0e10023c", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-58d8ffea", "type": "main", "index": 0 } ], [ { "node": "error-handler-6f0f0202-3803-48ef-b8f5-dd56a023c43f-41ad2556", "type": "main", "index": 0 } ] ] }, "0621bad7-e7bf-4aae-bbf3-2e1f571d81d8": { "main": [ [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-be3a414b", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-cab19963", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-2ca726c5", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-a7d9890c", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-35d434d4", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-9733fd72", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-e2fa56cd", "type": "main", "index": 0 } ], [ { "node": "error-handler-0621bad7-e7bf-4aae-bbf3-2e1f571d81d8-79557d6d", "type": "main", "index": 0 } ] ] }, "8ce11fcd-806c-44ea-aa5f-015599eacc98": { "main": [ [ { "node": "error-handler-8ce11fcd-806c-44ea-aa5f-015599eacc98-1c1cac51", "type": "main", "index": 0 } ] ] }, "9c21f5ce-b353-4193-a93d-a034e025a1a0": { "main": [ [ { "node": "error-handler-9c21f5ce-b353-4193-a93d-a034e025a1a0-4ad22f4e", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: Auto WordPress Blog Generator (GPT + Postgres + WP Media). This workflow integrates 11 different services: stickyNote, httpRequest, code, scheduleTrigger, agent. It contains 56 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Auto WordPress Blog Generator (GPT + Postgres + WP Media). This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }