{ "name": "AI Blog Writer Pipeline (Ollama)", "nodes": [ { "parameters": {}, "id": "trigger-1", "name": "Manual Trigger", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ 240, 300 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "topic", "name": "topic", "value": "How to Self-Host AI Models with Ollama", "type": "string" }, { "id": "tone", "name": "tone", "value": "professional but conversational", "type": "string" }, { "id": "word_count", "name": "word_count", "value": "1500", "type": "string" } ] } }, "id": "set-input", "name": "Set Blog Parameters", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 460, 300 ] }, { "parameters": { "promptType": "define", "text": "=You are a professional blog researcher. Research the topic: \"{{ $json.topic }}\" and provide 5 key points with supporting evidence. Format as a numbered list with brief explanations. Be factual and cite real concepts.", "batching": { "batchSize": 1 } }, "id": "research", "name": "1. Research Topic (Ollama)", "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ 680, 300 ] }, { "parameters": { "promptType": "define", "text": "=You are a blog outline creator. Based on this research:\n\n{{ $json.text }}\n\nCreate a detailed blog outline for the topic: \"{{ $('Set Blog Parameters').first().json.topic }}\"\n\nInclude: Title, H2 sections, key points under each, and a conclusion. Target {{ $('Set Blog Parameters').first().json.word_count }} words.", "batching": { "batchSize": 1 } }, "id": "outline", "name": "2. Create Outline (Ollama)", "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ 900, 300 ] }, { "parameters": { "promptType": "define", "text": "=You are a professional blog writer. Write a complete blog post following this outline:\n\n{{ $json.text }}\n\nRequirements:\n- Tone: {{ $('Set Blog Parameters').first().json.tone }}\n- Target length: {{ $('Set Blog Parameters').first().json.word_count }} words\n- Use markdown formatting (## for headings)\n- Include a compelling introduction and conclusion\n- Add practical tips and examples\n- Write for SEO (use keywords naturally)", "batching": { "batchSize": 1 } }, "id": "draft", "name": "3. Write Draft (Ollama)", "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ 1120, 300 ] }, { "parameters": { "promptType": "define", "text": "=You are a professional editor. Edit and improve this blog post for clarity, grammar, flow, and SEO. Fix any issues and make it publication-ready. Return the complete edited post in markdown.\n\nOriginal post:\n\n{{ $json.text }}", "batching": { "batchSize": 1 } }, "id": "edit", "name": "4. Edit & Polish (Ollama)", "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ 1340, 300 ] }, { "parameters": { "mode": "runOnceForAllItems", "jsCode": "const finish = function blogResult({ topic, content }) {\n if (typeof content !== 'string' || !content.trim()) throw new Error('The editor returned an empty blog post.');\n return { topic, final_post: content, generated_at: new Date().toISOString() };\n}\n\nreturn [{json: finish({topic: $('Set Blog Parameters').first().json.topic, content: $input.first().json.text})}];\n" }, "id": "output", "name": "Final Output", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1560, 300 ] }, { "id": "research-ollama-model", "name": "1. Research Topic (Ollama) model", "type": "@n8n/n8n-nodes-langchain.lmOllama", "typeVersion": 1, "position": [ 680, 500 ], "parameters": { "model": "llama3:8b", "options": { "temperature": 0.3, "numPredict": 1000 } } }, { "id": "outline-ollama-model", "name": "2. Create Outline (Ollama) model", "type": "@n8n/n8n-nodes-langchain.lmOllama", "typeVersion": 1, "position": [ 900, 500 ], "parameters": { "model": "llama3:8b", "options": { "temperature": 0.4, "numPredict": 1000 } } }, { "id": "draft-ollama-model", "name": "3. Write Draft (Ollama) model", "type": "@n8n/n8n-nodes-langchain.lmOllama", "typeVersion": 1, "position": [ 1120, 500 ], "parameters": { "model": "llama3:8b", "options": { "temperature": 0.7, "numPredict": 4000 } } }, { "id": "edit-ollama-model", "name": "4. Edit & Polish (Ollama) model", "type": "@n8n/n8n-nodes-langchain.lmOllama", "typeVersion": 1, "position": [ 1340, 500 ], "parameters": { "model": "llama3:8b", "options": { "temperature": 0.3, "numPredict": 4000 } } } ], "connections": { "Manual Trigger": { "main": [ [ { "node": "Set Blog Parameters", "type": "main", "index": 0 } ] ] }, "Set Blog Parameters": { "main": [ [ { "node": "1. Research Topic (Ollama)", "type": "main", "index": 0 } ] ] }, "1. Research Topic (Ollama)": { "main": [ [ { "node": "2. Create Outline (Ollama)", "type": "main", "index": 0 } ] ] }, "2. Create Outline (Ollama)": { "main": [ [ { "node": "3. Write Draft (Ollama)", "type": "main", "index": 0 } ] ] }, "3. Write Draft (Ollama)": { "main": [ [ { "node": "4. Edit & Polish (Ollama)", "type": "main", "index": 0 } ] ] }, "4. Edit & Polish (Ollama)": { "main": [ [ { "node": "Final Output", "type": "main", "index": 0 } ] ] }, "1. Research Topic (Ollama) model": { "ai_languageModel": [ [ { "node": "1. Research Topic (Ollama)", "type": "ai_languageModel", "index": 0 } ] ] }, "2. Create Outline (Ollama) model": { "ai_languageModel": [ [ { "node": "2. Create Outline (Ollama)", "type": "ai_languageModel", "index": 0 } ] ] }, "3. Write Draft (Ollama) model": { "ai_languageModel": [ [ { "node": "3. Write Draft (Ollama)", "type": "ai_languageModel", "index": 0 } ] ] }, "4. Edit & Polish (Ollama) model": { "ai_languageModel": [ [ { "node": "4. Edit & Polish (Ollama)", "type": "ai_languageModel", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "tags": [ { "name": "AI" }, { "name": "Ollama" }, { "name": "Content" }, { "name": "Blog" } ], "active": false, "pinData": {} }