- NanoBits
- Posts
- How to create your first AI agent with n8n.io?
How to create your first AI agent with n8n.io?
Nanobits Product Spotlight

EDITOR’S NOTE
Dear future-proof humans,
AI comes up in almost every conversation I have these days. That’s how ubiquitous AI has become. These conversations are mostly around what’s new in the AI space, which AI tools do you use for work, do you have paid subscriptions, which tools should I buy, do you build agents, can you teach me how to build AI agents, how can I use AI to make my life better, and many others.
AI has moved from boardroom presentations to daily workflows. Teams everywhere are building practical solutions that solve real problems. For instance, at a leading payment gateway company in India, their engineering team uses AI:
To automate the release of release notes to merchants, ensuring they are always up to date with product changes. When sprint cycles complete, the system automatically generates and sends change logs, keeping merchants informed without manual effort.
They've also built AI agents that scan Confluence documentation and create detailed developer tickets from incomplete sprint items.
In one of my other conversations, I learned about an agritech company based in Singapore, which faced a different challenge. Despite building solid technology, adoption among field operations teams remained low. The breakthrough came from recognizing how Southeast Asia actually works: everyone runs their business on WhatsApp. Instead of forcing people to learn new tools, they built AI agents that live where conversations already happen. These agents absorb messages from field agents, extract structured data about deliveries and stock levels, and then provide real-time summaries to management.
These stories come from practical teams solving everyday problems. Yet many product managers, designers, and growth teams still struggle with building basic automation flows. The tools exist, the use cases are clear, but the knowledge gap persists.
This gap creates missed opportunities. Teams spend hours on repetitive tasks that could run automatically. Customer insights get buried in message threads that could be analyzed systematically. Product updates reach users through manual processes that could scale effortlessly.
Nanobits exists to bridge this divide by making building with AI accessible to problem solvers, not just programmers. While we have used make.com in the past, for today’s edition, we’ll get started with n8n and explore what makes it different, then build your first workflow to understand how language models actually work.
WHAT IS N8N AND HOW DOES IT WORK?
First, a little bit of context about why we chose to write about n8n today: in the pursuit of knowledge (and to figure out what to write in our newsletters), both of us attend a lot of workshops, build-a-thons, and tech (AI) conferences. I attended one of such workshops yesterday, where the instructor walked the audience through how to build real AI agents using n8n. And, what better way to share my learnings with all of you other than this newsletter!
Since you are all familiar with what visual automation tools are about, as we extensively covered make.com in our previous newsletters, I won’t elaborate too much on what n8n is.
n8n represents a fresh approach to workflow automation. Born from developer frustration with clunky, proprietary systems, this open-source platform gives you complete control over your automation workflows. Jan Oberhauser created n8n in Berlin with a simple philosophy: automation tools should empower users, not lock them into expensive subscriptions or limited functionality.
Think of n8n as a digital assembly line where each station performs a specific task. Your workflow begins with a trigger, such as receiving an email or detecting a file upload, which activates the first node that processes incoming data and passes it forward. Instead of writing complex scripts, you select pre-built nodes for common tasks, such as Google Sheets for spreadsheet data, OpenAI for text analysis, and Slack for notifications. The connections between nodes show exactly where information travels, and when your workflow runs, you can watch data move through each step with visible input and output for every node. This makes debugging easier, allowing you to pinpoint the exact location and data that cause any issues.
What sets n8n apart is its pricing model, which reinforces this accessibility. n8n offers free self-hosting, which means you can run unlimited workflows on your own infrastructure without incurring ongoing costs. For teams just starting with automation, this removes the biggest barrier to experimentation. You can build, test, and deploy without worrying about hitting usage limits or burning through credits.
BUILD YOUR FIRST WORKFLOW WITH N8N
First, we learn what an AI agent is. While you may come across various definitions of it on the internet, here’s how we define it: An AI agent is any workflow that incorporates artificial intelligence. Without AI, you're simply building basic automation. Every AI-powered workflow follows a three-part structure: trigger, AI action, and results. The trigger starts the workflow, the AI performs actions based on the information you provide, and finally produces results from those actions.
Let's build a simple chatbot to see this in action. This workflow illustrates how language models process information and why context is crucial for AI responses.
Create an account:
Create an account with your email, Google, or GitHub account.
You will get a 14-day free trial.

Create a new workflow
Click on “create workflow“ in the top right corner in the “Overview“ section of the tool.
Step 1: Start with the Chat Trigger
Create a new workflow in n8n and add a "When chat message received" trigger node. This node listens for incoming messages and starts your workflow whenever someone sends a chat. The trigger captures the user's message and makes it available to the next node in your workflow.

Step 2: Add the AI Agent Node
Drag an "AI Agent" node onto your canvas and connect it to the chat trigger. This node acts as the brain of your workflow, processing incoming messages and generating responses. The AI Agent contains several components that work together: the chat model, memory system, tools, and output parser.

You will see a red border around the AI agent module, accompanied by a warning sign. That’s because we haven’t yet connected the input, which is an AI model, to the AI agent that will process our requests.
You may choose any model from the list. OpenAI offers 100 free credits for select models, including GPT-4.1-mini, among others (this step doesn’t need any external/additional connection with OpenAI APIs, which is an advantage over make.com).

Step 3: Configure the OpenAI Chat Model
Within the AI Agent, add an "OpenAI Chat Model" node. This connects your workflow to OpenAI's language models, enabling your agent to understand and respond to natural language. Configure it with your API credentials and select the model you want to use, such as GPT-3.5 or GPT-4.
Step 4: Test Without Memory
[Important note: Keep saving the workflow. Even though there is an auto-save feature, tools can sometimes act funny.]
Run your workflow and ask a simple question, like "What is the height of the Taj Mahal?"

You'll notice the model provides an answer, but if you ask follow-up questions referring to previous parts of the conversation, it won't remember what you discussed earlier. The model processes each message in isolation without context from previous interactions.
Step 5: Add Memory for Context
Connect a "Simple Memory" node to your AI Agent. This component stores conversation history, allowing your agent to maintain context across multiple exchanges. Now, when you ask "What is its color?" after previously asking about the Taj Mahal, the agent remembers what "it" refers to and can provide the relevant information.

Important things to note in this step:
Clear the execution logs and the chat session after adding the simple memory module, and save the workflow so that you can obtain fresh results.
I have set the context window length to 5, which means the memory will store the last five conversations with the chatbot.
The context window length in n8n's simple memory determines how many previous messages the AI agent can remember and reference during conversations. A longer context window allows for more detailed conversation history but uses more tokens and processing power, while a shorter window saves resources but may cause the agent to forget earlier parts of long conversations.RetryClaude can make mistakes. Please double-check responses.
Step 6: Test the Complete Workflow
Run your workflow again and have a conversation that spans multiple messages. Notice how the agent now maintains context and can reference previous parts of your discussion. The memory component bridges individual messages into a coherent conversation.

Final Workflow
Bonus section: Understanding Tools and Output Parsers
The Tool functionality extends your AI agent's capabilities beyond text generation. Tools enable the agent to perform actions such as searching the web, reading files, or calling APIs to gather real-time information.
For example, if someone asks, "What's the current weather in Bangalore?" the agent recognizes that it needs live data and automatically uses a weather API tool to fetch the latest weather information before responding with accurate, up-to-date data.
The Output Parser formats the agent's responses into structured data. Instead of receiving raw text, you can parse responses into JSON, extract specific fields, or format the output for integration with other systems.
For example, when asking "Extract the customer's name, email, and complaint from this support ticket," the output parser can structure the response as {"name": "John Smith", "email": "[email protected]", "complaint": "Login issues"} instead of a paragraph of text, making it easy to automatically update your CRM or trigger follow-up workflows.
We saw that there were two options for “Source for Prompt (User Message):” Connected Chat Trigger Node and Define below. While the first option uses the actual incoming chat message as the prompt, the second option lets you manually write a custom prompt instead of using the chat trigger's message.
Let’s customize the prompt.
A few things to note about this flow:
The
chatInput
The variable contains the user's message from the chat trigger node and allows you to reference it in the custom prompt.You can choose to change the System message or keep it as is, depending on your requirement.
Quick refresher:
User messages contain the actual questions or inputs from the person chatting, while system messages provide instructions and context that guide the AI's behavior and response style. System messages act like behind-the-scenes coaching for the AI, telling it how to act, while user messages are the visible conversation.
N8N vs MAKE: CHOOSING THE AUTOMATION PATH THAT’S RIGHT FOR YOU
Both platforms utilize visual interfaces to automate workflows, but they cater to distinct audiences and address different use cases. Make.com positions itself as the more polished, business-ready solution with extensive native integrations and an intuitive drag-and-drop experience. Its strength lies in immediate usability for non-technical users who want to connect standard SaaS applications quickly.
n8n.io takes a more developer-friendly approach, offering flexibility and customization at the cost of a steeper learning curve. While Make might feel more polished initially, n8n's node-based interface becomes intuitive once you understand the flow concept. You can write custom JavaScript, create your own integrations, and fine-tune every detail of your workflows.
The pricing models reflect these different philosophies. Make charges per operation within a workflow, while n8n charges per complete workflow execution. For processes that run frequently but don't manipulate large amounts of data, Make often costs less. For complex workflows with many steps or high-volume data processing, n8n's execution-based pricing becomes significantly more economical.
The real differentiator emerges in AI capabilities. n8n has integrated AI agents and advanced features, such as Retrieval Augmented Generation, making it an ideal solution for businesses that are pushing automation boundaries. Make offers AI tools, but lacks the depth and flexibility of n8n's AI integration.
If you need quick setup for standard business processes, prefer guided experiences, and value extensive pre-built integrations, choose Make.com. Choose n8n if you want maximum flexibility, plan to build complex or custom workflows, or need advanced AI capabilities. Your comfort with technical concepts and long-term automation goals should guide this decision.
Both platforms excel in their intended domains. The key is matching your team's capabilities and requirements to the right tool's strengths.
END NOTE
That's all from us for this week.
Part 1 of this newsletter established the fundamental building blocks of AI automation. We explored how n8n's visual approach makes complex workflows accessible, learned the basic mechanics of triggers and AI agents, and built a simple chatbot that demonstrates how language models process information. You now understand why memory matters in AI conversations, how tools extend agent capabilities with real-time data, and how output parsers structure responses for automated processing.
The real excitement starts next week when we tackle RAG workflows. RAG stands for Retrieval-Augmented Generation, which may sound technical, but it solves a very practical problem. Instead of relying on an AI model's general knowledge, you can upload your own documents, product requirements, books, or any other content, then build an agent that answers questions specifically about that information.
Think about the applications: a customer support agent who knows your entire product documentation, a research assistant who can analyze your company's historical reports, or a content creator who understands your brand guidelines and past campaigns. We'll walk through uploading PDFs, setting up the document processing pipeline, and creating an intelligent agent that can answer questions about your specific content.
By the end of next week's session, you'll have a working document intelligence agent and the knowledge to adapt it for your specific use case. This is where automation transforms from a helpful time-saver to a genuine business advantage.
Share the love ❤️ Tell your friends!
If you liked our newsletter, share this link with your friends and request them to subscribe too.
Check out our website to get the latest updates in AI
Reply