Building an AI Stock Analysis Agent With n8n and ChatGPT
Watch on TikTok
This tutorial walks through building a no-code AI agent that performs technical analysis on any stock you ask about. It uses n8n for the workflow automation, ChartImage.com for stock charts, and ChatGPT for the actual analysis. The whole thing takes about five minutes to set up.
Setting Up the Agent
Start at n8n.io with a free account. Create a new workflow and search for the "AI Agent" node. Configure a chat model (OpenAI GPT-4.0 works well), keep the default Windows Buffer Memory settings, and leave the tools section empty for now. The tools will come from a separate workflow.

The Analysis Workflow
The backend workflow handles the actual stock analysis. When the agent receives a message like "analyze Apple," it extracts the ticker symbol and passes it through a chain of modules.

The pipeline works in stages:
- Extract the ticker from the user's message
- Fetch the chart from ChartImage.com using their API (copy the curl command from their site)
- Download the chart image so it can be sent to ChatGPT
- Send the chart to ChatGPT with a prompt telling it how to perform technical analysis
- Return the analysis and chart back to the agent
The technical analysis prompt is customizable. You can write your own criteria for what the model should look for, or have ChatGPT generate a prompt for you.
Testing It Out
Hit the chat button at the bottom of n8n, type something like "Can you analyze Tesla's stock?" and the agent returns a written analysis based on the chart along with the chart image itself.

Extending the Agent
The stock analysis tool can be plugged into a larger personal assistant agent alongside other tools. The creator shows his own setup with multiple tools accessible through Telegram, including voice input and voice responses.
Key Takeaways
- n8n's AI Agent node combined with a custom workflow creates a stock analysis tool in minutes
- ChartImage.com provides stock chart images via API
- ChatGPT analyzes the chart visually and returns written technical analysis
- The tool can be integrated into a larger personal assistant agent
Resources
- n8n -- Open-source workflow automation platform
- ChartImage.com -- Stock chart image API
- OpenAI API -- GPT-4 for visual chart analysis
Published May 25, 2026. Writeup generated from a favorited TikTok.