This workflow corresponds to n8n.io template #5994 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "",
"name": "Grok-4 Stock Investment Analyst",
"tags": [],
"nodes": [
{
"id": "0b2f04c2-967e-4ca1-bfd8-10f7e36c2acd",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-120,
20
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 10
}
]
}
},
"typeVersion": 1.2
},
{
"id": "a46fcb0f-d668-4203-aa8b-b76ffd731ef6",
"name": "Grok-4 Stock Analyst Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
120,
20
],
"parameters": {
"text": "As a stock analyst agent:\n1. Please use the Google Sheet tool titled \"Stock Holdings Portfolio\" for my current stock holdings information\n\n2. Please research the latest stock market news in the last 24 hours using the Perplexity tool, and tell me how the latest stock market news affected my portfolio\n\n3. Give some analyst insights + buy/sell recommendations based on the news\n",
"options": {},
"promptType": "define"
},
"retryOnFail": false,
"typeVersion": 2
},
{
"id": "027b6215-647a-40a0-9341-0a199c61ffc8",
"name": "xAI Grok Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
"position": [
80,
240
],
"parameters": {
"model": "grok-4-0709",
"options": {}
},
"credentials": {
"xAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "43e3bbc7-7f17-4755-902d-c6ab122845ab",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
220,
240
],
"parameters": {
"sessionKey": "={{ $workflow.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "a779c609-3c10-48f9-b06d-6989bc42c40d",
"name": "Perplexity",
"type": "n8n-nodes-base.perplexityTool",
"position": [
380,
240
],
"parameters": {
"options": {
"searchRecency": "day"
},
"messages": {
"message": [
{
"content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('message0_Text', ``, 'string') }}"
}
]
},
"simplify": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Simplify_Output', ``, 'boolean') }}",
"requestOptions": {}
},
"credentials": {
"perplexityApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "e46bf600-7e37-4eb5-b438-775626f310c9",
"name": "Stock Holdings Portfolio",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
500,
240
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit",
"cachedResultName": "Your Google Sheet"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "5eb16e68-fe5a-41a5-9ea2-5957b13c9f31",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
1000,
20
],
"parameters": {
"sendTo": "user@example.com",
"message": "={{ $json.output }}",
"options": {},
"subject": "Stock Updates",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "acbc233d-91bb-40f6-9431-4c589c797043",
"name": "xAI Grok Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
"position": [
680,
240
],
"parameters": {
"model": "grok-4-0709",
"options": {}
},
"credentials": {
"xAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "1987513e-da25-47d0-8ef6-5181be09f907",
"name": "Summary Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
660,
20
],
"parameters": {
"text": "={{ $json.output }}",
"options": {
"systemMessage": "You are a helpful summary assistant, summarize the information received from user and output easily readable email format of the summary."
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "d07a6f28-00a3-41e5-855e-ebf6a88d03b2",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-120
],
"parameters": {
"height": 580,
"content": "On Schedule Trigger"
},
"typeVersion": 1
},
{
"id": "a029bfb4-21bb-4639-9ea4-2d9d159f3832",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
40,
-120
],
"parameters": {
"color": 4,
"width": 580,
"height": 580,
"content": "Grok-4 Stock Analyst Agent"
},
"typeVersion": 1
},
{
"id": "1a7d0e1d-bd98-43fc-bf45-8353f45401b2",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
-120
],
"parameters": {
"color": 5,
"width": 300,
"height": 580,
"content": "Grok-4 Summary Agent"
},
"typeVersion": 1
},
{
"id": "ac347c55-7834-4a61-9967-513472c89b2b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
960,
-120
],
"parameters": {
"color": 6,
"width": 300,
"height": 580,
"content": "Email Output"
},
"typeVersion": 1
},
{
"id": "7553afe2-a0f8-4ee1-adec-5d94fd6f0b6a",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
-120
],
"parameters": {
"color": 4,
"width": 560,
"height": 840,
"content": "\ud83d\udcca Grok-4 with Perplexity Stock Investment Analyst \u2013 Personalized Daily Market Insights\n\nThis workflow acts as your personal AI stock analyst\u2014powered by Grok-4, Perplexity, and Google Sheets\u2014to give you daily, tailored market insights based on your actual investment portfolio.\n\nEvery morning, the workflow:\n\nFetches your current stock holdings from a connected Google Sheet\n\nUses Perplexity to search and summarize the latest stock market news relevant to your portfolio\n\nLeverages Grok-4 AI to analyze how those news events impact your stocks\n\nProvides buy/sell/hold recommendations and AI-powered investment insights\n\nEmails you a clean, easy-to-read summary\u2014perfect for busy investors\n\nTo watch the step-by-step Tutorial build of this workflow, check out: https://youtu.be/OXzsh-Ba-8Y\n\nGoogle Sheet Template:\nhttps://docs.google.com/spreadsheets/d/1074dZk-vhwz6LML5zoiwHdxg89Z8u_mgl7wwzqf3A98/edit?usp=sharing\n\n\n\ud83e\udde0 What\u2019s Inside:\nAI Agent: Grok-4 Stock Analyst (via xAI Grok-4)\n\nTool Integrations:\n\u2003\ud83d\udcc4 Google Sheets (Portfolio input)\n\u2003\ud83d\udd0d Perplexity (News search)\n\u2003\u270d\ufe0f GPT Summary Agent (Readable output)\n\u2003\ud83d\udce7 Gmail (Automated delivery)\n\nSchedule: Runs daily at 10:00 AM by default (customizable)\n\n\ud83d\udca1 Use Cases:\nRetail investors seeking personalized news summaries\n\nPortfolio managers automating market analysis\n\nFintech startups prototyping intelligent investment advisors\n\nAnyone wanting actionable stock updates without reading 10+ articles"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "",
"connections": {
"Perplexity": {
"ai_tool": [
[
{
"node": "Grok-4 Stock Analyst Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Grok-4 Stock Analyst Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Summary Agent": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Grok-4 Stock Analyst Agent",
"type": "main",
"index": 0
}
]
]
},
"xAI Grok Chat Model": {
"ai_languageModel": [
[
{
"node": "Grok-4 Stock Analyst Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"xAI Grok Chat Model1": {
"ai_languageModel": [
[
{
"node": "Summary Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Stock Holdings Portfolio": {
"ai_tool": [
[
{
"node": "Grok-4 Stock Analyst Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Grok-4 Stock Analyst Agent": {
"main": [
[
{
"node": "Summary Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleSheetsOAuth2ApiperplexityApixAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Source: https://n8n.io/workflows/5994/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n workflow automates the daily monitoring of trends across X (Twitter), newsletters, and websites. It runs on a schedule, fetches data from configured sources in Google Sheets, processes it usi
This workflow is designed for stock traders, financial analysts, investment enthusiasts, and anyone interested in automated stock market analysis. It's particularly useful for those who want to make d
This workflow automatically generates 2–3 high-quality Indian stock investment ideas daily by combining trending stock data + latest market news, processing it with AI (Groq/OpenAI), avoiding duplicat
This n8n template automatically processes your industry newsletters and creates AI-powered intelligence briefs that filter signal from noise. Perfect for busy professionals who need to stay informed w
📊 Dynamic Portfolio Advisor – Daily Stock Market Intelligence with Google Sheets Description: This advanced AI-powered n8n workflow automatically delivers a daily market intelligence briefing tailored