Einsteiger-Management-Agent mit Sub-Agent-Tools

Fortgeschritten

Dies ist ein Engineering, Multimodal AI-Bereich Automatisierungsworkflow mit 13 Nodes. Hauptsächlich werden Agent, AgentTool, LmChatOpenAi, MemoryBufferWindow und andere Nodes verwendet. Einsteiger-Management-Agent mit Sub-Agent-Tools

Voraussetzungen
  • OpenAI API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e816ff5f-d3d4-4416-96d9-961a078fb188",
      "name": "OpenAI-Chat-Modell",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -32,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9b121aea-be80-46a0-879d-5732b7d4d4f3",
      "name": "Simple Speicher",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        784,
        720
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "2f8104f9-c975-4ed0-b5a9-c5c592878e8c",
      "name": "Simple Speicher1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1312,
        688
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "c07ce435-64a0-4939-918b-9954e7e663e3",
      "name": "OpenAI-Chat-Modell1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        640,
        672
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "20c108c9-221d-4dde-92ff-028ab4b12c2b",
      "name": "OpenAI-Chat-Modell2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1184,
        672
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "263bd596-d242-4a3e-8555-d23e172b23ef",
      "name": "DataAgent (Insight Generator)",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1184,
        480
      ],
      "parameters": {
        "text": "{{json.query}}",
        "options": {},
        "toolDescription": "Role: Responds to instructions requiring metrics, summaries, or data analysis explanations."
      },
      "typeVersion": 2.2
    },
    {
      "id": "2efc2325-6fee-4fce-a4ba-8b9b72701a8d",
      "name": "Simple Speicher2",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        176,
        720
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "8c0e14bd-e64f-473f-9f31-0b0d2c800669",
      "name": "ManagerAgent (Routing + Instruction Generator)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        32,
        512
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an AI Manager that delegates tasks to specialized agents. Your job is to analyze the user's message and decide whether it requires:\n\nAn EmailAgent for writing outreach, follow-up, or templated emails, or\n\nA DataAgent for tasks involving data summaries, metrics, or analysis.\n\nsend the instructions to the sub agents. \n\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ee67ff1c-5651-43bb-a836-f48cf0f4c2bd",
      "name": "E-MailAgent (Communication Specialist)",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        656,
        512
      ],
      "parameters": {
        "text": "={{ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are a professional Email Writing Assistant. You write polished, effective emails for tasks such as outreach, follow-ups, and client communication. Follow the instruction provided exactly and return only the email content. Use a warm, business-appropriate tone."
        },
        "toolDescription": "Role: Writes professional, friendly, or action-oriented emails based on instructions."
      },
      "typeVersion": 2.2
    },
    {
      "id": "0f5fe30c-3d39-472e-ae83-985adfdab40a",
      "name": "Haftnotiz16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -192
      ],
      "parameters": {
        "width": 1680,
        "content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)"
      },
      "typeVersion": 1
    },
    {
      "id": "2b2938bf-6d85-487a-8a3a-af4e7258162b",
      "name": "Haftnotiz",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 860,
        "content": "## 🔧 Step 1: Set Up the Manager Agent\n\nStart by dragging in an **Agent** node and name it something like `ManagerAgent`. This agent will act as the “brain” of your system, analyzing the user's input and determining whether it should be handled by the email-writing sub-agent or the data-summary sub-agent.\n\nOpen the node’s settings and paste the following into the **System Message**:\n\nYou are an AI Manager that delegates tasks to specialized agents. Your job is to analyze the user's message and decide whether it requires:\n\nAn EmailAgent for writing outreach, follow-up, or templated emails, or\n\nA DataAgent for tasks involving data summaries, metrics, or analysis.\n\nSend the instructions to the sub agents.\n\n\nThis instruction gives the Manager Agent clarity on what roles exist and what types of tasks belong to each one.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "31c629b0-c8a3-47ad-9d1b-110690f5c5c2",
      "name": "Haftnotiz2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -16
      ],
      "parameters": {
        "color": 4,
        "width": 496,
        "height": 860,
        "content": "## 📊 Step 3: Create the Data Agent Tool\n\nRepeat the same steps, but this time for data summaries and analysis.\n\nAdd another **Agent Tool** node and name it `DataAgent`. In the **Tool Description**, write something like:\n\nResponds to instructions requiring metrics, summaries, or data analysis explanations.\n\nFor its input text field, you can use:\n\n{{json.query}}\n\nIf desired, provide a system message that gives the agent more detailed instruction on how to behave:\n\nNow the Manager Agent has two tools it can delegate to: one for communication and one for insights.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3e609caf-b457-4b4f-8f1d-579b5c6cf3ee",
      "name": "Haftnotiz1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -16
      ],
      "parameters": {
        "color": 6,
        "width": 536,
        "height": 860,
        "content": "\n## ✉️ Step 4: Create the Email Agent Tool\n\nNow you’ll create a specialized sub-agent that only writes emails.\n\nAdd an **Agent Tool** node and call it `EmailAgent`. In the tool’s settings, describe its job clearly. For example:\n\n```\nWrites professional, friendly, or action-oriented emails based on instructions.\n```\n\nThen scroll down to the **System Message** section and enter the message\n\nFor the text input field, use the expression:\n\n{{ $fromAI('Prompt__User_Message_', ``, 'string') }}\n\nThis allows the Email Agent to receive exactly what the Manager Agent wants it to handle.\n\n\nFinally, connect this entire EmailAgent setup back to the `ManagerAgent` by attaching it to its `ai_tool` input.\n\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "EmailAgent (Communication Specialist)",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "263bd596-d242-4a3e-8555-d23e172b23ef",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory2": {
      "ai_memory": [
        [
          {
            "node": "8c0e14bd-e64f-473f-9f31-0b0d2c800669",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "8c0e14bd-e64f-473f-9f31-0b0d2c800669",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "EmailAgent (Communication Specialist)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "263bd596-d242-4a3e-8555-d23e172b23ef",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "263bd596-d242-4a3e-8555-d23e172b23ef": {
      "ai_tool": [
        [
          {
            "node": "8c0e14bd-e64f-473f-9f31-0b0d2c800669",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "EmailAgent (Communication Specialist)": {
      "ai_tool": [
        [
          {
            "node": "8c0e14bd-e64f-473f-9f31-0b0d2c800669",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Engineering, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes13
Kategorie2
Node-Typen5
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Autor
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34