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.

n8n
Custom JS LangChain Agent: OpenAI Joke & Wikipedia Facts

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.

$16.99
Last updated August 29, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Enterprise workflows

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.