Keyflow

Search Keyflow

Find a shortcut, workflow, MCP server or skill

Custom LangChain agent written in JavaScript

n8n template #1955
This workflow has multiple functionalities. It starts with a manual trigger, "When clicking 'Execute Workflow'", that activates two separate paths. The first path takes a preset string "Tell me a joke" and processes it through a custom Language Learning Model (LLM) chain node. This node interacts with an OpenAI node for query processing. The second path takes another preset string "What year was Einstein born?" and passes it to an "Agent" node. This agent further interacts with a Chat OpenAI node and a custom Wikipedia node to produce the required information. The workflow uses both built-in and custom nodes, and integrates with OpenAI for both paths. It's built for experimenting with langua

How to set it up

  1. Open template #1955 on n8n.io and click Use for free, or copy the template JSON and paste it onto an empty canvas in n8n.
  2. Create 2 credentials under Credentials → Add credential: LangChain Code, OpenAI Chat Model. Then open each of those nodes and pick the credential.
  3. Check the model in the AI Agent node. The template may point at a model your account can't use; swap it for one you have access to.
  4. Click Execute workflow and step through each node's output to confirm the data looks right.
  5. Toggle the workflow to Active so its trigger runs on its own.

Hand off to your agent

Prompt

Help me set up the n8n workflow "Custom LangChain agent written in JavaScript" (https://n8n.io/workflows/1955). It uses: AI Agent, LangChain Code, OpenAI Chat Model, Code Tool. Import the template JSON into my n8n instance, list every credential I need to create, and walk me through testing it.

Paste into Claude Code and it will do the rest.

Apps and nodes

Questions

Yes. n8n Team published it free on n8n.io as a verified creator, and it has 14K views. It runs on n8n Cloud or a self-hosted n8n instance.

LangChain Code, OpenAI Chat Model. The other 2 nodes are built into n8n.

Similar workflows

NameViews
  1. 🤖 AI Powered RAG Chatbot for Your Docs + Google Drive + Gemini + Qdrant65K
  2. AI: Conversational agent with custom tool written in JavaScript35K
  3. AI Agent to chat with Airtable and analyze data13K
  4. Reconcile Rent Payments with Local Excel Spreadsheet and OpenAI6,737
  5. AI-powered multi-platform assistant with Google Suite, LinkedIn & Twitter6,037
  6. Explore n8n Nodes in a Visual Reference Library5,197
  7. 🤖 Build an Interactive AI Agent with Chat Interface and Multiple Tools5,090
  8. AI agent chat780K