AutomationFlowsAI & RAG › Legacy Orchestrator - Quick Start Planner

Legacy Orchestrator - Quick Start Planner

Legacy Orchestrator - Quick Start Planner. Uses openAi. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexityAI-powered5 nodesOpenAI
AI & RAG Trigger: Webhook Nodes: 5 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
{
  "name": "Legacy Orchestrator - Quick Start Planner",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "legacy-planner",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-receive",
      "name": "\ud83d\udce5 Receive Planning Request",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Prepare context for LLM\nconst input = $input.first().json;\nconst body = input.body || input;\n\nconst elements = body.currentState?.detectedElements || [];\nconst interactable = elements.filter(e => e.interactable);\n\nconst context = `\nTASK: ${body.task}\n\nSCREEN STATE:\n- System: ${body.currentState?.systemType || 'unknown'}\n- Step: ${body.currentState?.currentStep || 0} of ${body.currentState?.totalSteps || 50}\n- Error: ${body.currentState?.errorState || 'None'}\n\nVISIBLE ELEMENTS (${elements.length} total, ${interactable.length} interactive):\n${elements.slice(0, 20).map((e, i) => `${i+1}. [${e.type}] \"${e.label}\" ${e.interactable ? '(clickable)' : ''}`).join('\\n')}\n\nPREVIOUS ACTIONS:\n${(body.previousActions || []).slice(-5).map(a => `- ${a.type} \"${a.target}\": ${a.success ? 'OK' : 'FAILED'}`).join('\\n') || 'None'}\n`;\n\nreturn [{ json: { context, task: body.task, sessionId: body.sessionId } }];"
      },
      "id": "prepare-context",
      "name": "\ud83d\udd27 Prepare Context",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "content": "=You are an AI agent navigating legacy interfaces. Analyze the screen and decide the next action.\n\n{{ $json.context }}\n\nRespond with JSON:\n```json\n{\n  \"actions\": [{\"type\": \"click|type|wait|scroll|extract\", \"target\": \"element label\", \"value\": \"text if typing\"}],\n  \"confidence\": 0.0-1.0,\n  \"reasoning\": \"why this action\",\n  \"isComplete\": false,\n  \"extractedData\": null\n}\n```\n\nRULES:\n- Max 3 actions per response\n- Use element labels from VISIBLE ELEMENTS\n- Set isComplete=true when task is done\n- Put extracted data in extractedData field"
            }
          ]
        },
        "jsonOutput": true,
        "options": {
          "maxTokens": 1000,
          "temperature": 0.2
        }
      },
      "id": "llm-planning",
      "name": "\ud83e\udde0 GPT-4o Planning",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        680,
        300
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Validate and sanitize LLM response\nconst input = $input.first().json;\n\nlet response;\ntry {\n  if (input.message?.content) {\n    const content = input.message.content;\n    response = typeof content === 'object' ? content : JSON.parse(content.replace(/```json?\\s*|```/g, ''));\n  } else if (input.actions) {\n    response = input;\n  } else {\n    throw new Error('Unknown format');\n  }\n} catch (e) {\n  response = { actions: [], confidence: 0.1, reasoning: 'Parse error: ' + e.message, isComplete: false, extractedData: null };\n}\n\n// Validate actions\nconst validTypes = ['click', 'type', 'wait', 'scroll', 'extract', 'navigate', 'select'];\nconst safeActions = (response.actions || []).filter(a => \n  validTypes.includes(a.type) && \n  (a.target || a.type === 'wait') &&\n  !(a.value?.includes('<script') || a.value?.includes('javascript:'))\n);\n\nreturn [{ json: {\n  actions: safeActions.slice(0, 3),\n  confidence: Math.max(0, Math.min(1, response.confidence || 0.5)),\n  reasoning: response.reasoning || 'No reasoning',\n  isComplete: response.isComplete === true,\n  extractedData: response.extractedData || null\n}}];"
      },
      "id": "validate-response",
      "name": "\u2705 Validate & Secure",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify($json) }}",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "X-Planning-Version",
                "value": "1.0"
              }
            ]
          }
        }
      },
      "id": "respond-webhook",
      "name": "\ud83d\udce4 Send Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ]
    }
  ],
  "connections": {
    "\ud83d\udce5 Receive Planning Request": {
      "main": [
        [
          {
            "node": "\ud83d\udd27 Prepare Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd27 Prepare Context": {
      "main": [
        [
          {
            "node": "\ud83e\udde0 GPT-4o Planning",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\udde0 GPT-4o Planning": {
      "main": [
        [
          {
            "node": "\u2705 Validate & Secure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u2705 Validate & Secure": {
      "main": [
        [
          {
            "node": "\ud83d\udce4 Send Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}

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

Legacy Orchestrator - Quick Start Planner. Uses openAi. Webhook trigger; 5 nodes.

Source: https://github.com/jason-pellerin/legacy-orchestrator/blob/509966edfbcc6cd913fcb2411421d621cb090462/templates/quick-start-n8n-workflow.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

This workflow captures new leads via webhook, enriches and scores them with Apollo and Google Gemini, logs everything in Google Sheets, and automates outreach, reply handling, follow-ups, meeting prep

HTTP Request, Google Gemini, Google Sheets +3
AI & RAG

This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy

OpenAI, HTTP Request, Airtable
AI & RAG

Propulsar — Content Engine v3. Uses openAi, httpRequest, googleSheets. Webhook trigger; 73 nodes.

OpenAI, HTTP Request, Google Sheets
AI & RAG

Eu Clara – Funil Kiwify Completo. Uses postgres, openAi, httpRequest, gmail. Webhook trigger; 70 nodes.

Postgres, OpenAI, HTTP Request +1
AI & RAG

Postagem Redes — Portal: Ações. Uses openAi, googleGemini, ollama, httpRequest. Webhook trigger; 58 nodes.

OpenAI, Google Gemini, Ollama +4