Skip to main content

Predict next 5-day stock trends with Twelve Data API & Google Sheets

Workflow preview

Workflow preview
100%
Predict next 5-day stock trends with Twelve Data API & Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This automated n8n workflow fetches stock data from the Twelve Data API after market close, predicts 5 day trends using AI analysis, updates Google Sheets with the results, and sends an email summa...

Best for

  • Crypto Trading automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.cron, n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.emailsend, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Predict next 5-day stock trends with Twelve Data API & Google Sheets
Workflow name
Predict next 5-day stock trends with Twelve Data API & Google Sheets

This automated n8n workflow fetches stock data from the Twelve Data API after market close, predicts 5-day trends using AI analysis, updates Google Sheets with the results, and sends an email summary report. This process helps users stay informed about stock movements and make data-driven decisions efficiently.

Good to Know

  • AI prediction accuracy improves with more historical stock data.
  • Market conditions and external factors can influence prediction outcomes.
  • Google Sheets access must be authorized to ensure smooth data updates.
  • Email notifications ensure timely delivery of summary reports.
  • The system relies on the Twelve Data API as the primary data source.

How It Works

  • Daily Market Close Trigger - Initiates the workflow daily at 9:00 PM (after market close), Monday to Friday.
  • Read Stock Symbols - Reads stock symbols from a Google Sheet to determine which stocks to analyze.
  • Set Configuration Variables - Configures API keys and other necessary variables manually.
  • Fetch 5-Day Stock Data - Retrieves 5-day stock data from the Twelve Data API.
  • Analyze Stock Trends - Uses AI to predict 5-day stock price movements based on the fetched data.
  • Update Google Sheet - Appends the analysis results to a Google Sheet for tracking.
  • Format Email Report - Creates a concise, human-friendly summary of the stock predictions.
  • Send Email Report - Delivers the summary report via email to designated recipients.

Data Sources

The workflow utilizes one Google Sheet:

  • Stock Data Sheet - Contains stock analysis data with columns:
    • Date (date)
    • Stock Symbol (text)
    • Current Price (number)
    • Predicted 5-Day Trend (text)
    • Confidence Level (number)
    • Notes (text)

How to Use

  • Import the workflow into n8n.
  • Configure Google Sheets API access and authorize the application.
  • Set up email credentials for report delivery.
  • Create the required Google Sheet with the specified column structure.
  • Configure the Twelve Data API key.
  • Test with sample stock data to verify predictions and email delivery.
  • Adjust analysis parameters based on your specific stock monitoring needs.
  • Monitor and refine the system based on actual vs. predicted trends.

Requirements

  • Google Sheets API access.
  • Email service credentials (Gmail, SMTP, etc.).
  • Twelve Data API key.
  • Initial stock data for analysis.

Customizing This Workflow

Modify the Stock Trend Predictor parameters to focus on specific stock sectors or adjust prediction horizons. Customize the email report format to match your preferences and integrate additional data sources like news feeds or financial indicators if needed.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Daily Market Close Trigger

Type / Role
n8n-nodes-base.cron - cron
Config choices
Version 1

Block 2 - Read Stock Symbols

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.3

Block 3 - Set Configuration Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Fetch 5-Day Stock Data

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Analyze Stock Trends

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Update Google Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.3

Block 7 - Format Email Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Send Email Report

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Predict next 5-day stock trends with Twelve Data API & Google Sheets
Complexity intermediate
Nodes 14
Categories Crypto Trading, AI Summarization
Author Oneclick AI Squad
Published 16 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9771/9771.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Predict next 5-day stock trends with Twelve Data API & Google Sheets do?

This automated n8n workflow fetches stock data from the Twelve Data API after market close, predicts 5 day trends using AI analysis, updates Google Sheets with the results, and sends an email summa...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading, AI Summarization use case.