Detect Bitcoin price spikes and send Gemini-powered NewsAPI Gmail alerts
Bitcoin Price Spike Detector with Gemini AI, NewsAPI & Gmail Alerts
This workflow monitors Bitcoin price changes every 30 minutes. If the price increases or decreases by 3% or more, it fetches recent Bitcoin-related news, summarizes it using AI (Google Gemini) and sends an email alert explaining the likely reason behind the price movement.
Quick Implementation Steps
Set up a Schedule Trigger (default: every 30 minutes) in your n8n account. Configure CoinGecko API (already public, no key required). Ensure your Data Table (crypto_price_db) exists. Add your NewsAPI API key in HTTP Request node. Configure Google Gemini API credentials. Connect your Gmail account. Replace the email recipient with your own. Activate the workflow.
What It Does
This workflow continuously monitors Bitcoin price fluctuations by fetching the latest price from CoinGecko at regular intervals. Each new price is stored in a data table and compared with previous entries to detect significant changes.
When a price movement of Β±3% or more is detected, the workflow automatically triggers a secondary process. It fetches recent Bitcoin-related news articles using NewsAPI, filters and aggregates relevant descriptions and sends them to an AI agent powered by Google Gemini.
The AI agent generates a concise summary of the news and explains the likely reason behind the price movement. Finally, it sends a well-crafted email alert with insights, helping users stay informed and react quickly to market changes.
Who It's For
Crypto traders and investors Financial analysts monitoring Bitcoin trends Automation enthusiasts using n8n Developers building AI-powered alert systems Anyone who wants real-time insights on Bitcoin price movements
Requirements
To use this workflow, you need:
n8n account (self-hosted or cloud)
Existing Data Table (crypto_price_db)
NewsAPI account & API key**
https://newsapi.org/
Google Gemini API key**
https://aistudio.google.com/welcome
Gmail account** connected via OAuth2
Internet access for API calls
How It Works & Set Up
- Schedule Trigger
Node: Execute at every 30 minutes Runs the workflow at regular intervals. You can modify this interval as needed.
- Fetch Bitcoin Price
Node: Fetch BitCoin Price API: CoinGecko Endpoint: https://api.coingecko.com/api/v3/simple/price Query: ids=bitcoin vs_currencies=usd
- Store Price in Data Table
Node: Add bitcoin price to sheet Stores the latest price in crypto_price_db.
- Retrieve Recent Prices
Nodes: Get all prices from sheet** Get last two prices from sheet** Keeps only the latest two entries for comparison.
- Prepare Data
Node: Edit Fields Ensures the price field is properly formatted.
- Detect Price Change
π Price Increase (β₯ 3%)
Node: If new price is increased by 3% Condition compares latest vs previous price.
π Price Decrease (β₯ 3%)
Node: If new price is dropped by 3%
- Fetch News
Nodes: Fetch news about bitcoin** Fetch news about bitcoin1** API: NewsAPI Query: q=bitcoin
Setup NewsAPI
Create account at https://newsapi.org/ Generate API key Add it in HTTP Request node β Headers
- Filter & Aggregate News
Nodes: Filter all news** Aggregate filtered news** Extracts only article descriptions and combines them.
- AI Processing (Google Gemini)
Nodes: AI Agent** Google Gemini Chat Model**
Setup Gemini API
Go to https://aistudio.google.com/welcome Generate API key Add credentials in n8n: Type: Google PaLM / Gemini Paste API key
AI Task:
Summarize news Explain price movement Generate email subject & content
- Send Email Alert
Nodes: Send a message in Gmail** Sends AI-generated email.
Important:
Replace: errorcommits@mailinator.com with your own email address.
How To Customize Nodes
Change Price Threshold** Modify IF node conditions (e.g., 5% instead of 3%)
Change Cryptocurrency** Update CoinGecko ids parameter
Modify Email Content** Adjust AI prompt inside AI Agent nodes
Adjust Frequency** Change Schedule Trigger interval
News Filtering** Modify Code node to include titles, sources or keywords
Add-Ons (Enhancements)
Add Slack / Telegram alerts Store historical data in Google Sheets or database Add support for multiple cryptocurrencies Create a dashboard using n8n + external tools Add sentiment analysis on news Trigger trading bots or alerts
Use Case Examples
Crypto Trading Alerts
Get instant insights when Bitcoin price moves significantly.
Market Analysis Automation
Automatically correlate price changes with real-world news.
Portfolio Monitoring
Track assets and receive alerts without manual checks.
AI-Powered Financial Reports
Generate automated summaries for decision-making.
Research & Insights Tool
Understand market sentiment quickly.
And many more use cases can be built on top of this workflow.
Troubleshooting Guide
| Issue | Possible Cause | Solution | |------|---------------|---------| | No email received | Gmail not configured | Reconnect Gmail OAuth2 credentials | | No news data | Missing NewsAPI key | Add API key in HTTP Request headers | | AI not responding | Gemini API not configured | Verify Gemini credentials | | Workflow not triggering | Schedule not active | Activate workflow | | Incorrect price comparison | Data table missing values | Ensure table stores numeric USD values | | Empty email content | News descriptions missing | Check Code node output |
Need Help?
If you need assistance setting up this workflow, customizing it or extending it with advanced features like multi-crypto tracking, dashboards or AI enhancements β weβre here to help.
Contact WeblineIndia for:
Workflow setup & deployment Custom automation solutions AI-powered business workflows Add-on feature development
Let us help you turn automation into a competitive advantage.
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
π° AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments