AutomationFlowsAI & RAG › Agent Builder

Agent Builder

Agent Builder. Uses workflowTrigger, httpRequest. Event-driven trigger; 4 nodes.

Event trigger★★★★☆ complexity4 nodesWorkflow TriggerHTTP Request
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★★★☆ 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
{
  "name": "Agent Builder",
  "nodes": [
    {
      "parameters": {
        "workflowId": "agent-swarm-main"
      },
      "id": "workflow-trigger",
      "name": "Workflow Trigger",
      "type": "n8n-nodes-base.workflowTrigger",
      "typeVersion": 1.1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Extract task information from parent workflow\nconst input = $input.item.json;\n\n// Get task from current_subtask if exists, otherwise use input directly\nconst subtask = input.current_subtask || input;\n\nreturn {\n  json: {\n    task: subtask.subtask || subtask.task || '',\n    description: subtask.description || '',\n    context: input.context || {},\n    priority: subtask.priority || 1\n  }\n};"
      },
      "id": "prepare-task",
      "name": "Prepare Task",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "url": "=https://api.openai.com/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"gpt-4o\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Du bist der BUILDER im Agent-Swarm-System.\\n\\nROLLE:\\nTechnische und inhaltliche Umsetzung von Vorgaben.\\n\\nAUFGABEN:\\n- Schreibe Code, Skripte und Workflows\\n- Erstelle Prompts und Konfigurationen\\n- Setze exakt das um, was der Orchestrator vorgibt\\n- Liefert reproduzierbare, funktionsf\u00e4hige Ergebnisse\\n\\nREGELN:\\n- Denke nicht strategisch (das macht der Orchestrator)\\n- Setze exakt um, was beauftragt wurde\\n- Mache keine konzeptionellen Entscheidungen\\n- Wenn etwas unklar ist, mache eine begr\u00fcndete Annahme und kennzeichne sie\\n\\nOUTPUT:\\n- Vollst\u00e4ndiger, ausf\u00fchrbarer Code\\n- Erkl\u00e4rende Kommentare wo n\u00f6tig\\n- Liste ben\u00f6tigter Abh\u00e4ngigkeiten\\n- Kurze Anleitung zur Nutzung\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"=Task: {{ $json.task }}\\nBeschreibung: {{ $json.description }}\\nKontext: {{ JSON.stringify($json.context) }}\"\n    }\n  ],\n  \"temperature\": 0.2\n}",
        "options": {}
      },
      "id": "builder-llm",
      "name": "Builder LLM",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        650,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Extract and format builder output\nconst response = $input.item.json;\nlet output;\n\ntry {\n  if (response.choices && response.choices[0]) {\n    output = response.choices[0].message.content;\n  } else if (response.content) {\n    output = typeof response.content === 'string' ? response.content : JSON.stringify(response.content);\n  } else {\n    output = JSON.stringify(response);\n  }\n} catch (e) {\n  output = `Error parsing response: ${e.message}`;\n}\n\nreturn {\n  json: {\n    output: output,\n    status: 'completed',\n    agent: 'builder',\n    timestamp: new Date().toISOString()\n  }\n};"
      },
      "id": "format-output",
      "name": "Format Output",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        850,
        300
      ]
    }
  ],
  "connections": {
    "Workflow Trigger": {
      "main": [
        [
          {
            "node": "Prepare Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Task": {
      "main": [
        [
          {
            "node": "Builder LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Builder LLM": {
      "main": [
        [
          {
            "node": "Format Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-12-19T12:00:00.000Z",
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Agent Builder. Uses workflowTrigger, httpRequest. Event-driven trigger; 4 nodes.

Source: https://github.com/timo-goetz-ai/apki-infra-hetzner/blob/133589ea8bc73203bd0b1e7a93f1df5c0a71941c/workflows/agent_swarm_02_agent-builder.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

Agent Documenter. Uses workflowTrigger, httpRequest. Event-driven trigger; 4 nodes.

Workflow Trigger, HTTP Request
AI & RAG

This is for SaaS founders, agency owners, and Sales Ops managers who use HubSpot but are tired of "toe-stepping." If your BDRs are accidentally emailing your AE’s active deals, or Marketing is blastin

Data Table, HTTP Request
AI & RAG

Inquiry-Agent. Uses @digitalocean/n8n-nodes-digitalocean-gradient-serverless-inference, stopAndError, googleDocs, gmail. Event-driven trigger; 59 nodes.

@Digitalocean/N8N Nodes Digitalocean Gradient Serverless Inference, Stop And Error, Google Docs +4
AI & RAG

AI Social Media Automation for Multiple Platforms using Blotato. Uses telegramTrigger, @blotato/n8n-nodes-blotato, telegram, httpRequest. Event-driven trigger; 52 nodes.

Telegram Trigger, @Blotato/N8N Nodes Blotato, Telegram +1
AI & RAG

CLEAN Agent - Manual Trigger. Uses googleDrive, googleSheets, httpRequest. Event-driven trigger; 49 nodes.

Google Drive, Google Sheets, HTTP Request