This workflow follows the Gmail Trigger → Google Sheets 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 →
{
"name": "A - UGC Opportunity Alert Bot",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyX",
"value": 5,
"unit": "minutes"
}
]
},
"simple": false,
"filters": {
"q": "(sideshift OR billo OR joinbrands OR insense OR collabstr OR \"UGC opportunity\" OR \"new brief\") newer_than:1d"
}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.2,
"position": [
-400,
0
],
"id": "gmail-trigger-1",
"name": "New UGC Platform Email",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// Pull the useful bits out of the raw Gmail item\nconst items = $input.all();\nreturn items.map(item => {\n const j = item.json;\n return {\n json: {\n subject: j.subject || j.Subject || '',\n from: j.from || j.From || '',\n snippet: j.snippet || j.text || j.textPlain || '',\n gmail_link: j.threadId ? `https://mail.google.com/mail/u/0/#inbox/${j.threadId}` : (j.id ? `https://mail.google.com/mail/u/0/#inbox/${j.id}` : ''),\n received_at: j.date || j.internalDate || new Date().toISOString()\n }\n };\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-160,
0
],
"id": "code-extract-1",
"name": "Extract Brief Info"
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "openAiApi",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ model: \"gpt-4.1-mini\", response_format: { type: \"json_object\" }, messages: [ { role: \"system\", content: \"You screen UGC (user-generated content) brand brief emails for a creator whose strategy is to chase niches that are TRENDING right now or where demand is rising faster than the supply of creators applying (low competition, high demand). Given the email subject/snippet, respond ONLY with compact JSON, no prose, in this exact shape: {\\\"brand\\\":\\\"\\\",\\\"platform\\\":\\\"\\\",\\\"niche\\\":\\\"\\\",\\\"trend_score\\\":0,\\\"low_supply_high_demand\\\":true,\\\"should_alert\\\":true,\\\"reasoning\\\":\\\"\\\"}. trend_score is 1-10 (10 = extremely hot/rising niche or urgent high-paying brief). should_alert should be true only when trend_score is 7 or higher OR the niche looks under-served.\" }, { role: \"user\", content: `Subject: ${$json.subject}\\nFrom: ${$json.from}\\nSnippet: ${$json.snippet}` } ] }) }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
80,
0
],
"id": "openai-score-1",
"name": "Score Opportunity",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const items = $input.all();\nreturn items.map((item, i) => {\n const source = $('Extract Brief Info').all()[i]?.json || {};\n let parsed = {};\n try {\n const raw = item.json.choices?.[0]?.message?.content || item.json.message?.content || item.json.content || item.json.text || '{}';\n parsed = JSON.parse(raw);\n } catch (e) {\n parsed = { brand: 'Unknown', platform: 'Unknown', niche: 'Unknown', trend_score: 0, low_supply_high_demand: false, should_alert: false, reasoning: 'Could not parse AI response' };\n }\n return {\n json: {\n date: new Date().toISOString().slice(0,10),\n brand: parsed.brand || 'Unknown',\n platform: parsed.platform || 'Unknown',\n niche: parsed.niche || 'Unknown',\n trend_score: parsed.trend_score || 0,\n reasoning: parsed.reasoning || '',\n should_alert: !!parsed.should_alert,\n status: 'Not Applied',\n gmail_link: source.gmail_link || ''\n }\n };\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
340,
0
],
"id": "code-parse-1",
"name": "Parse AI Score"
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "REPLACE_WITH_YOUR_SHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Opportunities",
"mode": "name"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Date": "={{ $json.date }}",
"Brand": "={{ $json.brand }}",
"Platform": "={{ $json.platform }}",
"Niche": "={{ $json.niche }}",
"TrendScore": "={{ $json.trend_score }}",
"Status": "={{ $json.status }}",
"GmailLink": "={{ $json.gmail_link }}",
"Reasoning": "={{ $json.reasoning }}"
}
}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
560,
0
],
"id": "sheets-log-1",
"name": "Log to Opportunities Sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"leftValue": "={{ $json.should_alert }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
780,
0
],
"id": "if-highpotential-1",
"name": "Is High Potential?"
},
{
"parameters": {
"chatId": "REPLACE_WITH_YOUR_TELEGRAM_CHAT_ID",
"text": "=\ud83d\udd25 New UGC opportunity ({{ $json.trend_score }}/10)\nBrand: {{ $json.brand }}\nPlatform: {{ $json.platform }}\nNiche: {{ $json.niche }}\nWhy: {{ $json.reasoning }}\nOpen: {{ $json.gmail_link }}",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1000,
0
],
"id": "telegram-alert-1",
"name": "Send Telegram Alert",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"New UGC Platform Email": {
"main": [
[
{
"node": "Extract Brief Info",
"type": "main",
"index": 0
}
]
]
},
"Extract Brief Info": {
"main": [
[
{
"node": "Score Opportunity",
"type": "main",
"index": 0
}
]
]
},
"Score Opportunity": {
"main": [
[
{
"node": "Parse AI Score",
"type": "main",
"index": 0
}
]
]
},
"Parse AI Score": {
"main": [
[
{
"node": "Log to Opportunities Sheet",
"type": "main",
"index": 0
}
]
]
},
"Log to Opportunities Sheet": {
"main": [
[
{
"node": "Is High Potential?",
"type": "main",
"index": 0
}
]
]
},
"Is High Potential?": {
"main": [
[
{
"node": "Send Telegram Alert",
"type": "main",
"index": 0
}
],
[]
]
}
},
"active": false,
"settings": {}
}
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.
gmailOAuth2googleSheetsOAuth2ApiopenAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
A - UGC Opportunity Alert Bot. Uses gmailTrigger, httpRequest, googleSheets, telegram. Event-driven trigger; 7 nodes.
Source: https://gist.github.com/APalermo79/973b0e2d09e7b4163606d578015b1b61 — 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 workflow ingests proof-of-delivery and completion documents from Gmail or a webhook, extracts key fields with an OpenRouter vision model, reconciles them against Google Sheets dispatch data, arch
Advanced AI Powered Document Parsing & Text Extraction with Llama Parse. Uses gmail, gmailTrigger, httpRequest, googleSheets. Webhook trigger; 54 nodes.
AICARE Email Blast System. Uses googleDrive, httpRequest, googleSheets, gmail. Event-driven trigger; 39 nodes.
Get notified if the actual data release is positive or negative for the relevant currency. Use the Telegram chat message about the news release as a trigger to open a trading position in MetaTrader 4.
An automated n8n workflow that monitors your Gmail inbox, classifies job application emails using a local AI (Ollama), and logs every application — with company, role, and status — to a Google Sheet i