AI Trading Recommendations from Candlestick & News Data - n8n Workflow

Use this powerful n8n workflow to combine real-time financial data (candlesticks, news) and generate actionable trading recommendations using Google Gemini AI agents. Get started with n8n templates today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Algorithmic traders and quantitative analysts needing real-time market insights.

  • Users looking for advanced examples of using the n8n AI Agent and LangChain nodes.

  • Developers wanting to create automated financial advisors using a robust n8n workflow.

  • Anyone seeking a functional n8n template for integrating Telegram and financial APIs.

Overview

Generating timely and accurate stock trading recommendations requires processing vast amounts of multi-modal data quickly. This specialized n8n workflow solves this by streamlining the entire analysis process. It leverages multiple HTTP requests to gather raw financial data (candlesticks at 1, 15, and 60-minute intervals) and relevant market news.

Crucially, this n8n template uses Google Gemini via the AI Agent n8n node to synthesize this complex data. The workflow first structures and pre-analyzes the data, then feeds it to a dedicated AI Agent configured to act as a financial expert, providing actionable trading signals directly to the user's Telegram channel. This is an excellent example of a high-value, event-driven n8n automation.

How it Works

The entire process is initiated by a user command, making the Telegram Trigger the starting n8n trigger for this automation.


  1. Trigger and Validation: The n8n workflow starts when a message is received by the Telegram Trigger node. The subsequent Switch n8n node ('Account Check') performs necessary validation (e.g., verifying the user ID or command structure) before proceeding.

  2. Parallel Data Fetching: Upon successful validation, the workflow simultaneously executes four separate HTTP Requests: three for candlestick data at 1-minute, 15-minute, and 1-hour intervals, and one for the latest market news ('News Aggregator').

  3. Technical Data Consolidation: The three candlestick data streams are merged using a Merge n8n node, aggregated, and then processed by the 'Code in JavaScript' n8n node. This code node is essential for standardizing data formats or calculating technical indicators based on the collected OHLC (Open, High, Low, Close) information.

  4. News Sentiment Analysis: The raw news feed is sent to a 'Message a model' n8n node (utilizing Google Gemini) for rapid summarization and initial sentiment analysis.

  5. Final Synthesis and Recommendation: Both the processed technical data (from the Code node) and the analyzed news data (from the Gemini node) are merged and aggregated.

  6. AI Agent Decision: The fully compiled dataset is provided to the 'AI Agent' n8n node, which uses the 'Google Gemini Chat Model' to generate a final, definitive trading recommendation (Buy, Sell, Hold).

  7. Delivery: The final advice is sent back to the user instantly via the Telegram 'Send a text message' n8n node, closing the loop of this powerful n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON and import it into your n8n instance via the 'Workflows' tab.

  2. Configure Telegram Credentials: Set up credentials for both the 'Telegram Trigger' and the final 'Send a text message' n8n node. This requires a Telegram Bot token and knowing the Chat ID for outbound messages.

  3. Set up HTTP Request Nodes: Update the '1 min Interval', '15 min Interval', '1 hour Interval', and 'News Aggregator' n8n nodes with your preferred financial data API endpoints (e.g., Alpha Vantage, Polygon, etc.) and required API keys.

  4. Gemini/LangChain Setup: Configure credentials for the LangChain integration (Google Gemini). Ensure the 'AI Agent' n8n node has access to the appropriate model.

  5. Review Code Node: Customize the 'Code in JavaScript' n8n node logic based on the specific data format returned by your chosen financial APIs and any custom indicators you wish to calculate.

  6. Activate: Save the n8n workflow and activate it to begin receiving command triggers.

Node Details

Telegram Trigger (n8n trigger): Initiates the n8n workflow upon receiving a command message from a linked Telegram chat.
Account Check (Switch n8n node): Acts as a gatekeeper, routing requests only if they meet specified criteria (e.g., correct user or authorized command).
HTTP Request (1 min, 15 min, 1 hour Intervals): These parallel n8n nodes fetch time-series candlestick data from external financial APIs. They are critical data inputs for the analysis.
HTTP Request (News Aggregator n8n node): Retrieves recent market news relevant to the specified asset.
Code in JavaScript: A custom n8n node used to manipulate, clean, or perform calculations (like technical indicators) on the raw candlestick data before AI ingestion.
Message a model (Google Gemini n8n node): Performs preliminary analysis or summarization on the aggregated news data, preparing it for the main AI Agent.
AI Agent (LangChain n8n node): The core decision-making component. It takes both technical and fundamental (news) data to generate a final, reasoned trading recommendation using the configured Language Model.
Google Gemini Chat Model (LangChain n8n node): Provides the large language model capabilities necessary for the AI Agent to process and synthesize the financial information.


  • Merge & Aggregate n8n nodes: Used extensively throughout the n8n workflow to combine data streams retrieved in parallel, ensuring all necessary information is present before feeding into the next analytical step.

Related n8n Workflows

Paid

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Software Engineer & Automation Consultant with over 3+ years in experience helping teams streamline workflows with n8n, APIs, and AI-driven solutions.

Featured*