This workflow runs in-depth topic research with Perplexity AI, gathers up-to-date sources, and uses OpenAI to write SEO-friendly blog content. It automatically generates the title, slug, and meta description, formats the content as HTML, and publishes it directly to WordPress as a draft. Telegram notifications let you follow the process from start to finish.
Important WarningThis is a sample workflow template and is not guaranteed to work in every setup. You may need to adapt it to your own needs. To use this template, you need n8n version 1.48.0 or higher.
{"nodes":[{"parameters":{"mode":"raw","jsonOutput":"{\n \"kategori\": \"Indoor Plants\",\n \"kategori_slug\": \"indoor-plants\",\n \"baslik\": \"Bird of Paradise (Strelitzia): A Tropical Touch\",\n \"aciklama\": \"How to care for Strelitzia, with its giant leaves and striking flowers, and why it may not be blooming.\",\n \"gorsel_sorgusu\": \"Bird of paradise plant indoor\"\n }","options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[-400,208],"id":"84965918-6a89-44d9-9d2e-7eef966d0207","name":"Edit Fields"},{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[-608,208],"id":"ac4d7e2f-cf37-4013-8258-c47fcaf8e489","name":"When clicking 'Execute workflow'"},{"parameters":{"content":"## Add your API KEY and CX KEY for Google image search.","height":240,"width":400},"type":"n8n-nodes-base.stickyNote","position":[1328,560],"typeVersion":1,"id":"faca8687-a570-46de-a95c-b254b1d18aec","name":"Sticky Note3"},{"parameters":{"content":"## WordPress category check: create the category if it doesn't exist.\n","height":272,"width":320},"type":"n8n-nodes-base.stickyNote","position":[-48,-48],"typeVersion":1,"id":"b4c8de21-f88f-41c2-a573-62c8776c6e1a","name":"Sticky Note6"},{"parameters":{"content":"## Create category","height":272,"width":272},"type":"n8n-nodes-base.stickyNote","position":[304,-48],"typeVersion":1,"id":"1cf09171-afb9-4c84-88d5-26a351651fac","name":"Sticky Note5"},{"parameters":{"content":"## Upload image to WP","height":224,"width":288},"type":"n8n-nodes-base.stickyNote","position":[1680,976],"typeVersion":1,"id":"4a3b0c5a-918d-4d83-a2b4-bed05109a12e","name":"Sticky Note4"},{"parameters":{"content":"## WP Post","height":224,"width":288},"type":"n8n-nodes-base.stickyNote","position":[2016,976],"typeVersion":1,"id":"b8e56dee-31e1-4707-9dd5-bf53e04ae46e","name":"Sticky Note2"},{"parameters":{"content":"## AI content prompt\n\n","height":224,"width":288},"type":"n8n-nodes-base.stickyNote","position":[784,96],"typeVersion":1,"id":"5e9f7a24-d312-447a-af6c-f4e67a2de7e7","name":"Sticky Note1"},{"parameters":{"content":"## Blog categories JSON\n","height":224,"width":352},"type":"n8n-nodes-base.stickyNote","position":[-480,128],"typeVersion":1,"id":"8b95c821-795c-4933-a17b-c46b18d34216","name":"Sticky Note"},{"parameters":{},"type":"n8n-nodes-base.limit","typeVersion":1,"position":[1312,896],"id":"eefe0dd7-2322-4a13-8064-dd0677ab667a","name":"Limit"},{"parameters":{"jsCode":"const results = $json.items;\nconst myLinks = [];\nif (results) {\n for (const item of results) {\n myLinks.push({ json: { link: item.link } });\n }\n}\nreturn myLinks;"},"type":"n8n-nodes-base.code","typeVersion":2,"position":[2160,672],"id":"bf06d08a-0f06-4261-b7da-5133fc2da638","name":"Code in JavaScript"},{"parameters":{"method":"POST","url":"https://your-site/wp-json/wp/v2/posts","authentication":"predefinedCredentialType","nodeCredentialType":"wordpressApi","sendBody":true,"specifyBody":"=json","bodyParameters":{"parameters":[{}]},"jsonBody":"={{ (() => { const minMinutes = 10; const maxMinutes = 45; const randomMinutes = Math.floor(Math.random() * (maxMinutes - minMinutes + 1) + minMinutes); const futureDate = new Date(new Date().getTime() + randomMinutes * 60000); const isoDate = futureDate.toISOString(); return JSON.stringify({ slug: $(\"Combine Blog Details\").item.json.data[2].output.slug, title: $(\"Combine Blog Details\").item.json.data[2].output.title, content: $(\"Cleanup HTML \").item.json.content, status: \"future\", date: isoDate, categories: [$(\"Set Category ID\").item.json.id], featured_media: $json.id, meta: { rank_math_focus_keyword: $(\"Message a model\").item.json.output[0].content[0].text, rank_math_description: $(\"Combine Blog Details\").item.json.data[2].output.meta } }); })() }}","options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.3,"position":[2112,1040],"id":"b36bce0f-d3e1-4f8e-a191-c76089600f01","name":"Wordpress post","credentials":{"wordpressApi":{"id":"mP08Rsl6O0X9FCtD","name":"he.com.tr"}}},{"parameters":{"errorMessage":"No category provided"},"type":"n8n-nodes-base.stopAndError","typeVersion":1,"position":[96,368],"id":"464b6847-8102-436e-a739-b8b028729e2e","name":"Stop and Error"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"824f9e79-809a-407a-9f12-7a952e6ae7e4","leftValue":"={{ $json.kategori }}","rightValue":"","operator":{"type":"string","operation":"notEmpty","singleValue":true}}],"combinator":"and"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[-96,224],"id":"e9cc3f6d-aa74-4018-a07f-31ede21b8218","name":"If1"},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict","version":2},"conditions":[{"id":"93181714-4e68-42d9-86ee-0d3b430df863","leftValue":"={{ $binary.data.mimeType }}","rightValue":"image/","operator":{"type":"string","operation":"startsWith"}}],"combinator":"or"},"options":{}},"type":"n8n-nodes-base.if","typeVersion":2.2,"position":[1376,1120],"id":"d84601d4-c74d-411d-9286-4fb840f33b22","name":"If"},{"parameters":{},"type":"n8n-nodes-base.noOp","name":"Replace Me1","typeVersion":1,"position":[1152,1184],"id":"1ea1fae9-a89d-4c2c-a30e-245a4f8489d7"},{"parameters":{"batchSize":"=1","options":{}},"type":"n8n-nodes-base.splitInBatches","typeVersion":3,"position":[784,912],"id":"593522d7-9cd9-462a-884a-02b3b41f0cc9","name":"Loop Over Items1","onError":"continueErrorOutput"},{"parameters":{"method":"POST","url":"https://your-site/wp-json/wp/v2/media","authentication":"predefinedCredentialType","nodeCredentialType":"wordpressApi","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Content-Disposition","value":"=attachment; filename=\"{{ $(\"Combine Blog Details\").item.json.data[2].output.slug }}.jpeg\""}]},"sendBody":true,"contentType":"binaryData","inputDataFieldName":"data","options":{"allowUnauthorizedCerts":true}},"id":"0563b486-f6d5-4eea-9863-bbb27af0fae0","name":"Upload Image to Wordpress1","type":"n8n-nodes-base.httpRequest","position":[1776,1040],"typeVersion":4.2,"alwaysOutputData":false,"credentials":{"wordpressApi":{"id":"mP08Rsl6O0X9FCtD","name":"he.com.tr"}},"onError":"continueRegularOutput"},{"parameters":{"url":"={{ $json.link }}","sendHeaders":true,"headerParameters":{"parameters":[{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"}]},"options":{"response":{"response":{"responseFormat":"file"}}}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.3,"position":[1120,1008],"id":"3bb57082-dc21-4f08-a978-ba5ecd8578be","name":"HTTP Request2","retryOnFail":false,"executeOnce":false,"alwaysOutputData":false,"onError":"continueErrorOutput"},{"parameters":{"url":"=https://www.googleapis.com/customsearch/v1?key= API KEY &cx= CX KEY &searchType=image&fileType=jpg&q={{ $(\"get item\").item.json.gorsel_sorgusu }}&num=10","options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.3,"position":[1904,672],"id":"de265852-21ae-407a-a2dd-78fa5732d00d","name":"HTTP Request1"},{"parameters":{"modelId":{"__rl":true,"value":"gpt-4.1-mini","mode":"list","cachedResultName":"GPT-4.1-MINI"},"responses":{"values":[{"content":"=You are a senior SEO specialist. Based on the given title and category, analyze the most-searched long-tail keywords on Google and create a list of tags."}]},"builtInTools":{},"options":{}},"type":"@n8n/n8n-nodes-langchain.openAi","typeVersion":2,"position":[1408,672],"id":"fa9df022-a233-4148-a72a-6c4e3d3ab167","name":"Message a model","credentials":{"openAiApi":{"id":"4YYiKYSWSzwKqtjk","name":"OpenAi account"}}},{"parameters":{"aggregate":"aggregateAllItemData","options":{}},"id":"bdb25d6b-588f-4875-9f65-c1b9b3ddf9aa","name":"Combine Blog Details","type":"n8n-nodes-base.aggregate","position":[1840,368],"typeVersion":1},{"parameters":{"model":{"__rl":true,"value":"gpt-5-mini","mode":"list","cachedResultName":"gpt-5-mini"},"options":{}},"id":"c2b37a57-b132-40a6-9d06-f8d76a1d046d","name":"gpt-4o-mini","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[816,368],"typeVersion":1.2,"credentials":{"openAiApi":{"id":"4YYiKYSWSzwKqtjk","name":"OpenAi account"}}},{"parameters":{"assignments":{"assignments":[{"id":"0afb2988-1481-4b04-b16d-fb33c50a16d0","name":"content","type":"string","value":"={{ $json.data[0].message.content.replaceAll(\"```html\", \"\").replaceAll(\"```\",\"\") }}"}]},"options":{}},"id":"9f8121fb-8ab1-4927-884f-a4c71ff644b6","name":"Cleanup HTML ","type":"n8n-nodes-base.set","position":[1200,672],"typeVersion":3.4},{"parameters":{"promptType":"define","text":"=You are the SEO editor-in-chief. Whatever the topic, your task is to write an article in the Comprehensive Guide format, the most-read format on the site.","options":{}},"id":"660e1734-b3bd-4d0f-b420-e257e85afa2a","name":"Copywriter AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[816,176],"typeVersion":1.8},{"parameters":{"numberInputs":3},"id":"1ce792b4-5eb6-4bbe-8200-068941dca8ab","name":"Merge","type":"n8n-nodes-base.merge","position":[1680,176],"typeVersion":3},{"parameters":{"modelId":{"__rl":true,"value":"gpt-5-mini","mode":"list","cachedResultName":"GPT-5-MINI"},"messages":{"values":[{"content":"=Only output the HTML content without preamble or further explanation. Generate WordPress-compatible HTML for a blog post based on the provided content."}]},"options":{}},"id":"22dffa89-474a-4979-ac07-30d1184a7c9a","name":"Create HTML","type":"@n8n/n8n-nodes-langchain.openAi","position":[1248,96],"typeVersion":1.8,"credentials":{"openAiApi":{"id":"4YYiKYSWSzwKqtjk","name":"OpenAi account"}}},{"parameters":{"promptType":"define","text":"=Create a slug, blog post title, and meta description for the following blog post.","hasOutputParser":true,"options":{}},"id":"24502282-7faa-4876-9de2-067f28934c16","name":"Create Title, Slug, Meta","type":"@n8n/n8n-nodes-langchain.agent","position":[1248,288],"typeVersion":1.8},{"parameters":{"jsonSchemaExample":"{\n\"slug\": \"rpo-benefits-recruitment\",\n\"title\": \"7 Key Advantages of RPO for Modern Recruitment\",\n\"meta\": \"Explore how RPO enhances hiring efficiency.\"\n}"},"id":"f0e27d72-d547-4e96-9a9e-45983a024d73","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1552,400],"typeVersion":1.2},{"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"id":"d6ea90b1-215c-413b-9335-e91ff76bf450","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1184,416],"typeVersion":1.2,"credentials":{"openAiApi":{"id":"4YYiKYSWSzwKqtjk","name":"OpenAi account"}}},{"parameters":{"options":{}},"id":"7c1a45e8-d0e5-4eaa-9417-0b47d56ab931","name":"Set Category ID","type":"n8n-nodes-base.set","typeVersion":3,"position":[640,160]},{"parameters":{"method":"POST","url":"https://he.com.tr/wp-json/wp/v2/categories","authentication":"predefinedCredentialType","nodeCredentialType":"wordpressApi","sendBody":true,"bodyParameters":{"parameters":[{"name":"=name","value":"={{ $(\"get item\").item.json.kategori }}"},{"name":"slug","value":"={{ $(\"get item\").item.json.kategori_slug }}"}]},"options":{}},"id":"56276cf2-cf08-4c28-a649-6609095314ad","name":"Create Category","type":"n8n-nodes-base.httpRequest","typeVersion":4,"position":[384,48],"credentials":{"wordpressApi":{"id":"mP08Rsl6O0X9FCtD","name":"he.com.tr"}}},{"parameters":{"conditions":{"number":[{"value1":"={{ $json.id }}","operation":"larger"}]}},"id":"b8e0b05b-8a40-4026-9f1d-ab149d5a5035","name":"Category Exists?","type":"n8n-nodes-base.if","typeVersion":1,"position":[416,288],"alwaysOutputData":false},{"parameters":{"url":"=https://your-site/wp-json/wp/v2/categories?slug={{ $json.kategori_slug }}","options":{}},"id":"39cce508-e1bd-43cc-b4b6-0d11f3c092ec","name":"Check Category","type":"n8n-nodes-base.httpRequest","typeVersion":4,"position":[64,64],"alwaysOutputData":true}],"connections":{"Edit Fields":{"main":[[{"node":"If1","type":"main","index":0}]]},"When clicking 'Execute workflow'":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"Limit":{"main":[[{"node":"Wordpress post","type":"main","index":0}]]},"Code in JavaScript":{"main":[[{"node":"Loop Over Items1","type":"main","index":0}]]},"If1":{"main":[[{"node":"Check Category","type":"main","index":0}],[{"node":"Stop and Error","type":"main","index":0}]]},"If":{"main":[[{"node":"Upload Image to Wordpress1","type":"main","index":0}],[{"node":"Replace Me1","type":"main","index":0}]]},"Replace Me1":{"main":[[{"node":"Loop Over Items1","type":"main","index":0}]]},"Loop Over Items1":{"main":[[{"node":"Limit","type":"main","index":0}],[{"node":"HTTP Request2","type":"main","index":0}],[{"node":"Replace Me1","type":"main","index":0}]]},"Upload Image to Wordpress1":{"main":[[{"node":"Wordpress post","type":"main","index":0}]]},"HTTP Request2":{"main":[[{"node":"If","type":"main","index":0}],[{"node":"Replace Me1","type":"main","index":0}]]},"HTTP Request1":{"main":[[{"node":"Code in JavaScript","type":"main","index":0}]]},"Message a model":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]},"Combine Blog Details":{"main":[[{"node":"Cleanup HTML ","type":"main","index":0}]]},"gpt-4o-mini":{"ai_languageModel":[[{"node":"Copywriter AI Agent","type":"ai_languageModel","index":0}]]},"Cleanup HTML ":{"main":[[{"node":"Message a model","type":"main","index":0}]]},"Copywriter AI Agent":{"main":[[{"node":"Merge","type":"main","index":1},{"node":"Create HTML","type":"main","index":0},{"node":"Create Title, Slug, Meta","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Combine Blog Details","type":"main","index":0}]]},"Create HTML":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Create Title, Slug, Meta":{"main":[[{"node":"Merge","type":"main","index":2}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Create Title, Slug, Meta","type":"ai_outputParser","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Create Title, Slug, Meta","type":"ai_languageModel","index":0}]]},"Set Category ID":{"main":[[{"node":"Copywriter AI Agent","type":"main","index":0}]]},"Create Category":{"main":[[{"node":"Set Category ID","type":"main","index":0}]]},"Category Exists?":{"main":[[{"node":"Set Category ID","type":"main","index":0}],[{"node":"Create Category","type":"main","index":0}]]},"Check Category":{"main":[[{"node":"Category Exists?","type":"main","index":0}]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d7657f9a280aacd9f9f66a073b785f9cfd23527f74c6ef8e2d61af482fb078a2"}}
JSON copied to clipboard!
n8n Service Required
You must have an active n8n hosting service in your account to use this workflow template.