AutomationFlowsAI & RAG › API Two Stage

API Two Stage

Api Two Stage. Uses chainLlm, lmChatOpenAi, openAi. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexityAI-powered4 nodesChain LlmOpenAI ChatOpenAI
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Chainllm → OpenAI Chat recipe pattern — see all workflows that pair these two integrations.

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
{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        48,
        -32
      ],
      "id": "85510369-baf3-4217-b739-19587619d534",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Please explain vector databases in simple terms.",
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.8,
      "position": [
        224,
        -32
      ],
      "id": "a7fa159e-4f8f-4d13-a2e1-84982e6e8232",
      "name": "Basic LLM Chain"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gemini-3-pro-preview",
          "mode": "list",
          "cachedResultName": "gemini-3-pro-preview"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        224,
        160
      ],
      "id": "e4a76a12-8c23-485c-a37e-d70671d97a89",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "id"
        },
        "responses": {
          "values": [
            {
              "content": "Please provide a simpler explanation."
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        512,
        -32
      ],
      "id": "db35827e-1a8d-454e-9763-68a2febb62f0",
      "name": "Message a model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}

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

Api Two Stage. Uses chainLlm, lmChatOpenAi, openAi. Event-driven trigger; 4 nodes.

Source: https://github.com/mlsys-io/FlowMesh/blob/97e29953a246f1fa6d9a30bf158664553d5c70d3/examples/templates/n8n/api_two_stage.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

titletopodcast. Uses telegramTrigger, chainLlm, lmChatOpenAi, openAi. Event-driven trigger; 7 nodes.

Telegram Trigger, Chain Llm, OpenAI Chat +3
AI & RAG

The best content automation template in the market is now even better—with “deep research” on time-sensitive topics\! Unlike most n8n content automation templates that are mainly for “demo purposes,”

OpenAI, HTTP Request, XML +11
AI & RAG

Template Nodes Example. Uses CUSTOM, formTrigger, executeWorkflowTrigger, chatTrigger. Event-driven trigger; 70 nodes.

Custom, Form Trigger, Execute Workflow Trigger +23
AI & RAG

This workflow is perfect for creators, solopreneurs, and personal brands who want to consistently publish bold, high-performing content on X (Twitter) — without writing a single line themselves. After

OpenAI Chat, Memory Buffer Window, Tool Workflow +10
AI & RAG

Ultimate Blogblizt is a powerhouse workflow that solves the tedious task of crafting and publishing SEO-optimized tech blog posts. It integrates AI models (OpenAI, Google Gemini), WordPress, and multi

Chain Llm, Telegram Trigger, OpenAI Chat +10