Skip to main content

Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini

Workflow preview

Workflow preview
100%
Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini preview
Open on n8n.io

1. Workflow Overview

(Wealth Management) Client Question → Instant Answer Assistant (n8n + Google Sheets + AI + API) This workflow allows users to ask portfolio related questions in a simple format ( ). It validates th...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.googlesheets, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.googlegemini, n8n-nodes-base.set, n8n-nodes-base.gmail

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini
Workflow name
Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini

(Wealth Management) Client Question → Instant Answer Assistant

(n8n + Google Sheets + AI + API)

This workflow allows users to ask portfolio-related questions in a simple format (C001: your question). It validates the input, fetches client data and holdings from Google Sheets, retrieves live market prices via API, calculates portfolio performance and generates a short AI-powered response.

Quick Implementation Steps

  1. Connect Google Sheets (clients, holdings, interaction_logs)
  2. Configure Get Live Prices API endpoint
  3. Add credentials for Generate AI Answer (Google Gemini)
  4. Ensure input format: C001: your question
  5. Run test cases (valid + invalid inputs)

What It Does

This workflow acts as an intelligent financial assistant that responds to client portfolio queries in real time. It starts by receiving a chat message through the When chat message received node and processes it using Parse Client Message to extract the client ID and question.

Once validated, it retrieves client details using Get Client Profile and portfolio holdings via Get Client Holdings. It then fetches live stock prices through the Get Live Prices API and merges all data using Merge Portfolio Data to compute metrics like invested value, current value, profit/loss and returns.

Finally, the workflow builds a structured prompt in Build AI Prompt and generates a concise response using Generate AI Answer, ensuring the reply is accurate, controlled and based only on available data.

Who Can Use This Workflow

  • Financial advisors managing multiple client portfolios
  • Wealth management platforms
  • Fintech developers building AI-driven assistants
  • Anyone looking to automate portfolio Q&A workflows

Requirements

  • n8n (self-hosted or cloud)
  • Google Sheets account with:
  • clients sheet
  • holdings sheet
  • interaction_logs sheet
  • Live price API endpoint (used in Get Live Prices)
  • Google Gemini API credentials (used in Generate AI Answer)

How It Works & Setup Guide

1. Trigger & Input Parsing

  • When chat message received receives input
  • Parse Client Message extracts:
  • client_id
  • question
  • IF Valid Input? validates format

If invalid:

  • Build Invalid Input Response
  • Log Invalid Input
  • Return Invalid Response

2. Client & Holdings Lookup

  • Get Client Profile fetches client details
  • IF Client Found? ensures existence
  • Get Client Holdings retrieves holdings
  • Prepare Symbols extracts stock symbols
  • IF Holdings Found? validates data

Failure handling:

  • Build Client Not Found Response
  • Build No Holdings Response

3. Market Data Fetching

  • Get Live Prices calls external API
  • Normalize Price Response standardizes output
  • IF Price API Worked? validates API success

Failure handling:

  • Build API Failed Response

4. Portfolio Calculation

  • Merge Portfolio Data computes:
  • Invested amount
  • Current value
  • P&L
  • Return %
  • Best performer
  • Weakest performer
  • Missing prices

5. Market Context (Optional Enhancement)

  • Get Market Context
  • Attach Market Context

Adds optional insights like:

  • Nifty/Sensex movement
  • Market tone

6. AI Response Generation

  • Build AI Prompt creates structured prompt
  • Generate AI Answer generates response
  • Extract AI Answer extracts clean reply

7. Final Output

Final response includes:

  • Client ID
  • Question
  • AI reply
  • Status
  • Timestamp

How To Customize Nodes

  • Parse Client Message
  • Modify input format rules
  • Get Live Prices
  • Replace with another API (Alpha Vantage, Twelve Data, etc.)
  • Merge Portfolio Data
  • Add more financial metrics (CAGR, allocation %, etc.)
  • Build AI Prompt
  • Change tone (formal, advisory, aggressive)
  • Generate AI Answer
  • Replace Gemini with Hugging Face / OpenAI models

Add-Ons (Enhancements)

  • Add Slack notifications for responses
  • Save AI replies to CRM
  • Add email delivery for clients
  • Implement caching for price API
  • Add retry logic for API failures
  • Support multi-client batch processing

Use Case Examples

  1. Client asks: “C001: How is my portfolio performing?”
  2. Advisor checks: “C002: Which stock is my top performer?”
  3. User queries: “C003: Why is my portfolio down?”
  4. Daily automated portfolio summary generation
  5. Integration with chatbot for real-time advisory

There can be many more use cases depending on how this workflow is extended.

Troubleshooting Guide

Issue Possible Cause Solution
Invalid input error Wrong format Use C001: your question
Client not found Missing in sheet Check clients sheet
No holdings found Empty data Verify holdings sheet
API failed Endpoint issue Check API URL or timeout
AI reply empty Model issue Verify API credentials
Incorrect calculations Missing price data Check API response

🤝 Need Help?

If you need help setting up this workflow, customizing nodes or building advanced automation solutions, feel free to reach out.

For professional support, custom workflow development or enterprise-grade automation, contact our n8n workflow developers at WeblineIndia. We help businesses build scalable and intelligent automation systems tailored to their needs.

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 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 2 - Parse Client Message

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

Block 3 - IF Valid Input?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Build Invalid Input Response

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

Block 5 - Log Invalid Input

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

Block 6 - Return Invalid Response

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

Block 7 - Get Client Profile

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

Block 8 - IF Client Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Build Client Not Found Response

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

Block 10 - Get Client Holdings

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

Block 11 - Prepare Symbols

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

Block 12 - IF Holdings Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 13 - Build No Holdings Response

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

Block 14 - Get Live Prices

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

Block 15 - Normalize Price Response

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

Block 16 - IF Price API Worked?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Build API Failed Response

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

Block 18 - Merge Portfolio Data

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

Block 19 - Get Market Context

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

Block 20 - Attach Market Context

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

Block 21 - Build AI Prompt

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

Block 22 - Generate AI Answer

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1.1

Block 23 - Extract AI Answer

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

Block 24 - Format Final Output

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

Showing the first 24 of 36 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini
Complexity advanced
Nodes 36
Categories Support Chatbot, AI Chatbot
Author WeblineIndia
Published 01 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14552/14552.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 Answer wealth management portfolio questions with Google Sheets, live prices and Google Gemini do?

(Wealth Management) Client Question → Instant Answer Assistant (n8n + Google Sheets + AI + API) This workflow allows users to ask portfolio related questions in a simple format ( ). It validates th...

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 Support Chatbot, AI Chatbot use case.