AIMultipleAIMultiple
No results found.

Agentic AI n8n Tutorial

Cem Dilmegani
Cem Dilmegani
updated on Aug 12, 2025

We built an AI agent within n8n designed to provide investment advice, showcasing the platform’s capabilities for agentic AI. This process involved configuring the agent to perform technical and fundamental stock analysis by integrating 5 distinct tools and pulling financial data from various APIs.

See our agent in action in the video below:

Please note that the video has been sped up 4x.

You can read more about the architecture.

Introduction to n8n and AI automation

n8n is an open-source workflow automation tool that enables users to visually connect APIs and services, simplifying complex integrations. In 2025, n8n stands out for its AI capabilities, allowing the creation of intelligent agents for tasks like financial analysis. Its user-friendly interface, 400+ integrations, and active community make it accessible for both beginners and experts.

The n8n community contributes templates and workflows, including those tailored for finance, which users can adapt to quickly start their projects. Resources like tutorials, documentation, and forums provide valuable support for learning and troubleshooting.

Creating your n8n instance

To start using n8n, you first need an active instance. You have the flexibility to choose between setting it up yourself (self-hosting) or using the managed n8n Cloud service. For those opting for self-hosting, detailed setup instructions are available in the official installation guide found within n8n’s documentation. If you’re new or prefer a managed solution, n8n Cloud offers a convenient way to begin, often including a free trial period for evaluation.

You can read more about self-hosting LLMs that can be used with a local instance of n8n.

Managing credentials securely in n8n

When your workflows need to connect to external services like APIs or databases for RAG, etc., handling sensitive information like API keys or passwords securely is paramount. n8n provides a built-in credentials management system specifically for this purpose. Instead of embedding secrets directly in your workflows, you should securely store these credentials within this system, ensuring your sensitive data remains protected and isn’t accidentally exposed.

Financial Agent Architecture

  1. Trigger (When chat message received): The process kicks off when a user sends a message. This is the entry point for any interaction.
  1. The Core (AIMultiple Agent – Tools Agent): This is the central processing unit. It’s configured as a “Tools Agent,” meaning its primary function is to understand the user’s request and intelligently select and use the appropriate tools to fulfill it. It takes several key inputs:
  1. Chat Model (OpenRouter Chat Model): This is the Large Language Model (LLM) that provides the agent’s conversational abilities and reasoning power. OpenRouter likely offers flexibility in choosing specific underlying models known for strong analytical or conversational skills.

You can read more about AI gateways like OpenRouter and LLM pricing to choose the best model for your case.

  1. Memory (Window Buffer Memory): Essential for conversation! This component allows the agent to remember recent parts of the discussion, maintaining context and enabling follow-up questions. A “Window Buffer” typically keeps the last ‘N’ interactions.
  1. Tools (Tools Box): This is the agent’s analytical arsenal. The prompt explicitly defines the tools and their purpose, and the diagram shows them feeding into the agent:
  • GetChart: Generates technical analysis stock charts and provides a URL. Essential for visualizing price action, trends, support, and resistance.
  • SerpAPI: Accesses search engine results to gather recent news, sentiment, and fundamental context surrounding a stock.
  • GetFinancialStatementGrowth: Analyzes trends in key financial metrics (revenue, income, cash flow growth) from income statements, balance sheets, and cash flow statements.
  • GetRevenueProductSegmentation: Breaks down a company’s revenue by its different product lines or business segments. Vital for understanding where the money comes from.
  • GetRevenueGeographicSegment: Shows revenue distribution across different geographic regions, highlighting market strengths and dependencies.

You can see more real-world applications and use cases for agentic AI.

Disclaimer

The AI agent we built and demonstrated in the accompanying video was created solely as a technical proof-of-concept to showcase the capabilities of the n8n framework for building agentic AI workflows. Its purpose is educational and illustrative, demonstrating how various tools and APIs can be integrated within n8n to simulate complex tasks like financial analysis. This agent is NOT intended to provide actual investment advice.

💡Conclusion

We show n8n’s suitability for building multi-component AI agents by configuring a workflow with a trigger, a core Tools Agent, an LLM (OpenRouter), memory, and specialized tools (GetChart, SerpAPI, financial data retrieval). This created an agent simulating investment analysis tasks.

Our goal was met: showing how n8n’s visual system integrates diverse APIs and AI models for agentic processes. While applied to finance, the purpose was exploring n8n’s capability for these automated workflows, indicating its potential beyond basic tasks towards reasoning, tool-using systems. As emphasized, this remains a technical demonstration, not a functional financial tool.

FAQ about n8n

Principal Analyst
Cem Dilmegani
Cem Dilmegani
Principal Analyst
Cem has been the principal analyst at AIMultiple since 2017. AIMultiple informs hundreds of thousands of businesses (as per similarWeb) including 55% of Fortune 500 every month.

Cem's work has been cited by leading global publications including Business Insider, Forbes, Washington Post, global firms like Deloitte, HPE and NGOs like World Economic Forum and supranational organizations like European Commission. You can see more reputable companies and resources that referenced AIMultiple.

Throughout his career, Cem served as a tech consultant, tech buyer and tech entrepreneur. He advised enterprises on their technology decisions at McKinsey & Company and Altman Solon for more than a decade. He also published a McKinsey report on digitalization.

He led technology strategy and procurement of a telco while reporting to the CEO. He has also led commercial growth of deep tech company Hypatos that reached a 7 digit annual recurring revenue and a 9 digit valuation from 0 within 2 years. Cem's work in Hypatos was covered by leading technology publications like TechCrunch and Business Insider.

Cem regularly speaks at international technology conferences. He graduated from Bogazici University as a computer engineer and holds an MBA from Columbia Business School.
View Full Profile

Comments 0

Share Your Thoughts

Your email address will not be published. All fields are required.

0/450