GeminiCreativeWritingAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Send a Daily Nifty 50 Market Brief Using Gemini AI and Gmail

Scheduled trigger → fetch prices & news → data processing → AI analysis → merge & validate → generate brief → email delivery

Some experienceStepsWorkflowPrompt
Who
Traders, analysts, or portfolio managers who need a daily snapshot of the Indian Nifty 50 market
You get
Receive an AI-generated market brief under 120 words via email every day at 9:30 AM
You need
n8n · google-gemini · gmail

Constraints

Prerequisites: n8n account (self-hosted or cloud), Google Gemini API key, Gmail account connected in n8n, and access to public stock-quote and market-news APIs. Import the workflow JSON, configure credentials and recipient email, then activate the workflow.

What they did

weblineindia published an n8n workflow template that triggers daily at 9:30 AM, fetches Nifty 50 stock prices and financial news in parallel, processes the data through code nodes to produce top gainers/losers and news sentiment analysis, then uses Gemini AI to generate a market brief under 120 words and emails it via Gmail automatically.

How it went

The author states the workflow automatically generates and emails a concise market summary without manual effort. (author_report, not tested)

Worth knowing

Stock API endpoint is https://memic-nse-quotes-api.hf.space/quotes; news API is https://api.tradient.org/v1/api/market/news. Both are third-party public services; availability depends on the provider. The Gemini node uses models/gemini-3.1-flash-lite-preview. The Gmail node requires OAuth credentials and a sendTo recipient. To change the stock list, edit the symbols array in the Fetch Nifty 50 Stock Prices node's JSON body.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • After import, connect your own credentials on auth-required nodes; author secrets are not included.

Configuration to replace

  • Source template is n8n public workflow #15339 (~20 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-25

Steps

  1. Import workflow and configure credentials

    Import the workflow JSON into n8n. Configure Google Gemini API credentials. Enter the recipient email in the Gmail node's sendTo field. Adjust the Schedule Trigger time if needed (default 9:30).

  2. Fetch stock prices and market news

    After trigger, two HTTP Request nodes run in parallel: 1) Fetch Nifty 50 Stock Prices: POST to https://memic-nse-quotes-api.hf.space/quotes with a JSON body listing 50 Nifty symbols; 2) Fetch Market News: GET https://api.tradient.org/v1/api/market/news for latest financial news.

  3. Process stock data

    A Set node extracts the prices object; a Code node converts it to an array with Object.values; another Code node sorts by pchange and picks top 10 gainers and top 10 losers.

  4. Analyze news sentiment with AI

    Feed news data into the Google Gemini node. The model extracts stock names, assigns sentiment (Bullish/Bearish/Mixed), and gives a reason up to 50 words per item. A following Code node parses the AI response into structured JSON.

    Execution prompt · Source text。Analyze News Sentiment (AI) node messages.content field

    =Analyze the following financial news.
    
    Return:
    Every news object with added keys
    News Title:
    Stock Name: 
    Sentiment: Bullish / Bearish / Mixed
    Reason: (max 50 words)
    
    News:
    {{ JSON.stringify($json) }}
  5. Merge, validate, and structure data

    A Merge node combines stock insights with news analysis; an If node checks data is not empty; an Aggregate Dataset Code node flattens outputs into combinedData; a Structure Final Payload Set node prepares top_gainers, top_losers, and news fields.

  6. Generate market brief

    The Google Gemini node generates the email body. A system prompt sets the role as professional stock market analyst; the user prompt requests Nifty trend, news highlights, top gainers and losers, capped at 120 words in crisp bullet style.

    Execution prompt · Source text。Generate Market Brief (AI) node messages[0] (role=model)

    You are a professional stock market analyst. 
    Write concise, insightful and human-friendly summaries.

    Execution prompt · Source text。Generate Market Brief (AI) node messages[1] (role=user)

    =You are a professional Indian stock market analyst.
    
    Write a clean email.
    
    Format:
    Daily Market Brief
    
    - Mention Nifty trend
    - Market News: {{ JSON.stringify($json.combinedData[1].news) }}
    - Mention top gainers
    - Mention top losers
    
    Keep:
    - Max 120 words
    - Crisp bullet style
    - No fluff
    
    Top Gainers:
    {{ JSON.stringify($json.top_gainers) }}
    
    Top Losers:
    {{ JSON.stringify($json.top_losers) }}
  7. Send email

    The Gmail node sends a text email with subject "Daily Market Brief (AI Summary)" and body from the previous AI output. Ensure sendTo is filled and Gmail credentials are valid.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant to help user import, configure credentials, and run first test

This block is the prompt. Ads are never placed here.

You are an n8n setup assistant helping a user replicate the Daily Nifty 50 Market Brief workflow. Guide them to: 1) confirm they have an n8n instance, Gemini API key, and Gmail OAuth credentials; 2) import the workflow JSON and verify node connections; 3) check HTTP node URLs, Gemini model ID, and Gmail recipient; 4) run a manual test before activating the schedule trigger.

Prepare your Gemini API key and Gmail OAuth credentials before setup; stock and news APIs are public endpoints with no extra auth required.

Source

Send a daily Nifty 50 market brief using Gemini AI, Nifty 50 API and Gmail · weblineindia · n8n.io · 2026-04-27

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related