Custom JS LangChain Agent: OpenAI Joke & Wikipedia Facts
n8n workflow demoing custom JavaScript LangChain agent with dual paths: one for OpenAI-powered joke generation, another for Wikipedia fact retrieval via agent.
This workflow showcases a custom LangChain agent implemented in JavaScript within n8n, triggered manually via 'Execute Workflow'. It branches into two paths for experimentation with LLMs. The first path processes a preset 'Tell me a joke' input through a self-coded LLM Chain node, interfacing with OpenAI to generate humorous responses. The second path handles 'What year was Einstein born?' via an Agent node that leverages Chat OpenAI and a custom Wikipedia tool for accurate information retrieval.
Key features include built-in nodes like Manual Trigger and Set, alongside custom nodes for advanced LLM chaining and tool integration. Sticky notes provide documentation on self-coded components. Requires n8n 1.19.4+. Benefits: Rapid prototyping of conversational AI agents, seamless OpenAI integration, and extensible tool usage without external coding.
Ideal use cases: AI developers testing agent architectures, educators demoing LLM capabilities, or teams building info-retrieval bots. Saves hours on setup for multi-tool AI workflows, enabling focus on logic refinement and scaling to production agents.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Related bundle
YouTube Creator Pipeline
8 hand-picked workflows for $39.00.
That is $4.88 each, vs $16.99 for this one alone.
View bundleSecure checkout powered by Stripe
Tags
Support
How to import this workflow into n8n
- 1Purchase or download the workflow to get the n8n workflow JSON file.
- 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
- 3Open each node marked with a credential warning and connect your own accounts and API keys.
- 4Run the workflow once manually to verify the data flow, then toggle it to Active.
Related Enterprise workflows
- WhatsApp AI Chatbot for Restaurant Bookings & Service$22.99
- Automate Sports Betting Data with TheOddsAPI$12.99
- AI Video Generator: 4x Cheaper than Veo3 via Google Sheets & Fal.AI$24.99
- AI Meeting Management Agent for Telegram & Google Calendar$24.99
- js-yaml YAML Parser & Serializer Package Workflow$8.99
- Clearbit Tool MCP Server for AI Agents$24.99
More from Ivan Volkov
Need this deployed? We'll set it up for you.
Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.