Scheduled Forex Analysis and Email Reporting using AI Agents - n8n Workflow

Automatically analyze USD/JPY rates every 4 hours using an n8n workflow powered by an AI agent, Tavily real-time news search, and structured output. Get timely FX analysis reports delivered via Gmail using this powerful n8n template.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Forex Traders & Analysts: Users needing frequent, automated technical and fundamental analysis reports on currency pairs.
Automation Enthusiasts: Those looking to build complex AI-powered workflows leveraging specialized n8n node functionalities like agents and output parsers.
Data Aggregators: Individuals requiring scheduled data retrieval (HTTP requests) combined with advanced summarization and reporting.
n8n Users: Anyone seeking advanced n8n templates demonstrating complex flow control, credential usage, and external API integration (Tavily, LLMs, Gmail).

Overview

Keeping up with the fast-moving Forex market requires continuous monitoring. This advanced n8n workflow solves the problem of manual rate checking and news gathering by providing a fully automated, scheduled analysis pipeline. The core of this automation is a sophisticated n8n agent node that acts as an expert financial analyst. This agent utilizes the Tavily Search API (acting as a Retrieval-Augmented Generation, or RAG, tool) to fetch the latest USD/JPY news in real-time. It then combines this fundamental data with technical analysis to generate a recommendation (Buy, Sell, or Hold) and delivers the comprehensive, structured report directly to your inbox via Gmail. This robust n8n workflow is a prime example of leveraging custom logic within the platform, ensuring timely and informed decision-making.

How it Works

This entire n8n workflow is driven by a schedule n8n trigger, initiating the process every four hours.


  1. Schedule Trigger: The workflow starts via the 'Run every 4 hours' n8n trigger.

  2. Configuration Setup: A Set n8n node configures necessary global variables, specifically your Tavily API Key and the recipient email address (notifyEmail).

  3. Rate Retrieval: An HTTP Request n8n node fetches the current USD/JPY exchange rate data from an external API.

  4. AI Agent Analysis: The core 'Analyze USD/JPY (AI agent)' n8n node takes the current rate and initiates a complex reasoning process. The agent is strictly instructed (via its system message) to utilize the defined tools.

  5. Real-Time News Search (RAG): When prompted by the agent, the dedicated 'Tool: Search Forex News (Tavily)' n8n node executes a real-time web search for USD/JPY news. This ensures the analysis is based on the latest fundamental data.

  6. Structured Output: The analysis generated by the AI agent is forced into a structured JSON format using the 'Tool: Structured Output Parser' n8n node. This ensures the final output includes specific fields like recommendation, technicalAnalysis, and newsAnalysis.

  7. Reporting: Finally, the 'Send results via Gmail' n8n node takes the structured JSON output, sets it as the email message body, and sends the USD/JPY analysis report to the configured recipient email address.

Installation Guide

To use this powerful n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance using the 'Import Workflow' function.

  2. Configure Credentials:

LLM Provider: Click the 'LLM provider (configure)' n8n node and set up your preferred LLM credential (e.g., OpenRouter, OpenAI, or other compatible service).
Gmail: Click the 'Send results via Gmail' n8n node and configure your Gmail or SMTP credential for email delivery.

  1. Set Global Variables: Navigate to the 'Set (Fields) — Configure me' n8n node.

Replace TAVILYAPIKEY> with your actual API key for real-time news retrieval.
Replace EMAIL_ADDRESS> with the email where you want to receive the analysis reports.

  1. Activate: Save the n8n workflow and toggle the status to 'Active'. The n8n trigger will now run the automation every four hours.

Node Details

This n8n workflow leverages several specialized n8n node types for its sophisticated function:

Run every 4 hours (Schedule Trigger): The starting point, acting as the primary n8n trigger. Configured to run reliably every 4 hours using a fixed interval rule.
Set (Fields) — Configure me (Set): A crucial n8n node for securely managing API keys (tavilyApiKey) and the recipient email (notifyEmail), making the n8n templates easy to customize.
Fetch USD/JPY rate (HTTP Request): Performs a GET request to https://api.exchangerate-api.com/v4/latest/USD to dynamically retrieve the latest FX rates.
Analyze USD/JPY (AI Agent): The primary processing n8n node. It uses a detailed Japanese system message defining its role as an FX analyst and explicitly requires the use of search and output parser tools to generate its recommendation.
Tool: Search Forex News (Tavily) (Tool HTTP Request): This n8n node is configured as a custom tool accessible by the AI agent. It sends a POST request to the Tavily search API, ensuring the agent gets current, specialized financial news related to USD/JPY.
Tool: Structured Output Parser (Output Parser Structured): Ensures the AI's final analysis is delivered in a predictable JSON structure with required keys (e.g., recommendation, reasoning).


  • Send results via Gmail (Gmail): The final action n8n node. It dynamically sets the message content using {{ JSON.stringify($json.output) }} to send the structured analysis directly.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
s3110
s3110

Featured*