{"id": "WwEFqNK4YP6UJcg2", "name": "Auto Knowledge Base Article Generator", "nodes": [{"id": "17900021-8da3-4bd9-9d79-5d20d879ddc7", "name": "Create Perplexity Content", "type": "n8n-nodes-base.httpRequest", "position": [1220, 380], "parameters": {"url": "https://api.perplexity.ai/chat/completions", "method": "POST", "options": {}, "jsonBody": "={\n \"model\": \"sonar-deep-research\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Conduct an in-depth research on '{{ $json.output.parseJson().title }}', covering essential topics, recommended resources, and best practices. Additionally, please address these improvements: '{{ $json.output.parseJson().improvements }}'. The returned data should be at least 1000 words and use a combination of headers, tables, bold, and italics\"\n }\n ],\n \"max_tokens\": 60000,\n \"temperature\": 0.7,\n \"top_p\": 0.9,\n \"top_k\": 50,\n \"stream\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0\n}", "sendBody": true, "jsonHeaders": "{\n \"Authorization\": \"Bearer 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\",\n \"Content-Type\": \"application/json\"\n}", "sendHeaders": true, "specifyBody": "json", "specifyHeaders": "json"}, "typeVersion": 4.2}, {"id": "0cb3f3a7-92bd-4ff3-8a89-b6fc29513e65", "name": "AI Writer Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [720, 380], "parameters": {"text": "=Please create or revise an article about \"{{ $json.chatInput }}\".\n\nOr an article is already written because title: {{ $json.title }} is defined. Reference it to rewrite the {{ $json.content }} field\n\nDo not change the title, either the chatinput or the input article title. This is the title, do not change it.\n\nIf an article is NOT given, pick new categories in:\n- getting-started\n- learning-paths\n- certifications\n- programming\n- applications\n- career\n\nDo not make up a category, it should be the same in the exact case as above\n\nIf an article is given, only make ammendments to the content based on these specific improvements to include: \"{{ $json.improvements }}\".\n\nInclude the improvements key only if it is an input, and in that case don't change it\n\nRemember to return valid JSON with the fields:\n{\n \"title\": \"...\",\n \"slug\": \"...\",\n \"category\": {\n \"id\": \"...\"\n },\n \"description\": \"...\",\n \"keywords\": [...],\n \"content\": \"...\",\n \"metaTitle\": \"...\",\n \"metaDescription\": \"...\",\n \"readingTime\": \"...\",\n \"difficulty\": \"...\"\n \"content\": \"...\"\n}", "options": {"systemMessage": "You are a writing assistant. You will receive instructions to create or update an article in JSON format with the following structure:\n\n{\n \"title\": \"\",\n \"slug\": \"\",\n \"category\": {\n \"id\": \"\" // e.g., \"getting-started\", \"learning-paths\", etc.\n },\n \"description\": \"\",\n \"keywords\": [\"\", \"\", ...],\n \"content\": \"\",\n \"metaTitle\": \"\",\n \"metaDescription\": \"\",\n \"readingTime\": \"\",\n \"difficulty\": \"\"\n}\n\nYour task:\n1. Produce a complete article in the above format, or revise the existing article if provided.\n2. Make sure the text is clear, specific, and helpful to the reader.\n3. Return valid JSON only – do not include extra commentary or fields beyond the above structure.\n4. If any information is missing from the user instructions, make reasonable assumptions.\n"}, "promptType": "define"}, "typeVersion": 1.7}, {"id": "bc62facb-c5cb-465d-89b1-a65a893c3ce1", "name": "AI Editor Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [2280, 380], "parameters": {"text": "={{ $json }}", "options": {"maxIterations": 5, "systemMessage": "=You are an editorial AI assistant. Your role is to review and evaluate a draft article represented as a JSON object.\n\nCategory IDs:\n- \"getting-started\"\n- \"learning-paths\"\n- \"certifications\"\n- \"programming\"\n- \"applications\"\n- \"career\"\n\nInput Format:\n\n{\n \"title\": \"\",\n \"slug\": \"\",\n \"category\": { \"id\": \"\" },\n \"description\": \"\",\n \"keywords\": [\"\", \"...\"],\n \"content\": \"\",\n \"metaTitle\": \"\",\n \"metaDescription\": \"\",\n \"readingTime\": \"