AutomationFlowsAI & RAG › Planner Agent

Planner Agent

Planner Agent. Uses openai. Manual trigger; 3 nodes.

Manual trigger★★★★☆ complexityAI-powered3 nodesOpenAI
AI & RAG Trigger: Manual Nodes: 3 Complexity: ★★★★☆ AI nodes: yes Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "planner-agent",
  "name": "Planner Agent",
  "description": "AI agent that plans and structures content creation based on user input",
  "nodes": [
    {
      "parameters": {
        "functionCode": "return {\n  systemPrompt: `You are an expert content strategist and planner. Your role is to analyze user input and create a comprehensive plan for creating high-quality LinkedIn content.\n\nBased on the user's ideas and conversation history, provide:\n1. Main topic and key themes\n2. Target audience analysis\n3. Content structure outline\n4. Key points to cover\n5. Tone and style recommendations\n6. Potential challenges or considerations\n\nFormat your response as JSON with these fields:\n{\n  \"topic\": \"string\",\n  \"themes\": [\"array\"],\n  \"audience\": \"string\",\n  \"structure\": [\"array\"],\n  \"keyPoints\": [\"array\"],\n  \"tone\": \"string\",\n  \"considerations\": [\"array\"]\n}`\n};"
      },
      "id": "set-system-prompt",
      "name": "Set System Prompt",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "model": "gpt-4",
        "messages": "=[{\n  'role': 'system',\n  'content': $input.first().json.systemPrompt\n}, {\n  'role': 'user',\n  'content': `User input: ${$input.first().json.userInput}\\n\\nPlease create a content plan for a LinkedIn post.`\n}]",
        "options": {
          "temperature": 0.7,
          "maxTokens": 1000
        }
      },
      "id": "openai-planner",
      "name": "OpenAI Planner",
      "type": "n8n-nodes-base.openai",
      "typeVersion": 1,
      "position": [
        250,
        0
      ]
    },
    {
      "parameters": {
        "functionCode": "const response = $input.first().json.choices[0].message.content;\n\ntry {\n  const plan = JSON.parse(response);\n  return {\n    ...plan,\n    chatId: $input.first().json.chatId,\n    rawResponse: response\n  };\n} catch (e) {\n  // Fallback if JSON parsing fails\n  return {\n    topic: 'Content Creation',\n    themes: ['Professional development'],\n    audience: 'LinkedIn professionals',\n    structure: ['Introduction', 'Main content', 'Conclusion'],\n    keyPoints: response.split('\\n').filter(p => p.trim()),\n    tone: 'Professional',\n    considerations: ['Engagement', 'Value addition'],\n    chatId: $input.first().json.chatId,\n    rawResponse: response\n  };\n}"
      },
      "id": "parse-plan",
      "name": "Parse Plan Response",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        500,
        0
      ]
    }
  ],
  "connections": {
    "Set System Prompt": {
      "main": [
        [
          {
            "node": "OpenAI Planner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Planner": {
      "main": [
        [
          {
            "node": "Parse Plan Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "staticData": null
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Planner Agent. Uses openai. Manual trigger; 3 nodes.

Source: https://github.com/ruvcaltd/n8n/blob/a4620cfa4f1aee541f2b2a96f276c689204f06cc/workflows/planner-agent.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Image Agent. Uses httpRequest, openai. Manual trigger; 11 nodes.

HTTP Request, OpenAI
AI & RAG

Writer Agent. Uses openai. Manual trigger; 3 nodes.

OpenAI
AI & RAG

Send one WhatsApp message → Get AI-optimized content across 7+ social platforms.

Output Parser Structured, Google Gemini Chat, OpenAI Chat +8
AI & RAG

Video runthrough

Google Drive, Output Parser Structured, HTTP Request +3
AI & RAG

This template is built for solo attorneys, small law firms, and legal billing coordinators who receive timesheet documents by email and need to produce LEDES-compliant e-billing files for client billi

Email Read Imap, Microsoft Excel, N8N Nodes Word2Text +4