AutomationFlowsAI & RAG › Langchain

Langchain

Langchain. Uses retrieverWorkflow, chainRetrievalQa, lmChatMistralCloud, chatTrigger. Chat trigger; 6 nodes.

Chat trigger trigger★★☆☆☆ complexityAI-powered6 nodesRetriever WorkflowChain Retrieval QaLm Chat Mistral CloudChat Trigger
AI & RAG Trigger: Chat trigger Nodes: 6 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
{
  "active": false,
  "connections": {
    "Workflow Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Retrieval QA Chain2",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Retrieval QA Chain2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Retrieval QA Chain2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2024-09-15T20:32:13.140Z",
  "id": "Y4bHwY81PZdTos6W",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Langchain",
  "nodes": [
    {
      "parameters": {
        "workflowId": "MFiaN59VSS2cmRCU"
      },
      "id": "066bd60e-a739-4306-809b-c7a1933941d2",
      "name": "Workflow Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverWorkflow",
      "position": [
        720,
        760
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "query": "={{ $json.chatInput }}"
      },
      "id": "d2b7f5d0-a6c4-428f-b677-0540cc452b6c",
      "name": "Retrieval QA Chain2",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        500,
        520
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "### Q&A on data returned from a workflow",
        "height": 211.90203341144422,
        "width": 363
      },
      "id": "3bf0c355-5145-4049-b15a-fb7e916644de",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        460
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nReplace \"Workflow ID\" with the ID the Subworkflow got saved as",
        "height": 255.8330939602389,
        "width": 262.67019427016413
      },
      "id": "75b6f2f8-1de5-4a3d-9f78-8a759811968b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        720
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "d7612e0a-aea5-48c9-9b8b-f2878b9ba314",
      "name": "Mistral Cloud Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        500,
        740
      ],
      "credentials": {
        "mistralCloudApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "ad0b8101-f6cf-45df-a943-b1a74996b90b",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        580
      ]
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "createdAt": "2024-09-15T20:31:41.365Z",
      "updatedAt": "2024-09-15T20:31:41.365Z",
      "id": "ytDtFDzQZ07Ejbje",
      "name": "LangChain - Example"
    }
  ],
  "triggerCount": 0,
  "updatedAt": "2024-09-16T12:24:30.497Z",
  "versionId": "9131754a-ad86-4e52-bd51-2edbfa7ca4a0"
}

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

Langchain. Uses retrieverWorkflow, chainRetrievalQa, lmChatMistralCloud, chatTrigger. Chat trigger; 6 nodes.

Source: https://github.com/thibaultmahe/thibaultmahe/blob/ee13dee175d89d98a3fb589794f44a176e19ba68/workflows/Langchain.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 template attempts to create an AI-powered content assistant for WordPress sites using Mistral AI, enabling article recommendations, content summarization, and contextual Q&A capabilities.

Chat Trigger, Output Parser Structured, Agent +10
AI & RAG

In this workflow, user sends a request to the InfraNodus GraphRAG system that will extract a reasoning ontology from a graph that you create (or that you can copy from our repository of public graphs)

N8N Nodes Infranodus, Chat Trigger, Chat
AI & RAG

LangChain - Example - Workflow Retriever. Uses manualTrigger, retrieverWorkflow, chainRetrievalQa, lmChatOpenAi. Event-driven trigger; 7 nodes.

Retriever Workflow, Chain Retrieval Qa, OpenAI Chat
AI & RAG

This template aims to perform Q&A on data retrieved from another n8n workflow. Since that workflow can be used to retrieve any data from any service, this template can be used to ask questions about a

Chain Retrieval Qa, OpenAI Chat, Retriever Workflow
AI & RAG

OpenAI Assistant is a powerful tool, but at the time of writing it doesn't automatically remember past messages from a conversation.

Memory Buffer Window, OpenAI, Tool Calculator +1