# templates

name: Forex News & Sentiment Telegram Alerts
author_name: Malik Hashir
author_username: malikx
categories: []
created_at: 2025-06-04T17:29:02.034Z
updated_at: 2025-06-04T17:29:02.034Z
url: https://n8n.io/workflows/4659
scraped_at: 2025-07-06 21:16:30
description:
  Purpose & Audience

  This n8n workflow template is designed for Forex traders, analysts, and enthusiasts who want to automate the process of staying updated on the latest news and sentiment for any currency pair. By leveraging advanced news aggregation and sentiment analysis, the workflow delivers concise, actionable updates directly to your Telegram—helping you make more informed trading decisions without manual research on news for broader market sentiment.

  What It Does?
  Aggregates the latest news from major Forex platforms for your chosen currency pair.
  Analyzes the news to extract market sentiment (bullish, bearish, or neutral) using an LLM.
  Summarizes key headlines, technical levels (support/resistance), and highlights high-impact economic events.
  Sends a neatly formatted update to your selected Telegram chat or group at your preferred schedule.

  Who Is It For?
  Forex traders seeking a competitive edge by staying ahead of market sentiment shifts.
  Analysts who want automated, unbiased news curation and sentiment summaries.
  Anyone looking for a hands-off, plug-and-play solution to monitor any currency pair.

  Setup once, and you can use this workflow for a lifetime. Simply duplicate the workflow for as many currency pairs as you want—customize the inputs, and you’re set! No recurring fees, no coding required, and you control the update frequency and destinations.

  How to Set Up?
  Choose your currency pair and set your preferred update schedule.
  Connect your LLM and Telegram credentials (simple, guided steps included).
  Specify where you want to receive the updates.
  That’s it—receive real-time, actionable Forex news and sentiment updates automatically.

nodes_used:
  ["n8n-nodes-base.telegram","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatGoogleGemini"]

workflow_json:
  {"meta":{"instanceId":"d04643ba872bb0fb252ed2c8197858d58cc47dd3c15ff6d08b19addd679e927b","templateCredsSetupCompleted":true},"nodes":[{"id":"89e47470-32c3-41f3-a204-e462353c1b2f","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2740,1480],"parameters":{"content":""},"typeVersion":1},{"id":"70f22f05-6852-42ce-9067-14b2f6737654","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-560,1980],"parameters":{"content":""},"typeVersion":1},{"id":"0b262b17-e4a3-48b3-bbaa-e248403633ba","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1880,660],"parameters":{"content":""},"typeVersion":1},{"id":"167f32c5-534d-4921-8b7e-cb13ba0793d8","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-500,1420],"parameters":{"content":""},"typeVersion":1},{"id":"c8d90c8e-6aaf-45f9-87d5-5812d36b48d7","name":"Merge","type":"n8n-nodes-base.merge","position":[-1140,1600],"parameters":{},"typeVersion":3.1},{"id":"c8d3df3b-a8a5-4138-975c-90c8dae1477f","name":"RSS Read - GOOGLE","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1080],"parameters":{},"typeVersion":1.1},{"id":"94460646-64fb-47ad-b2a5-a67d7a3f1737","name":"RSS Read - FXSTREET","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1360],"parameters":{},"typeVersion":1.1},{"id":"9e987f83-b062-49c3-9c84-c23335fc3d3a","name":"RSS Read -  fxstreet news","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1220],"parameters":{},"typeVersion":1.1},{"id":"32cc633a-29f8-453e-9911-99316be8e1ef","name":"RSS Read - DAILYFX technical","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1500],"parameters":{},"typeVersion":1.1},{"id":"65d2e386-2c68-4785-902e-a1822bd3ed31","name":"RSS Read - DAILYFX fundamental","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1660],"parameters":{},"typeVersion":1.1},{"id":"677b8362-4482-4fe4-a84e-46f69e1658fe","name":"RSS Read - DAILYFX forexnews","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1820],"parameters":{},"typeVersion":1.1},{"id":"953908e0-357d-44be-b002-85d19575049f","name":"RSS Read - DAILYFX forex articles","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1980],"parameters":{},"typeVersion":1.1},{"id":"b65d6a84-2f45-4284-b7bf-e2176aa18451","name":"RSS Read - FOREX LIVE technicals","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2160],"parameters":{},"typeVersion":1.1},{"id":"fa91f6b5-c7c4-40de-86c0-e62da507d058","name":"RSS Read - FOREX LIVE central banks","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2320],"parameters":{},"typeVersion":1.1},{"id":"ede5263d-6cb1-4f4a-adcd-e67f8e1640b9","name":"RSS Read - FOREX LIVE forexorders","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2480],"parameters":{},"typeVersion":1.1},{"id":"e5e6521a-4838-4bd5-a3f4-667cc6ff36ec","name":"Filter","type":"n8n-nodes-base.filter","position":[-880,1740],"parameters":{},"typeVersion":2.2},{"id":"7c973bba-fb06-44ae-b13b-0f7d5f0231a7","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-480,2040],"parameters":{},"typeVersion":1},{"id":"d37f99d5-bbec-4b76-ba96-28325f19f81c","name":"Code","type":"n8n-nodes-base.code","position":[-640,1740],"parameters":{},"typeVersion":2},{"id":"7e42a4b6-37eb-48ad-acea-7a41f1eb1c64","name":"Telegram","type":"n8n-nodes-base.telegram","position":[200,1720],"webhookId":"b655c643-9912-43a8-9d01-cf136ff37262","parameters":{},"typeVersion":1.2},{"id":"5d9ce7ea-69b6-4c58-876e-ee9b910f1a1b","name":"EURUSD News and Sentiment Analyst","type":"@n8n/n8n-nodes-langchain.agent","position":[-400,1740],"parameters":{},"typeVersion":1.8},{"id":"c267daf2-72a8-45d0-9145-20aabebeb6d9","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-2660,1640],"parameters":{},"typeVersion":1.2},{"id":"c6c12ad2-228a-4cd0-bd20-fc4d46dd7c32","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-940,1580],"parameters":{"content":""},"typeVersion":1}],"connections":{"Code":{"main":[[{"node":"EURUSD News and Sentiment Analyst","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Filter","type":"main","index":0}]]},"Filter":{"main":[[{"node":"Code","type":"main","index":0}]]},"Telegram":{"main":[[]]},"Schedule Trigger":{"main":[[{"node":"RSS Read - GOOGLE","type":"main","index":0},{"node":"RSS Read -  fxstreet news","type":"main","index":0},{"node":"RSS Read - FXSTREET","type":"main","index":0},{"node":"RSS Read - DAILYFX technical","type":"main","index":0},{"node":"RSS Read - DAILYFX fundamental","type":"main","index":0},{"node":"RSS Read - DAILYFX forexnews","type":"main","index":0},{"node":"RSS Read - DAILYFX forex articles","type":"main","index":0},{"node":"RSS Read - FOREX LIVE technicals","type":"main","index":0},{"node":"RSS Read - FOREX LIVE central banks","type":"main","index":0},{"node":"RSS Read - FOREX LIVE forexorders","type":"main","index":0}]]},"RSS Read - GOOGLE":{"main":[[{"node":"Merge","type":"main","index":0}]]},"RSS Read - FXSTREET":{"main":[[{"node":"Merge","type":"main","index":2}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"EURUSD News and Sentiment Analyst","type":"ai_languageModel","index":0}]]},"RSS Read -  fxstreet news":{"main":[[{"node":"Merge","type":"main","index":1}]]},"RSS Read - DAILYFX forexnews":{"main":[[{"node":"Merge","type":"main","index":5}]]},"RSS Read - DAILYFX technical":{"main":[[{"node":"Merge","type":"main","index":3}]]},"RSS Read - DAILYFX fundamental":{"main":[[{"node":"Merge","type":"main","index":4}]]},"RSS Read - FOREX LIVE technicals":{"main":[[{"node":"Merge","type":"main","index":7}]]},"EURUSD News and Sentiment Analyst":{"main":[[{"node":"Telegram","type":"main","index":0}]]},"RSS Read - DAILYFX forex articles":{"main":[[{"node":"Merge","type":"main","index":6}]]},"RSS Read - FOREX LIVE forexorders":{"main":[[{"node":"Merge","type":"main","index":9}]]},"RSS Read - FOREX LIVE central banks":{"main":[[{"node":"Merge","type":"main","index":8}]]}}}


name: Enrich Company Data from LinkedIn via Bright Data & Google Sheets
author_name: Gleb D
author_username: glebd
categories: []
created_at: 2025-06-04T19:50:41.467Z
updated_at: 2025-06-04T19:50:41.467Z
url: https://n8n.io/workflows/4663
scraped_at: 2025-07-06 21:16:30
description:
  This n8n workflow automates the enrichment of a company list by discovering and extracting each company’s official LinkedIn URL using Bright Data’s search capabilities and Google Gemini AI for HTML parsing and result interpretation.

  Who is this template for?
  This workflow is ideal for sales, business development, and data research professionals who need to collect official LinkedIn company profiles for multiple organizations, starting from a list of company names in Google Sheets. It’s especially useful for teams who want to automate sourcing LinkedIn URLs, enrich their prospect database, or validate company data at scale.

  How it works
  Manual Trigger:
  The workflow is started manually (useful for controlled batch runs and testing).
  Read Company Names:
  Company names are loaded from a specified Google Sheets table.
  Loop Over Each Company:
  Each company is processed one-by-one:
  A custom Google Search URL is generated for each name.
  A Bright Data Web Unlocker request is sent to fetch Google search results for “site:linkedin.com [company name]”.
  Parse LinkedIn Profile URL Using AI:
  Google Gemini (or your specified LLM) analyzes the fetched search page and extracts the most likely official LinkedIn company profile.

  Result Handling:
  If a profile is found, it’s stored in the results.
  If not, an empty result is created, but you can add custom logic (notifications, retries, etc.).

  Batch Data Enrichment:
  All found company URLs are bundled into a single request for further enrichment from a Bright Data dataset.
  Export:
  The workflow appends the final, structured data for each company to another sheet in your Google Sheets file.
  Setup instructions
  1. Replace API Keys:
  Insert your Bright Data API key in these nodes:
  Bright Data Web Request - Google Search for Company LinkedIn URL
  HTTP Request - Post API call to Bright Data
  Snapshot Progress
  HTTP Request - Getting data from Bright Data

  2. Connect Google Sheets:
  Set up your Google Sheets credentials and specify the sheet for reading input and writing output.

  3. Customize Output Structure:
  Adjust the Python code node (see sticky note in the template) if you want to include additional or fewer fields in your output.

  4. Adjust for Scale or Error Handling:
  You can modify the logic for “not found” results (e.g., to notify a Slack channel or retry failed companies).

  5. Run the Workflow:
  Start manually, monitor the run, and check your Google Sheet for results.

  Customization guidance
  Change Input/Output Sheets:
  Update the sheet names or columns if your source/target spreadsheet has a different structure.

  Use Another AI Model:
  Replace the Google Gemini node with another LLM node if preferred.

  Integrate Alerts:
  Add Slack or email nodes to notify your team when a LinkedIn profile is not found or when the process is complete.

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.chainLlm","@n8n/n8n-nodes-langchain.outputParserStructured","@n8n/n8n-nodes-langchain.lmChatGoogleGemini"]

workflow_json:
  {"meta":{"instanceId":"71eb5622cf8abac565805540c0900dbae437dddbda45bf1b87bf3bfeea26393c"},"nodes":[{"id":"aa049b35-0923-44ad-a750-ed8977df734b","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-380,380],"parameters":{},"typeVersion":1},{"id":"5782ed4a-bcba-410f-b783-38a6ffa39c76","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","position":[60,380],"parameters":{"options":{}},"typeVersion":3},{"id":"51684e89-da9e-4b33-a48c-bda72dfb0e17","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[960,820],"parameters":{"options":{},"modelName":"models/gemini-2.0-flash-lite"},"typeVersion":1},{"id":"37d54ef1-f56b-49e5-aced-2770d472a3a0","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1100,820],"parameters":{"jsonSchemaExample":"[{\n  \"company_name\": \"string\",\n  \"url\": \"string\"\n}]\n"},"typeVersion":1.2},{"id":"1b4e1b6b-569e-4edf-8cb5-d5b63f7b2d5a","name":"LinkedIn Profile is Found?","type":"n8n-nodes-base.if","position":[1320,640],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"645d85d3-c5cc-4e51-a989-075c0a851449","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.output[0]['url'] }}","rightValue":1},{"id":"b44e6a86-9a9b-4d3e-b9c8-cf75bba8ed03","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"","rightValue":""}]}},"typeVersion":2.2},{"id":"433f25c7-d7da-4890-be0d-6c3c7a0d77f8","name":"Merge","type":"n8n-nodes-base.merge","position":[1760,800],"parameters":{},"typeVersion":3.2},{"id":"0dbcc1b6-7610-4273-8456-c85212de4b53","name":"Add Unique Result","type":"n8n-nodes-base.set","position":[1540,640],"parameters":{"mode":"raw","options":{},"jsonOutput":"={{ $json.output[0] }}\n"},"typeVersion":3.4},{"id":"96bda408-f0cb-4ce3-b3b5-6b6dfc2bafdb","name":"Snapshot Progress","type":"n8n-nodes-base.httpRequest","position":[940,380],"parameters":{"url":"=https://api.brightdata.com/datasets/v3/progress/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"ca614256-7b3c-45dd-89f7-70760acdaf8a","name":"HTTP Request- Post API call to Bright Data","type":"n8n-nodes-base.httpRequest","position":[500,380],"parameters":{"url":"https://api.brightdata.com/datasets/v3/trigger","method":"POST","options":{},"jsonBody":"={{ $json.companies }}","sendBody":true,"sendQuery":true,"sendHeaders":true,"specifyBody":"json","queryParameters":{"parameters":[{"name":"dataset_id","value":"gd_l1vikfnt1wgvvqz95w"},{"name":"include_errors","value":"true"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"eeb638d6-ecbc-4136-bb85-15dc4c6df6d4","name":"Wait - Polling Bright Data","type":"n8n-nodes-base.wait","position":[720,380],"webhookId":"8005a2b3-2195-479e-badb-d90e4240e699","parameters":{"amount":15},"executeOnce":false,"typeVersion":1.1},{"id":"96d0e0e0-f5b9-4659-bd56-6aef99cbdd75","name":"HTTP Request - Getting data from Bright Data","type":"n8n-nodes-base.httpRequest","position":[1380,380],"parameters":{"url":"=https://api.brightdata.com/datasets/v3/snapshot/{{ $json.snapshot_id }}","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"format","value":"json"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"f27c0593-5155-429f-bb81-b4d55bebea69","name":"Checking status of Snapshot - if data is ready or not","type":"n8n-nodes-base.if","position":[1160,380],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7932282b-71bb-4bbb-ab73-4978e554de7e","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.status }}","rightValue":"running"}]}},"typeVersion":2.2},{"id":"62ae1d4f-8b09-4629-aa79-1d718955cfcd","name":"Code - Parse and Organize JSON Data","type":"n8n-nodes-base.code","position":[1600,380],"parameters":{"language":"python","pythonCode":"cleaned = []\nfor item in items:\n  if not item.get(\"json\"):\n      raise ValueError(\"Missing input data on one of the inputs.\")\n    \n  company = item.get(\"json\")\n  \n  cleaned.append({\n    \"brightdata_name\": company.get(\"name\"),\n    \"country\": company.get(\"country_code\"),\n    \"linkedin_employees\": company.get(\"employees_in_linkedin\"),\n    \"about\": company.get(\"about\"),\n    \"description\": company.get(\"description\"),\n    \"additional_info\": company.get(\"additional_information\"),\n    \"specialties\": company.get(\"specialties\"),\n    \"company_size\": company.get(\"company_size\"),\n    \"type\": company.get(\"organization_type\"),\n    \"industries\": company.get(\"industries\"),\n    \"founded\": company.get(\"founded\"),\n    \"headquarters\": company.get(\"headquarters\"),\n    \"funding\": company.get(\"funding\"),\n    \"stock_info\": company.get(\"stock_info\"),\n    \"url\": company.get(\"url\"),\n    \"website\": company.get(\"website\"),\n    \"crunchbase_url\": company.get(\"crunchbase_url\"),\n    \n  })\n\nreturn [{ \"json\": company } for company in cleaned]\n"},"typeVersion":2,"alwaysOutputData":true},{"id":"42779d1f-4b94-4b35-aad6-1a4f95ad3d35","name":"Code - Prepare Request Body for Bright Data","type":"n8n-nodes-base.code","position":[280,380],"parameters":{"language":"python","pythonCode":"result_urls = []\nfor item in items:\n  #print(\"Item keys:\", list(item.keys()))\n  if item[\"json\"].get(\"url\"):\n    result_urls.append(item[\"json\"].get(\"url\"))\n#print(f\"Result URLs: {result_urls}\")\nreturn [{\n  \"json\": {\n    \"companies\": [{\"url\": url} for url in result_urls]\n  }\n}]\n"},"typeVersion":2},{"id":"cc629ea1-dd49-4f02-a31d-4288b957b10f","name":"Add Empty result","type":"n8n-nodes-base.set","position":[1540,800],"parameters":{"mode":"raw","options":{},"jsonOutput":"=    {\"company_name\": \"{{ $('Loop Over Items').item.json['name']}} (NOT FOUND)\",\n    \"url\": \"\"}\n"},"typeVersion":3.4},{"id":"cff46875-df95-4db2-afb7-62675c9118a1","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1540,180],"parameters":{"height":180,"content":"## Customization of the output data\nYou can modify the JSON keys in the code to include only the fields you want or add any additional. The current structure is a sample template."},"typeVersion":1},{"id":"c5bcbe49-328f-467d-a9b8-d32d1c4875a7","name":"Extract Body from Response","type":"n8n-nodes-base.set","position":[720,640],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6b95685b-3286-4643-bfa1-6335d3f8cb39","name":"result_body","type":"string","value":"={{ $json.body }}"}]}},"typeVersion":3.4},{"id":"da01b056-0400-4879-8827-e4da705e014f","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-160,-20],"parameters":{"width":320,"height":380,"content":"## Each Company is Processed Individually\nEvery company name from the Google Sheets column is processed in a separate loop.\n\nFor each company:\n- A unique Google search query is generated\n- The search results are fetched using Bright Data API Request\n- AI-powered parsing extracts the official LinkedIn profile\n- This ensures accurate and dedicated extracting the LinkedIn URL for each company in the list."},"typeVersion":1},{"id":"587ffc7f-004b-47a0-b4a4-1d9001006b55","name":"Append Results to Google Sheets table","type":"n8n-nodes-base.googleSheets","position":[1820,380],"parameters":{"columns":{"value":{"name":"={{ $json.companies[0].name }}"},"schema":[{"id":"name","type":"string","display":true,"removed":false,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"founded","type":"string","display":true,"removed":false,"required":false,"displayName":"founded","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about","type":"string","display":true,"removed":false,"required":false,"displayName":"about","defaultMatch":false,"canBeUsedToMatch":true},{"id":"num_employees","type":"string","display":true,"removed":false,"required":false,"displayName":"num_employees","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"removed":false,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ipo_status","type":"string","display":true,"removed":false,"required":false,"displayName":"ipo_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"full_description","type":"string","display":true,"removed":false,"required":false,"displayName":"full_description","defaultMatch":false,"canBeUsedToMatch":true},{"id":"social_media_links","type":"string","display":true,"removed":false,"required":false,"displayName":"social_media_links","defaultMatch":false,"canBeUsedToMatch":true},{"id":"website","type":"string","display":true,"removed":false,"required":false,"displayName":"website","defaultMatch":false,"canBeUsedToMatch":true},{"id":"finding_total","type":"string","display":true,"removed":false,"required":false,"displayName":"finding_total","defaultMatch":false,"canBeUsedToMatch":true},{"id":"num_investors","type":"string","display":true,"removed":false,"required":false,"displayName":"num_investors","defaultMatch":false,"canBeUsedToMatch":true},{"id":"lead_investors","type":"string","display":true,"removed":false,"required":false,"displayName":"lead_investors","defaultMatch":false,"canBeUsedToMatch":true},{"id":"founders","type":"string","display":true,"removed":false,"required":false,"displayName":"founders","defaultMatch":false,"canBeUsedToMatch":true},{"id":"products_and_services","type":"string","display":true,"removed":false,"required":false,"displayName":"products_and_services","defaultMatch":false,"canBeUsedToMatch":true},{"id":"crunchbase_link","type":"string","display":true,"removed":false,"required":false,"displayName":"crunchbase_link","defaultMatch":false,"canBeUsedToMatch":true},{"id":"text","type":"string","display":true,"removed":false,"required":false,"displayName":"text","defaultMatch":false,"canBeUsedToMatch":true},{"id":"companies","type":"string","display":true,"removed":false,"required":false,"displayName":"companies","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"autoMapInputData","matchingColumns":["name"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1719329910,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit#gid=1719329910","cachedResultName":"output"},"documentId":{"__rl":true,"mode":"list","value":"1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit?usp=drivesdk","cachedResultName":"LinkedIn Companies"}},"typeVersion":4.3,"alwaysOutputData":true},{"id":"9c41c4d8-0174-402f-92a2-1b1d7506a57c","name":"Read Company Names from Google Sheets table","type":"n8n-nodes-base.googleSheets","position":[-160,380],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit#gid=0","cachedResultName":"data"},"documentId":{"__rl":true,"mode":"list","value":"1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit?usp=drivesdk","cachedResultName":"LinkedIn Companies"}},"typeVersion":4.5},{"id":"e108cf5d-802c-485e-b382-b5ba5bafa4b5","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[280,180],"parameters":{"width":320,"height":180,"content":"## After Loop Completion \nAfter collecting all company URLs,\na single request body is prepared containing the list of companies.\nThis enables Bright Data to fetch and return dataset information for all companies in one batch request."},"typeVersion":1},{"id":"07296185-f16e-4101-a764-de9406f115bf","name":"Extract LinkedIn Url","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[940,640],"parameters":{"text":"={{ $json.result_body }}","messages":{"messageValues":[{"message":"=Extract official LinkedIn profile for company (not person){{ $('Loop Over Items').item.json['name'] }} from google results. Return a result property with unique parsed result in JSON."}]},"promptType":"define","hasOutputParser":true},"typeVersion":1.6},{"id":"d0778ce9-580a-4514-90f4-4cd8018db2fc","name":"Bright Data Web Request - Google Search for Company LinkedIn URL","type":"n8n-nodes-base.httpRequest","position":[500,640],"parameters":{"url":"https://api.brightdata.com/request","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"zone","value":"web_unlocker1"},{"name":"url","value":"={{ $json.google_search }}"},{"name":"format","value":"json"},{"name":"data_format","value":"markdown"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"af3f6120-115a-420d-a00f-9c52300e3e67","name":"Edit Company Search URL","type":"n8n-nodes-base.set","position":[280,640],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6b95685b-3286-4643-bfa1-6335d3f8cb39","name":"google_search","type":"string","value":"=https://www.google.com/search?q=site%3Alinkedin.com+{{ encodeURIComponent($json[\"name\"].trim()) }}"}]}},"typeVersion":3.4},{"id":"c1d2cb6a-1828-4c74-b710-50260f584eec","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1400,1000],"parameters":{"width":380,"height":240,"content":"## Why Add an Empty Result?\nIf a LinkedIn company profile is not found,\nan empty result is added to the final output for that company.\nThis ensures all companies from the original list are represented in the results,\neven if some were not found.\nYou can also implement custom logic here to handle “not found” cases differently -\nfor example, logging, sending notifications, or retrying the search."},"typeVersion":1},{"id":"f3249704-cfd8-4204-add2-a026d77e407e","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[400,820],"parameters":{"width":300,"height":280,"content":"## Replace YOUR_API_KEY\nReplace \"YOUR_API_KEY\" with your Bright Data web_unlocker API key in these nodes:\n**1.** Bright Data Web Request - Google Search for Company LinkedIn URL\n**2.** HTTP Request- Post API call to Bright Data\n**3.** Snapshot Progress\n**4.** HTTP Request - Getting data from Bright Data "},"typeVersion":1}],"connections":{"Merge":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[{"node":"Code - Prepare Request Body for Bright Data","type":"main","index":0}],[{"node":"Edit Company Search URL","type":"main","index":0}]]},"Add Empty result":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Add Unique Result":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Snapshot Progress":{"main":[[{"node":"Checking status of Snapshot - if data is ready or not","type":"main","index":0}]]},"Extract LinkedIn Url":{"main":[[{"node":"LinkedIn Profile is Found?","type":"main","index":0}]]},"Edit Company Search URL":{"main":[[{"node":"Bright Data Web Request - Google Search for Company LinkedIn URL","type":"main","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"Extract LinkedIn Url","type":"ai_languageModel","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Extract LinkedIn Url","type":"ai_outputParser","index":0}]]},"Extract Body from Response":{"main":[[{"node":"Extract LinkedIn Url","type":"main","index":0}]]},"LinkedIn Profile is Found?":{"main":[[{"node":"Add Unique Result","type":"main","index":0}],[{"node":"Add Empty result","type":"main","index":0}]]},"Wait - Polling Bright Data":{"main":[[{"node":"Snapshot Progress","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Read Company Names from Google Sheets table","type":"main","index":0}]]},"Code - Parse and Organize JSON Data":{"main":[[{"node":"Append Results to Google Sheets table","type":"main","index":0}]]},"HTTP Request- Post API call to Bright Data":{"main":[[{"node":"Wait - Polling Bright Data","type":"main","index":0}]]},"Code - Prepare Request Body for Bright Data":{"main":[[{"node":"HTTP Request- Post API call to Bright Data","type":"main","index":0}]]},"Read Company Names from Google Sheets table":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"HTTP Request - Getting data from Bright Data":{"main":[[{"node":"Code - Parse and Organize JSON Data","type":"main","index":0}]]},"Checking status of Snapshot - if data is ready or not":{"main":[[{"node":"Wait - Polling Bright Data","type":"main","index":0}],[{"node":"HTTP Request - Getting data from Bright Data","type":"main","index":0}]]},"Bright Data Web Request - Google Search for Company LinkedIn URL":{"main":[[{"node":"Extract Body from Response","type":"main","index":0}]]}}}


name: Extract Website URLs from Sitemap.XML for SEO Analysis
author_name: Le Thua Phu
author_username: lethuaphu
nodes_used: ["n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-05T03:47:49.851Z
updated_at: 2025-06-05T03:47:49.851Z
url: https://n8n.io/workflows/4671
scraped_at: 2025-07-06 21:16:30
description:
  Overview
  This n8n workflow automates the process of crawling a website's sitemap to extract URLs, which is particularly useful for SEO analysis, website auditing, or content monitoring. By leveraging n8n's nodes, the workflow fetches the sitemap from a specified URL, processes the XML data, and extracts individual URLs, which can then be converted into a downloadable file or integrated with tools like Google Sheets.

  How It Works
  The workflow operates in a sequential manner, utilizing a series of nodes to fetch, parse, and process sitemap data:
  Trigger: Initiates when the user clicks "Test workflow" (Manual Trigger node).
  Set URL: Defines the base domain (e.g., https://phu.io.vn/) for the sitemap (Set URL node).
  Crawl Sitemap: Fetches the main sitemap file (sitemap.xml) from the specified domain using an HTTP request (Crawl sitemap node).
  Parse XML: Converts the sitemap XML into a JSON format for easier processing (XML node).
  Split Sitemap: Extracts individual sitemap entries (e.g., &lt;sitemap&gt; tags) from the parsed data (Split Out node).
  Crawl Sub-Sitemap: Fetches each sub-sitemap URL listed in the main sitemap (Crawl sitemap 2 node).
  Parse Sub-Sitemap XML: Converts the sub-sitemap XML into JSON (XML 2 node).
  Split URLs: Extracts individual URLs (e.g., &lt;url&gt; tags) from the sub-sitemap (Split Out 2 node).
  Convert to File: Saves the extracted URLs into a file for download or further use (Convert to File node).

  This workflow supports both single sitemap files and sitemap indexes that reference multiple sub-sitemaps, ensuring comprehensive URL extraction.

  How to Use
  To implement this workflow in n8n, follow these steps:
  Set Up n8n: Ensure you have an active n8n instance (Cloud, npm, or self-hosted). Refer to the n8n documentation for setup instructions.
  Import Workflow: Copy the JSON from the provided Extract Website URLs from Sitemap.XML for SEO Analysis.json file and import it into your n8n instance via the workflow editor.
  Configure the Domain:
     In the Set URL node, update the Domain parameter with the target website's base URL (e.g., https://example.com/).
     Alternatively, in the Crawl sitemap node, directly paste the full sitemap URL if known (e.g., https://example.com/sitemap.xml).
  Test the Workflow:
     Click "Test workflow" to execute the Manual Trigger node.
     Verify that the workflow fetches the sitemap and processes the URLs correctly.
  Download or Integrate:
     The Convert to File node generates a file containing the extracted URLs.
     Optionally, replace this node with a Google Sheets node to append URLs to a spreadsheet. Refer to the Google Sheets node documentation for setup.
  Save and Activate: Save the workflow and activate it for production use if needed, using a trigger like a schedule or webhook (see Trigger Node).

  Requirements
  n8n Instance**: An active n8n instance (version 1.0 or later recommended) on n8n Cloud, npm, or self-hosted (Docker). See Choose your n8n for details.
  Technical Knowledge**: Basic understanding of n8n's editor UI and node configuration. Familiarity with XML sitemaps is helpful but not mandatory.
  Permissions**: For self-hosted setups, ensure the n8n process has network access to fetch the sitemap URL. For Docker deployments, verify permissions as outlined in the n8n v1.0 migration guide.
  Optional**: If integrating with Google Sheets, valid Google Sheets credentials are required (see Credentials).
  Timeout Configuration**: The HTTP Request nodes (Crawl sitemap and Crawl sitemap 2) have a 10-second timeout. Adjust the timeout parameter in the node settings if dealing with slow-responding servers.

  FAQ
  Q: What happens if the sitemap is large or contains many sub-sitemaps?  
  A: The workflow handles sitemap indexes by splitting and processing each sub-sitemap individually. For very large sitemaps, ensure your n8n instance has sufficient resources (memory and CPU) to avoid performance issues. See Scaling n8n for optimization tips.

  Q: Can I use this workflow with a specific sitemap URL instead of a domain?  
  A: Yes, in the Crawl sitemap node, replace the url parameter ({{ $json.Domain }}sitemap.xml) with the direct sitemap URL (e.g., https://example.com/sitemap.xml). Update the node’s notes for clarity.

  Q: Why am I getting a timeout error?  
  A: The HTTP Request nodes have a default timeout of 10 seconds. If the target server is slow, increase the timeout value in the options parameter of the Crawl sitemap or Crawl sitemap 2 nodes.

  Q: How can I save the URLs to Google Sheets instead of a file?  
  A: Replace the Convert to File node with a Google Sheets node. Configure it with your Google Sheets credentials and map the loc field from the Split Out 2 node to the desired spreadsheet column. Refer to the Google Sheets node documentation.

  Q: Is this workflow compatible with older n8n versions?  
  A: The workflow uses nodes compatible with n8n version 1.0 and later. For older versions, check for deprecated features (e.g., MySQL support) in the n8n v1.0 migration guide.

  Q: Can I automate this workflow to run periodically?  
  A: Yes, replace the Manual Trigger node with a Schedule Trigger node to run the workflow at set intervals. See Trigger Nodes for configuration details.

  For further assistance, consult the n8n Community Forum or submit an issue on the n8n GitHub repository.

  Need help customizing?
  Contact me for consulting and support or add me on Facebook or email.

workflow_json:
  {"id":"n2iZmshLmcXubEpo","meta":{"instanceId":"e704ee1a5300eff6019042bec66778b3a26c1aec8f3e21c554a16dd7216a94ee","templateCredsSetupCompleted":true},"name":"Extract Website URLs from Sitemap.XML for SEO Analysis","tags":[{"id":"MePRktFsL1ttwWdT","name":"website","createdAt":"2025-05-12T18:47:34.764Z","updatedAt":"2025-05-12T18:47:34.764Z"},{"id":"xutdortHHmV1yNZB","name":"SEO","createdAt":"2025-03-24T16:18:45.828Z","updatedAt":"2025-03-24T16:18:45.828Z"}],"nodes":[{"id":"6d91a84e-bf2b-4118-9e35-5baecda1b14b","name":"XML","type":"n8n-nodes-base.xml","position":[340,-40],"parameters":{"options":{}},"typeVersion":1},{"id":"65f12b51-d34c-4e87-b581-e29370eb0554","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-320,-40],"parameters":{},"typeVersion":1},{"id":"b82a0bce-0dd4-4a64-b60a-64ea4021bee5","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[560,-40],"parameters":{"options":{},"fieldToSplitOut":"sitemapindex.sitemap"},"typeVersion":1},{"id":"0e97abde-ba13-4889-979d-0f0e5b085dcb","name":"Set URL","type":"n8n-nodes-base.set","notes":"Set full URL - not domain","position":[-100,-40],"parameters":{"options":{},"assignments":{"assignments":[{"id":"fa078c97-4c7c-4c08-a011-5527661997c6","name":"Domain","type":"string","value":"https://phu.io.vn/"}]}},"notesInFlow":true,"typeVersion":3.4},{"id":"146a5e34-d64a-450b-8354-770c90547325","name":"Convert to File","type":"n8n-nodes-base.convertToFile","position":[1440,-40],"parameters":{"options":{},"binaryPropertyName":"={{ $json.loc }}"},"typeVersion":1.1},{"id":"0c1f8d18-ca4b-4996-9928-abbc6d45b227","name":"Crawl sitemap","type":"n8n-nodes-base.httpRequest","notes":"or past sitemap URL at here","position":[120,-40],"parameters":{"url":"={{ $json.Domain }}sitemap.xml","options":{"timeout":10000},"responseFormat":"string"},"notesInFlow":true,"typeVersion":1},{"id":"eaa43363-d059-4c66-8851-7e85d4fb5bd3","name":"Crawl sitemap 2","type":"n8n-nodes-base.httpRequest","position":[780,-40],"parameters":{"url":"={{ $json.loc }}","options":{"timeout":10000},"responseFormat":"string"},"typeVersion":1},{"id":"692efb13-a6ce-4667-842b-614cf9ee8315","name":"XML 2","type":"n8n-nodes-base.xml","position":[1000,-40],"parameters":{"options":{}},"typeVersion":1},{"id":"88a15568-352f-4997-ae2b-522a2713843d","name":"Split Out 2","type":"n8n-nodes-base.splitOut","position":[1220,-40],"parameters":{"options":{},"fieldToSplitOut":"urlset.url"},"typeVersion":1},{"id":"e0e0fb12-1dc5-4665-9530-6b53ed7dc593","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-160,-240],"parameters":{"width":440,"height":360,"content":"## Set website URL at node 1 (or paste sitemap URL at node 2)"},"typeVersion":1},{"id":"fc9d88ce-4ec0-4581-b1ff-7c007bdf5f0b","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1340,-200],"parameters":{"color":4,"width":300,"height":320,"content":"## Download file at here\n(or replace this node = Gooogle sheet node)\n"},"typeVersion":1},{"id":"39f13360-e94d-4b33-b258-5e8837daab4f","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-980,-460],"parameters":{"color":6,"width":600,"height":940,"content":"# FAQ\n## Q: What happens if the sitemap is large or contains many sub-sitemaps?\n\nA: The workflow handles sitemap indexes by splitting and processing each sub-sitemap individually. For very large sitemaps, ensure your n8n instance has sufficient resources (memory and CPU) to avoid performance issues. See Scaling n8n for optimization tips.\n\n## Q: Can I use this workflow with a specific sitemap URL instead of a domain?\n\nA: Yes, in the Crawl sitemap node, replace the url parameter ({{ $json.Domain }}sitemap.xml) with the direct sitemap URL (e.g., https://example.com/sitemap.xml). Update the node’s notes for clarity.\n\n## Q: Why am I getting a timeout error?\n\nA: The HTTP Request nodes have a default timeout of 10 seconds. If the target server is slow, increase the timeout value in the options parameter of the Crawl sitemap or Crawl sitemap 2 nodes.\n\n## Q: How can I save the URLs to Google Sheets instead of a file?\n\nA: Replace the Convert to File node with a Google Sheets node. Configure it with your Google Sheets credentials and map the loc field from the Split Out 2 node to the desired spreadsheet column. Refer to the Google Sheets node documentation.\n\n## Q: Is this workflow compatible with older n8n versions?\n\nA: The workflow uses nodes compatible with n8n version 1.0 and later. For older versions, check for deprecated features (e.g., MySQL support) in the n8n v1.0 migration guide."},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"d2ef17d5-a482-4b0d-b48a-83d5bd146b9f","connections":{"XML":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"XML 2":{"main":[[{"node":"Split Out 2","type":"main","index":0}]]},"Set URL":{"main":[[{"node":"Crawl sitemap","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"Crawl sitemap 2","type":"main","index":0}]]},"Split Out 2":{"main":[[{"node":"Convert to File","type":"main","index":0}]]},"Crawl sitemap":{"main":[[{"node":"XML","type":"main","index":0}]]},"Convert to File":{"main":[[]]},"Crawl sitemap 2":{"main":[[{"node":"XML 2","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Set URL","type":"main","index":0}]]}}}


name: Voice Creation, TTS, Sound Effects, Voicechanger & more! 🎧 Elevenlabs MCP Server
author_name: David Ashby
author_username: cfomodz
nodes_used: []
categories: []
created_at: 2025-06-05T04:18:44.626Z
updated_at: 2025-06-05T04:18:44.626Z
url: https://n8n.io/workflows/4672
scraped_at: 2025-07-06 21:16:30
description:
  This workflow provides a complete set of tools for interacting with the ElevenLabs voice API, enabling AI-powered text-to-speech, voice management, and audio processing capabilities.

  Features 🚀

  Text-to-Speech Operations
  Convert text to speech with customizable voice settings
  Generate speech with timestamps for precise audio control
  Stream text-to-speech in real-time
  Stream text-to-speech with timestamps for live applications

  Voice Management 🗣️
  List all available voices
  Get detailed information about specific voices
  Delete custom voices
  Edit voice properties (name and description)
  Find similar voices based on voice ID

  Audio Processing 🎧
  Create transcripts from audio
  Apply voice changing effects
  Generate sound effects
  Isolate audio components
  Design and preview new voices
  Save voice previews as new voices

  Requirements ⚙️
  An ElevenLabs API key
  n8n instance with HTTP Request Tool node
  MCP Server Trigger node for AI integration

  Setup 🔧
  Import the workflow into your n8n instance
  Configure your ElevenLabs API key in the workflow settings
  The workflow uses AI expressions for voice IDs with a fallback value of Z9hrfEHGU3dykHntWvIY

  Usage 📝
  All nodes are connected to the MCP Server Trigger for AI-powered interactions

  Example Use Cases 💡
  Generate natural-sounding speech from text
  Create and manage custom voices
  Process and transform audio files
  Build voice-based applications
  Integrate ElevenLabs capabilities into existing workflows

  Technical Details 🔍
  All endpoints use proper error handling
  Voice ID parameters use AI expressions with fallback values
  Nodes are organized in logical groups for better workflow management
  Includes comprehensive parameter validation
  Supports streaming and real-time processing

  Support 🤝
  For issues or questions, please refer to:
  ElevenLabs API Documentation
  n8n Documentation
  n8n Community 

workflow_json:
  {"meta":{"instanceId":"cd59eaaeb7b34d06e24511380db94cdb7fbce6037cc4de22e539c5158ab9cdfc"},"nodes":[{"id":"text-to-speech","name":"Text to Speech","type":"n8n-nodes-base.httpRequestTool","position":[920,-20],"parameters":{},"typeVersion":4.2},{"id":"text-to-speech-with-timestamps","name":"Text to Speech with Timestamps","type":"n8n-nodes-base.httpRequestTool","position":[980,140],"parameters":{},"typeVersion":4.2},{"id":"stream-text-to-speech","name":"Stream Text to Speech","type":"n8n-nodes-base.httpRequestTool","position":[1020,360],"parameters":{},"typeVersion":4.2},{"id":"stream-text-to-speech-with-timestamps","name":"Stream Text to Speech with Timestamps","type":"n8n-nodes-base.httpRequestTool","position":[820,340],"parameters":{},"typeVersion":4.2},{"id":"create-transcript","name":"Create Transcript","type":"n8n-nodes-base.httpRequestTool","position":[540,-20],"parameters":{},"typeVersion":4.2},{"id":"voice-changer","name":"Voice Changer","type":"n8n-nodes-base.httpRequestTool","position":[1200,120],"parameters":{},"typeVersion":4.2},{"id":"create-sound-effect","name":"Create Sound Effect","type":"n8n-nodes-base.httpRequestTool","position":[520,140],"parameters":{},"typeVersion":4.2},{"id":"audio-isolation","name":"Audio Isolation","type":"n8n-nodes-base.httpRequestTool","position":[1360,200],"parameters":{},"typeVersion":4.2},{"id":"voice-design","name":"Voice Design","type":"n8n-nodes-base.httpRequestTool","position":[120,-220],"parameters":{},"typeVersion":4.2},{"id":"save-voice-preview","name":"Save Voice Preview","type":"n8n-nodes-base.httpRequestTool","position":[300,-220],"parameters":{},"typeVersion":4.2},{"id":"list-voices","name":"List Voices","type":"n8n-nodes-base.httpRequestTool","position":[1280,-260],"parameters":{},"typeVersion":4.2},{"id":"get-voice","name":"Get Voice","type":"n8n-nodes-base.httpRequestTool","position":[1440,-260],"parameters":{},"typeVersion":4.2},{"id":"delete-voice","name":"Delete Voice","type":"n8n-nodes-base.httpRequestTool","position":[300,-40],"parameters":{},"typeVersion":4.2},{"id":"edit-voice","name":"Edit Voice","type":"n8n-nodes-base.httpRequestTool","position":[120,-40],"parameters":{},"typeVersion":4.2},{"id":"list-similar-voices","name":"List Similar Voices","type":"n8n-nodes-base.httpRequestTool","position":[1380,-120],"parameters":{},"typeVersion":4.2},{"id":"da2c02c3-6417-46fe-a17c-ab1a6b378d1f","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[820,-80],"parameters":{"content":""},"typeVersion":1},{"id":"7bd1688c-8046-4102-8be4-047543384489","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[800,320],"parameters":{"content":""},"typeVersion":1},{"id":"9092d868-6fa5-454b-bfd2-04f97753004c","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1120,80],"parameters":{"content":""},"typeVersion":1},{"id":"2fd902e5-f3d0-401d-ae47-ff1abce964c6","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[60,-280],"parameters":{"content":""},"typeVersion":1},{"id":"898601d4-e685-4d7f-9b6c-2e56fd0a8e8c","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[440,-60],"parameters":{"content":""},"typeVersion":1},{"id":"f9909e0c-07aa-4877-b98b-90724a124d49","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1220,-340],"parameters":{"content":""},"typeVersion":1},{"id":"d6813f92-5722-4d97-bb9e-0c573ba32202","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[920,140],"parameters":{"content":""},"typeVersion":1},{"id":"mcp-trigger","name":"Elevenlabs API MCP Server","type":"@n8n/n8n-nodes-langchain.mcpTrigger","position":[752,-240],"webhookId":"1ee78466-25ce-4645-ad7b-0de19ddbbb99","parameters":{},"typeVersion":1},{"id":"f34f0616-7234-49ff-a23e-8980610d7bc3","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[540,-400],"parameters":{"content":""},"typeVersion":1}],"connections":{"Get Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Edit Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"List Voices":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Delete Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Voice Design":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Voice Changer":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Text to Speech":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Audio Isolation":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Create Transcript":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Save Voice Preview":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Create Sound Effect":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"List Similar Voices":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Stream Text to Speech":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Elevenlabs API MCP Server":{"ai_tool":[[]]},"Text to Speech with Timestamps":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Stream Text to Speech with Timestamps":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]}}}


name: Generate AI-Powered LinkedIn Posts with Ollama, Image Creation, and Gmail Delivery
author_name: Aashit Sharma
author_username: aashitsharma
categories: []
created_at: 2025-06-05T05:05:57.769Z
updated_at: 2025-06-05T05:05:57.769Z
url: https://n8n.io/workflows/4674
scraped_at: 2025-07-06 21:16:30
description:
  This automation flow is designed to generate professional, research-backed LinkedIn posts based on a user-submitted topic and audience, enhance it with a visually aligned image prompt, and then automatically send the post and image via Gmail and/or publish it to LinkedIn.
  ⚙️ How It Works (Step-by-Step):
  📝 Form Submission (Input Trigger)

      A user fills out a form with:

          Email

          Topic of the Post

          Target Audience

      This form submission acts as the entry point of the workflow (Form Trigger node).

  🤖 LinkedIn Post Generation Agent

      An AI agent is triggered that:

          Uses Tavily API to fetch real-time web search content related to the topic.

          Processes the topic and audience data using an Ollama Chat Model.

          Generates a well-structured LinkedIn post that includes:

              Hook

              Educational insight

              Professional tone

              Source citations

              Hashtags and call to action

  🎨 Image Prompt Agent

      The generated post is passed to a second agent that:

          Extracts the core message.

          Converts it into a graphic prompt using a different Ollama LLM.

          The prompt is written to be used by an image-generation model like DALL·E or Gemma/GPT-based image tools.

  🖼️ Image Generation

      The image prompt is passed to a local image generation endpoint (localhost:8098) or OpenAI (api.openai.com) to generate a visual asset.

      The base64 image is converted into a file.

  📩 Email Dispatch

      The post text and the generated image are then sent to the user’s email address via the Gmail node.

      The email includes:

          The full LinkedIn post

          The auto-generated image as an attachment

  🔗 LinkedIn Publishing (Optional)

      If OAuth is enabled, the post can also be published directly to LinkedIn using the LinkedIn node.

  🛠️ Tools Used:

      n8n: Orchestration platform

      OpenRouter & Ollama: Local/hosted LLMs for post and prompt generation

      Tavily API: Real-time web search

      OpenAI or Local Endpoint: Image generation from text

      SMTP (Gmail): For sending emails

      LinkedIn API: For automated posting

  📦 Key Features:

      End-to-end automation from form to email/post

      Uses real-time research for accuracy

      Creative visual generation with professional branding intent

      Works locally or with cloud APIs

      Modular: Can switch tools or endpoints (OpenAI ↔ Localhost, Ollama ↔ OpenRouter)

  🚀 Ideal Use Cases:

      Marketing teams needing fast content turnaround

      Personal branding assistants

      Founders, freelancers, and executives sharing thought leadership

      University or organization-wide communication systems

nodes_used:
  ["n8n-nodes-base.emailSend","n8n-nodes-base.httpRequest","n8n-nodes-base.linkedIn","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOllama","@n8n/n8n-nodes-langchain.toolHttpRequest"]

workflow_json:
  {"id":"Bh88SWMuqHN92zEA","meta":{"instanceId":"473ff4054f1a6c3ed6f17a2b4a2e55676fe5b921cceb87b2256e6c416c158559","templateCredsSetupCompleted":true},"name":"Auto-post generation","tags":[],"nodes":[{"id":"590b9032-e9bf-431f-b506-9f3d01d2da00","name":"LinkedIn Post Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[1300,-140],"parameters":{},"typeVersion":1.9},{"id":"496f60a7-4d0b-43e9-a7f6-e535c4dd7ff6","name":"Image Prompt Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[1740,-140],"parameters":{},"typeVersion":1.9},{"id":"80f421bf-bb49-413b-820b-cbadbe62f6d9","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[1020,-140],"webhookId":"359fa996-5531-40ae-be37-4a6e136952e2","parameters":{},"typeVersion":2.2},{"id":"ee27bf52-811a-46ee-9eb2-7c2d350b57d7","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1240,-240],"parameters":{"content":""},"typeVersion":1},{"id":"d79ef703-2aee-4273-a7e6-63aaa83a0888","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2100,-240],"parameters":{"content":""},"typeVersion":1},{"id":"7045e571-590a-4a1e-b37a-49e258e4b319","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2580,-240],"parameters":{"content":""},"typeVersion":1},{"id":"6b10e9be-9bba-4869-b0c6-27177bb12a78","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1640,-240],"parameters":{"content":""},"typeVersion":1},{"id":"52869b63-cba1-49e1-a2d9-b80c4d2d7609","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[940,-240],"parameters":{"content":""},"typeVersion":1},{"id":"6f2305a9-9644-45e6-b49c-81d2a9d10acf","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1240,40],"parameters":{"content":""},"typeVersion":1},{"id":"5fa51108-32bb-45bf-9780-d628443190e1","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[200,-240],"parameters":{"content":""},"typeVersion":1},{"id":"22f7dbdd-cebb-404e-b8ad-93a5026d17c6","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[1040,500],"parameters":{},"typeVersion":1},{"id":"f39bf200-9bf0-44f6-b4a1-e1b17411ba52","name":"Convert to File","type":"n8n-nodes-base.convertToFile","position":[1480,500],"parameters":{},"typeVersion":1.1},{"id":"f918e7c3-9132-4fb2-98c5-e3207e150bda","name":"Generate Image1","type":"n8n-nodes-base.httpRequest","position":[1260,500],"parameters":{},"typeVersion":4.2},{"id":"b58177e4-0e2d-41eb-a84e-8ae50f43bfd4","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[940,360],"parameters":{"content":""},"typeVersion":1},{"id":"42e54350-0f18-4ea9-a97c-f6250392c8e4","name":"Tavily","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[1460,140],"parameters":{},"typeVersion":1.1},{"id":"413ee3a8-2592-4170-805c-78ea9bcf8d20","name":"Ollama Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[1300,140],"parameters":{},"typeVersion":1},{"id":"05fa8332-48ca-412d-aac5-cf4b1be56ee3","name":"Ollama Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[1780,160],"parameters":{},"typeVersion":1},{"id":"ae39b076-3801-436a-ba34-5b0bc209165e","name":"Generate Image2","type":"n8n-nodes-base.httpRequest","position":[2180,-160],"parameters":{},"typeVersion":4.2},{"id":"e4e1ba34-5678-4098-b168-c2fd6949364d","name":"Download Image","type":"n8n-nodes-base.httpRequest","position":[2380,-160],"parameters":{},"typeVersion":4},{"id":"2078044a-3a4a-42c1-9d68-12c040a72837","name":"Send Email","type":"n8n-nodes-base.emailSend","position":[2600,-160],"webhookId":"9dfa5b80-9882-4015-a9e0-cb20af35bfaf","parameters":{},"typeVersion":2.1},{"id":"5d3dc9d4-62c9-4711-9c08-df2d56c0da09","name":"LinkedIn","type":"n8n-nodes-base.linkedIn","position":[2820,-160],"parameters":{},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"d6945ea0-837b-40c7-b31c-af44685d4a8c","connections":{"Tavily":{"ai_tool":[[{"node":"LinkedIn Post Agent","type":"ai_tool","index":0}]]},"Send Email":{"main":[[{"node":"LinkedIn","type":"main","index":0}]]},"Download Image":{"main":[[{"node":"Send Email","type":"main","index":0}]]},"Generate Image1":{"main":[[{"node":"Convert to File","type":"main","index":0}]]},"Generate Image2":{"main":[[{"node":"Download Image","type":"main","index":0}]]},"Ollama Chat Model":{"ai_languageModel":[[{"node":"LinkedIn Post Agent","type":"ai_languageModel","index":0}]]},"Image Prompt Agent":{"main":[[{"node":"Generate Image2","type":"main","index":0}]]},"Ollama Chat Model1":{"ai_languageModel":[[{"node":"Image Prompt Agent","type":"ai_languageModel","index":0}]]},"On form submission":{"main":[[{"node":"LinkedIn Post Agent","type":"main","index":0}]]},"LinkedIn Post Agent":{"main":[[{"node":"Image Prompt Agent","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Generate Image1","type":"main","index":0}]]}}}


name: Intelligent AI Digest for Security, Privacy, and Compliance Feeds
author_name: Niranjan G
author_username: niranjan
categories: []
created_at: 2025-06-05T06:11:40.248Z
updated_at: 2025-06-05T06:11:40.248Z
url: https://n8n.io/workflows/4678
scraped_at: 2025-07-06 21:16:30
description:
  How it works
  This workflow acts like your own personal AI assistant, automatically fetching and summarizing the most relevant Security, Privacy, and Compliance news from curated RSS feeds. It processes only the latest articles (past 24 hours), organizes them by category, summarizes key insights using AI, and delivers a clean HTML digest straight to your inbox—saving you time every day.

  Key Highlights

  Handles three independent tracks: Security, Privacy, and Compliance
  Processes content from customizable RSS sources (add/remove easily)
  Filters fresh articles, removes duplicates, and sorts by recency
  Uses AI to summarize and format insights in a digestible format
  Sends polished HTML digests via Gmail—one per category
  Fully modular and extensible—adapt it to your needs

  Personalization
  You can easily tailor the workflow:

  🎯 Customize feeds: Add or remove sources in the following Code nodes:
  Fetch Security RSS, Fetch Privacy Feeds, and Fetch Compliance Feeds

  🔧 Modify logic: Adjust filters, sorting, formatting, or even AI prompts as needed

  🧠 Bring your own LLM: Works with Gemini, but easily swappable for other LLM APIs

  Setup Instructions

  Requires Gmail and LLM (e.g., Gemini) credentials
  Prebuilt with placeholders for RSS feeds and email output
  Designed to be readable, maintainable, and fully adaptable

nodes_used:
  ["n8n-nodes-base.gmail","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatGoogleGemini"]

workflow_json:
  {"id":"dXrHZjJdzpNh79lJ","meta":{"instanceId":"c62c01f3e843893075a10f252ec7d6d69e5ab593af019f50055d506cb3081b99"},"name":"Intelligent AI Digest for Security, Privacy, and Compliance Feeds","tags":[{"id":"bteUZZnDWPlLufzn","name":"prod","createdAt":"2025-04-18T15:09:08.645Z","updatedAt":"2025-04-18T15:09:08.645Z"},{"id":"MbPHhZHgb39Syuoa","name":"security","createdAt":"2025-04-20T05:18:20.689Z","updatedAt":"2025-04-20T05:18:20.689Z"},{"id":"TzfZgDmxmc5R1gyA","name":"ai","createdAt":"2025-04-27T14:57:46.973Z","updatedAt":"2025-04-27T14:57:46.973Z"}],"nodes":[{"id":"828bdcf3-09a4-4235-8dbb-2153f0928037","name":"AI Agent - Privacy Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-740,4180],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### 🔏 Prompt 2: Privacy Intelligence Digest Generator\n\nYou are a senior privacy intelligence analyst with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\nIf a category heading has no articles, it should not be included in the output.\n\n#### **Tasks:**\n\n1. Parse the HTML and extract articles.\n2. Remove duplicates.\n3. Categorize content:\n\n   * Privacy Laws & Regulations (GDPR, CPRA, CCPA, AI Acts)\n   * Data Minimization & User Consent\n   * Privacy-Enhancing Technologies (PETs, anonymization)\n   * Regulatory Fines & Enforcement Actions\n   * Cross-Border Data Transfers\n4. Summarize each article in under 2 lines.\n5. Dynamically identify and list critical privacy alerts. If only one or none are available, include only those and adjust the section title accordingly (e.g., 'Critical Privacy Alert').\n6. Format each as:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output HTML structure with headers for top 5 and each category.\n8. Add:\n\n   ```html\n   <p><em>This privacy update was compiled on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Privacy Insights Digest - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Privacy Alerts</h2>…<p><em>This privacy update was compiled on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"7be7a9fe-e8f5-4a56-a77d-7ca098d52479","name":"AI Agent - Security Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-720,3520],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### 🔐 Prompt 1: Security Intelligence Digest Generator\n\nYou are a senior cybersecurity intelligence analyst with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\n#### **Inputs:**\n\n* Raw newsletter subject: `{{ $json.subject }}`\n* Raw newsletter HTML body: `{{ $json.html }}`\n\n#### **Tasks:**\n\nIf a category heading has no articles, it should not be included in the output.\n\n1. Parse the provided HTML.\n2. Remove duplicate articles based on title, summary, or URL.\n3. Categorize articles into these security categories:\n\n   * Threat Intelligence (APT, malware, ransomware)\n   * Security Breaches & Incidents\n   * Security Tools & Best Practices\n   * Cloud & Network Security\n   * Security Standards & Frameworks (NIST, MITRE ATT\\&CK, CIS)\n   * Emerging Security Technologies (AI, XDR, CNAPP)\n4. Summarize each article in 1–2 lines.\n5. Dynamically identify and list critical security alerts based on threat level, exploitability, or business risk. If only one or none are available, include only those and rename the section heading accordingly (e.g., 'Critical Security Alert').\n6. Format each article:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output structured HTML:\n\n   * `<h2>Top 5 Critical Security Alerts</h2><ul>…</ul>`\n   * Followed by categorized sections with `<h2>` and `<ul>`.\n8. Add a footer:\n\n   ```html\n   <p><em>This security summary was auto-generated on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Security Threat Summary - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Security Alerts</h2>…<p><em>This security summary was auto-generated on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"bb59ecfa-b197-47c4-a32e-0834c187100e","name":"AI Agent - Compliance Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-740,4840],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### ✅ Prompt 3: Compliance Intelligence Digest Generator\n\nYou are a senior compliance and risk intelligence professional with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\n#### **Inputs:**\n\n* Raw newsletter subject: `{{ $json.subject }}`\n* Raw newsletter HTML body: `{{ $json.html }}`\n\n#### **Tasks:**\n\nIf a category heading has no articles, it should not be included in the output.\n\n1. Parse the HTML and extract article data.\n2. De-duplicate articles.\n3. Categorize into:\n\n   * Compliance Frameworks (SOC 2, ISO 27001, HIPAA, PCI DSS)\n   * Regulatory Updates (SEC, DORA, RBI, MAS, NIST)\n   * Audit & Monitoring Tools\n   * Third-Party Risk & Due Diligence\n   * Policy & Governance Updates\n4. Summarize each item concisely.\n5. Dynamically identify and list critical compliance alerts. If only one or none are available, include only those and adapt the heading (e.g., 'Critical Compliance Alert').\n6. Format each:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output HTML with top 5 and categorized sections.\n8. Footer:\n\n   ```html\n   <p><em>This compliance summary was generated on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Compliance Roundup - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Compliance Alerts</h2>…<p><em>This compliance summary was generated on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"328bb06a-edfd-4a14-9011-68cdd00bcd8e","name":"Trigger Daily Digest","type":"n8n-nodes-base.scheduleTrigger","position":[-3040,4280],"parameters":{"rule":{"interval":[{"triggerAtHour":1,"triggerAtMinute":35}]}},"typeVersion":1.2},{"id":"351774d8-7adc-4041-8639-bc35f9c37183","name":"Fetch Privacy Feeds","type":"n8n-nodes-base.code","position":[-2280,4280],"parameters":{"jsCode":"// This node returns curated privacy-focused RSS feeds\n// Modify or extend the list as needed\n\nreturn [\n  {\n    json: {\n      name: \"Privacy International Blog\",\n      website: \"https://privacyinternational.org\",\n      rss_url: \"https://privacyinternational.org/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Data Protection Report (Norton Rose Fulbright)\",\n      website: \"https://www.dataprotectionreport.com\",\n      rss_url: \"https://www.dataprotectionreport.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Inside Privacy (Covington & Burling)\",\n      website: \"https://www.insideprivacy.com\",\n      rss_url: \"https://www.insideprivacy.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"PogoWasRight\",\n      website: \"https://pogowasright.org\",\n      rss_url: \"https://pogowasright.org/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Sidley Data Matters (Privacy Blog)\",\n      website: \"https://datamatters.sidley.com\",\n      rss_url: \"https://datamatters.sidley.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"d0a93584-a1bc-4da8-9aaf-129adf7e4cae","name":"Fetch Compliance Feeds","type":"n8n-nodes-base.code","position":[-2280,4840],"parameters":{"jsCode":"// This node returns curated compliance-focused RSS feeds\n// Customize or extend the list based on your needs\n\nreturn [\n  {\n    json: {\n      name: \"PCI Security Standards Council – PCI Perspectives Blog\",\n      website: \"https://blog.pcisecuritystandards.org\",\n      rss_url: \"https://blog.pcisecuritystandards.org/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"NIST Cybersecurity Insights Blog\",\n      website: \"https://www.nist.gov/blogs/cybersecurity-insights\",\n      rss_url: \"https://www.nist.gov/blogs/cybersecurity-insights/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Cloud Security Alliance Blog\",\n      website: \"https://cloudsecurityalliance.org/blog\",\n      rss_url: \"https://cloudsecurityalliance.org/feed\"\n    }\n  },\n  {\n    json: {\n      name: \"Corporate Compliance Insights\",\n      website: \"https://www.corporatecomplianceinsights.com\",\n      rss_url: \"http://feeds.feedburner.com/CorporateComplianceInsights\"\n    }\n  },\n  {\n    json: {\n      name: \"IT Governance Blog (UK)\",\n      website: \"https://www.itgovernance.co.uk/blog\",\n      rss_url: \"https://www.itgovernance.co.uk/blog/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Global Compliance News (Baker McKenzie)\",\n      website: \"https://globalcompliancenews.com\",\n      rss_url: \"https://globalcompliancenews.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"e4fa0e00-d10b-4c86-bad3-6c0d1d59750a","name":"Normalize Article Security Metadata","type":"n8n-nodes-base.set","position":[-1600,3620],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"c1f6e2ac-4bf9-4fc4-85fd-c8c7649cdc9c","name":"Normalize Article Privacy Metadata","type":"n8n-nodes-base.set","position":[-1620,4280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"ae374184-806b-4022-80b5-94bdef48133e","name":"Normalize Article Compliance Metadata","type":"n8n-nodes-base.set","position":[-1620,4840],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"e71e3c7e-a58a-49bb-9c13-827f46e4df7e","name":"Filter Recent Security Articles (24h)","type":"n8n-nodes-base.filter","position":[-1380,3620],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"cb34ed8e-5b67-4cfd-8731-482b22874780","name":"Filter Recent Privacy Articles (24h)","type":"n8n-nodes-base.filter","position":[-1400,4280],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"07c94d37-ad0a-4f89-961c-abf1d6eeeeef","name":"Filter Recent Compliance Articles (24h)","type":"n8n-nodes-base.filter","position":[-1400,4840],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"9cb809e9-4d49-452e-823e-3f54adca0529","name":"Format Security Articles into HTML","type":"n8n-nodes-base.code","position":[-940,3620],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"14fd5f01-075f-4648-a1ab-f0a87d2b676a","name":"Format Privacy Articles into HTML","type":"n8n-nodes-base.code","position":[-960,4280],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"6eddd44f-8038-40fd-b0db-2a8d9c35000a","name":"Format Compliance Articles into HTML","type":"n8n-nodes-base.code","position":[-960,4840],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"1e261592-348a-42af-b4ba-1b2be82b0143","name":"LLM - Gemini Security Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-640,3740],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"c4cc7264-43af-4a26-89e2-5888817b1602","name":"LLM - Gemini Privacy Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-660,4400],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"dc4e461c-dbb8-46a1-b128-6c28584c12d4","name":"LLM - Gemini Compliance Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-640,5060],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"a1e4eaac-aaea-4859-bd29-375a6b50aaa1","name":"Privacy Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-360,4280],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in your full styled template, without external blog link\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"7a864b0c-08f5-4e97-8430-1879f8e0e3d0","name":"Security Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-340,3620],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in styled email template (without blog link)\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"deaaeb3a-5a14-4b2a-baf8-4443e7ed9740","name":"Compliance Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-360,4840],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in styled template, no blog reference\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"fa9ac785-bc9d-43ba-8ca3-36abba10d506","name":"Security Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-120,3620],"webhookId":"2ffca73d-6ca2-4c61-88ec-3542600d2788","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"59c16785-571c-4403-85cf-7f7bfc14a630","name":"Privacy Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-140,4280],"webhookId":"0e8133d5-e700-4bb9-8ef0-6c86f7ed4a59","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"7526ae74-1bae-4eca-9c87-51c274565a8a","name":"Compliance Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-140,4840],"webhookId":"5d5a1988-01cd-4e67-9c02-9090aa851669","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"6fa939b5-12ac-47a0-ac7f-ca9957367ce2","name":"Sort - Security Articles by Date","type":"n8n-nodes-base.sort","position":[-1160,3620],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"7aa3a27b-72d7-4a03-83c8-361a6fbc555d","name":"Sort - Privacy Articles by Date","type":"n8n-nodes-base.sort","position":[-1180,4280],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"fba86936-5208-4232-bda9-714886807b9c","name":"Sort - Compliance Articles by Date","type":"n8n-nodes-base.sort","position":[-1180,4840],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"8d90a0ed-b9e1-440e-963a-e4c9f5285b32","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2460,3380],"parameters":{"width":2600,"height":580,"content":"## 📬 Daily Security Newsletter"},"typeVersion":1},{"id":"946997e7-58bc-4ca0-89aa-32e39f327808","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-2460,4020],"parameters":{"color":4,"width":2600,"height":580,"content":"## 📬 Daily Privacy Newsletter"},"typeVersion":1},{"id":"61aca795-5b6a-4301-9cea-946e0358b8c5","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-2460,4660],"parameters":{"color":6,"width":2600,"height":580,"content":"## 📬 Daily Compliance Newsletter"},"typeVersion":1},{"id":"ca6c3e50-8ea8-436c-ab77-94501667a431","name":"Split Out Security RSS","type":"n8n-nodes-base.splitOut","position":[-2040,3620],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"5784491f-071c-4159-af29-6e21305f5e78","name":"Split Out Compliance RSS","type":"n8n-nodes-base.splitOut","position":[-2060,4840],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"edbd5da4-f18c-4d08-8023-df4ef7ec11fa","name":"Security RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1820,3620],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"76d973a7-832e-4049-80ea-c0d28b72b345","name":"Privacy RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1840,4280],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"5503fe77-8ae3-4d41-97d3-6520cb60067e","name":"Compliance RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1840,4840],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"c2538e17-1584-45a5-8a6e-1b220ed512a5","name":"Split Out Privacy RSS","type":"n8n-nodes-base.splitOut","position":[-2060,4280],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"d1ae80d8-8094-4f84-aa9e-d4533a99a70d","name":"Fetch Security RSS","type":"n8n-nodes-base.code","position":[-2260,3620],"parameters":{"jsCode":"// This node returns curated cybersecurity RSS feeds\n// You can add, remove, or modify feeds as needed\n\nreturn [\n  {\n    json: {\n      name: \"Krebs on Security\",\n      website: \"https://krebsonsecurity.com\",\n      rss_url: \"https://krebsonsecurity.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"The Hacker News\",\n      website: \"https://thehackernews.com\",\n      rss_url: \"https://feeds.feedburner.com/TheHackersNews\"\n    }\n  },\n  {\n    json: {\n      name: \"Dark Reading\",\n      website: \"https://www.darkreading.com\",\n      rss_url: \"https://www.darkreading.com/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"SANS Internet Storm Center\",\n      website: \"https://isc.sans.edu\",\n      rss_url: \"https://isc.sans.edu/rssfeed_full.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Cisco Talos Intelligence Blog\",\n      website: \"https://blog.talosintelligence.com\",\n      rss_url: \"https://blog.talosintelligence.com/rss/\"\n    }\n  },\n  {\n    json: {\n      name: \"WeLiveSecurity (ESET)\",\n      website: \"https://www.welivesecurity.com\",\n      rss_url: \"https://feeds.feedburner.com/eset/blog\"\n    }\n  },\n  {\n    json: {\n      name: \"Graham Cluley Security Blog\",\n      website: \"https://grahamcluley.com\",\n      rss_url: \"https://grahamcluley.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"fbec32fd-2ca9-4f1f-84f9-e581bc6a37e5","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-120,3480],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"4479495e-3e87-4a75-9fcc-36b230895854","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-140,4160],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"18971219-b68d-4423-adbc-2f25174ae8a9","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-140,4720],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"349ec0eb-9b5f-4bea-9b83-35d6cb63c1fa","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-2320,3520],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1},{"id":"4f3b0da6-4db7-41e9-aa0a-9bd084fce819","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-2340,4180],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1},{"id":"9c48eaa6-c602-44a3-871c-33ffd9dfa476","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-2340,4740],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"0dc52173-7378-4951-8ebc-e44443c39540","connections":{"Privacy RSS Read":{"main":[[{"node":"Normalize Article Privacy Metadata","type":"main","index":0}]]},"Security RSS Read":{"main":[[{"node":"Normalize Article Security Metadata","type":"main","index":0}]]},"Fetch Security RSS":{"main":[[{"node":"Split Out Security RSS","type":"main","index":0}]]},"Compliance RSS Read":{"main":[[{"node":"Normalize Article Compliance Metadata","type":"main","index":0}]]},"Fetch Privacy Feeds":{"main":[[{"node":"Split Out Privacy RSS","type":"main","index":0}]]},"Trigger Daily Digest":{"main":[[{"node":"Fetch Security RSS","type":"main","index":0},{"node":"Fetch Compliance Feeds","type":"main","index":0},{"node":"Fetch Privacy Feeds","type":"main","index":0}]]},"Split Out Privacy RSS":{"main":[[{"node":"Privacy RSS Read","type":"main","index":0}]]},"Fetch Compliance Feeds":{"main":[[{"node":"Split Out Compliance RSS","type":"main","index":0}]]},"Split Out Security RSS":{"main":[[{"node":"Security RSS Read","type":"main","index":0}]]},"Split Out Compliance RSS":{"main":[[{"node":"Compliance RSS Read","type":"main","index":0}]]},"AI Agent - Privacy Intelligence":{"main":[[{"node":"Privacy Build Final Newsletter HTML","type":"main","index":0}]]},"LLM - Gemini Privacy Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Privacy Intelligence","type":"ai_languageModel","index":0}]]},"Sort - Privacy Articles by Date":{"main":[[{"node":"Format Privacy Articles into HTML","type":"main","index":0}]]},"AI Agent - Security Intelligence":{"main":[[{"node":"Security Build Final Newsletter HTML","type":"main","index":0}]]},"LLM - Gemini Security Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Security Intelligence","type":"ai_languageModel","index":0}]]},"Sort - Security Articles by Date":{"main":[[{"node":"Format Security Articles into HTML","type":"main","index":0}]]},"Format Privacy Articles into HTML":{"main":[[{"node":"AI Agent - Privacy Intelligence","type":"main","index":0}]]},"AI Agent - Compliance Intelligence":{"main":[[{"node":"Compliance Build Final Newsletter HTML","type":"main","index":0}]]},"Format Security Articles into HTML":{"main":[[{"node":"AI Agent - Security Intelligence","type":"main","index":0}]]},"LLM - Gemini Compliance Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Compliance Intelligence","type":"ai_languageModel","index":0}]]},"Normalize Article Privacy Metadata":{"main":[[{"node":"Filter Recent Privacy Articles (24h)","type":"main","index":0}]]},"Sort - Compliance Articles by Date":{"main":[[{"node":"Format Compliance Articles into HTML","type":"main","index":0}]]},"Normalize Article Security Metadata":{"main":[[{"node":"Filter Recent Security Articles (24h)","type":"main","index":0}]]},"Privacy Build Final Newsletter HTML":{"main":[[{"node":"Privacy Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Privacy Articles (24h)":{"main":[[{"node":"Sort - Privacy Articles by Date","type":"main","index":0}]]},"Format Compliance Articles into HTML":{"main":[[{"node":"AI Agent - Compliance Intelligence","type":"main","index":0}]]},"Security Build Final Newsletter HTML":{"main":[[{"node":"Security Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Security Articles (24h)":{"main":[[{"node":"Sort - Security Articles by Date","type":"main","index":0}]]},"Normalize Article Compliance Metadata":{"main":[[{"node":"Filter Recent Compliance Articles (24h)","type":"main","index":0}]]},"Compliance Build Final Newsletter HTML":{"main":[[{"node":"Compliance Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Compliance Articles (24h)":{"main":[[{"node":"Sort - Compliance Articles by Date","type":"main","index":0}]]}}}


name: Daily Auto-Archive for Gmail Messages
author_name: Niranjan G
author_username: niranjan
nodes_used: ["n8n-nodes-base.gmail"]
categories: []
created_at: 2025-06-05T06:28:09.689Z
updated_at: 2025-06-05T06:28:09.689Z
url: https://n8n.io/workflows/4679
scraped_at: 2025-07-06 21:16:30
description:
  Who is this for?

  Professionals, solopreneurs, or productivity enthusiasts who want to keep their Gmail inbox clean and organized without manual effort.

  What problem does this solve?

  Manually archiving emails clutters your time and slows you down. This workflow automates inbox cleanup by removing the "INBOX" label from messages received over 24 hours ago. A perfect companion to AI-based labeling workflows, this keeps your inbox light and relevant.

  What this workflow does

  Triggers every day at 4 AM
  Fetches Gmail messages from the INBOX that are older than 24 hours
  Processes them one by one using the Split Out node
  Removes the INBOX label, effectively archiving the messages

  Setup

  Connect your Gmail account using OAuth2 credentials.
  Customize the Schedule Trigger node to adjust the run time.
  Modify the Gmail filter if you want to archive unread or labeled emails instead.

  How to customize this workflow to your needs

  Schedule different frequencies (e.g. twice a day or weekly).

  🔄 Pairs Well With

  This complements the Intelligent Email Organization with AI-Powered Content Classification workflow.

  Use that to label emails smartly using AI, and this one to auto-archive them for a clean, clutter-free inbox.

workflow_json:
  {"meta":{"instanceId":"c62c01f3e843893075a10f252ec7d6d69e5ab593af019f50055d506cb3081b99","templateCredsSetupCompleted":true},"nodes":[{"id":"61682ff7-397d-4ecb-a98f-91d45d5a07a1","name":"Daily Trigger at 4AM","type":"n8n-nodes-base.scheduleTrigger","position":[-140,160],"parameters":{"rule":{"interval":[{"triggerAtHour":4}]}},"typeVersion":1.2},{"id":"84a83cf9-63fc-40cf-bfa6-bc01ad67b3b7","name":"Fetch Gmail Inbox Emails","type":"n8n-nodes-base.gmail","position":[80,160],"webhookId":"57a7df32-d350-4e67-b106-f7b5b8b39f08","parameters":{"filters":{"labelIds":"={{ [\"INBOX\"] }}","receivedBefore":"={{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}"},"operation":"getAll","returnAll":true},"credentials":{"gmailOAuth2":{"id":"T6a7nzYASeRq8gwp","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"29939c36-30d1-499a-9c1b-9d3e4c4c9ba5","name":"Split Each Email","type":"n8n-nodes-base.splitOut","position":[300,160],"parameters":{"options":{},"fieldToSplitOut":"id"},"typeVersion":1},{"id":"316ad247-78c2-4fbb-b420-94bb8fb354f3","name":"Archive Message (Remove INBOX Label)","type":"n8n-nodes-base.gmail","position":[520,160],"webhookId":"44a7f451-9ebb-4a08-86b2-1c4cb8600bcc","parameters":{"labelIds":["INBOX"],"messageId":"={{ $json.id }}","operation":"removeLabels"},"credentials":{"gmailOAuth2":{"id":"T6a7nzYASeRq8gwp","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1}],"connections":{"Split Each Email":{"main":[[{"node":"Archive Message (Remove INBOX Label)","type":"main","index":0}]]},"Daily Trigger at 4AM":{"main":[[{"node":"Fetch Gmail Inbox Emails","type":"main","index":0}]]},"Fetch Gmail Inbox Emails":{"main":[[{"node":"Split Each Email","type":"main","index":0}]]},"Archive Message (Remove INBOX Label)":{"main":[[]]}}}


name: AI-Powered Meta Ads Analysis & Creation with Gemini, GPT-4.1 Mini & Ads Manager
author_name: Daniel Setzermann
author_username: danielsetzermann
categories: []
created_at: 2025-06-05T09:09:39.117Z
updated_at: 2025-06-05T09:09:39.117Z
url: https://n8n.io/workflows/4684
scraped_at: 2025-07-06 21:16:30
description:
  AI-Powered Meta Ads Creation & Analysis Workflow

  Overview

  This comprehensive n8n workflow automates the entire Meta (Facebook/Instagram) advertising process, from asset analysis to ad creation. It combines AI-powered content analysis with automated ad deployment, streamlining the creation of high-converting social media advertisements.

  Key Features

  🤖 AI-Powered Asset Analysis
  Video Analysis**: Uses Google Gemini to analyze video content, extracting transcripts, scene descriptions, hooks, offers, and branding elements
  Image Analysis**: Employs GPT-4.1 Mini to analyze static images, identifying visual elements, USPs, and marketing potential
  Structured Output**: Generates detailed descriptions and creative insights for informed ad creation

  ✍️ Automated Ad Copy Generation
  Creates 3 variations each of primary text, headlines, and link descriptions
  Optimized for Meta's character limits and best practices
  Maintains brand voice and messaging consistency
  Leverages AI analysis to create compelling, conversion-focused copy

  🎯 Meta Ads Manager Integration
  Video Ads**: Uploads videos, creates ad creatives with multiple text variations
  Image Ads**: Supports both single and multi-image campaigns (1:1 and 9:16 formats)
  Asset Feed Optimization**: Implements placement-specific customization rules
  Automated Preview Generation**: Creates ad previews for different placements

  📊 Smart Workflow Management
  Google Drive Integration**: Monitors designated folders for new creative assets
  Google Sheets Tracking**: Maintains comprehensive records of all assets and campaigns
  Status Management**: Tracks processing stages and prevents duplicate work
  Error Handling**: Includes retry logic and status checking for reliable operation

  Workflow Components

  Asset Discovery & Processing
  Google Drive Trigger: Monitors specified folder for new image/video files
  File Analysis: Extracts metadata, dimensions, and file specifications
  Asset Registration: Logs all assets in Google Sheets for tracking

  AI Analysis Pipeline
  Content Type Detection: Automatically identifies videos vs. images
  Video Processing:
     Uploads to Google Gemini for analysis
     Generates comprehensive content breakdown
     Extracts all marketing-relevant elements
  Image Processing:
     Analyzes visual content with GPT-4.1 Mini
     Identifies key messaging and visual elements
     Creates detailed creative descriptions

  Ad Copy Creation
  AI Agent Processing: Transforms analysis into marketing copy
  Multi-Variant Generation: Creates 3 versions of each text element
  Platform Optimization: Ensures compliance with Meta's requirements
  Quality Assurance: Structured output validation

  Meta Ads Deployment
  Asset Upload: Pushes images/videos to Meta Ads Manager
  Creative Assembly: Builds ad creatives with generated copy variations
  Campaign Creation: Sets up ads with proper targeting and placement rules
  Status Tracking: Updates spreadsheet with campaign IDs and status

  Setup Requirements

  Required Credentials
  Meta Developer Account**: App access token for Meta Graph API
  Google Drive OAuth**: For file monitoring and asset access
  Google Sheets OAuth**: For workflow tracking and management
  Google Gemini API**: For video analysis capabilities
  OpenAI API**: For image analysis and copy generation

  Configuration Steps
  Google Drive Setup: 
     Create dedicated folder for creative assets
     Configure folder monitoring in the trigger node
  Google Sheets Template:
     Use provided template for asset and campaign tracking
     Configure account settings and campaign parameters
  Meta Developer Setup:
     Create Meta App and obtain access tokens
     Set up ad account permissions
  API Credentials:
     Configure all required authentication credentials
     Test connections before activation

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.googleDrive","n8n-nodes-base.facebookGraphApi","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.outputParserStructured"]

workflow_json:
  {"id":"HSkxJKrT4lRkab16","meta":{"instanceId":"0aee4372a556f3e4774323f4ed89755880cea473443f0948966509bbf55dec04","templateCredsSetupCompleted":true},"name":"Analyze Meta Ads, Create Ad Texts & Upload Image & Video Ads to Meta Ads Manager","tags":[],"nodes":[{"id":"6205a675-8533-458b-a0db-1298740d5161","name":"Upload Ad Video","type":"n8n-nodes-base.facebookGraphApi","position":[2340,1980],"parameters":{},"typeVersion":1},{"id":"fe523d79-a5c5-43d4-a6b0-e89c190d9007","name":"Get Video Preview Image","type":"n8n-nodes-base.facebookGraphApi","position":[2740,1980],"parameters":{},"typeVersion":1},{"id":"49f08c36-3494-4304-8542-67ff1deb244e","name":"Analyze Video with Gemini","type":"n8n-nodes-base.httpRequest","position":[2740,1020],"parameters":{},"typeVersion":4.2},{"id":"c638cf41-7820-4bf0-a253-dd9387a5ed32","name":"Gemini - Generate Upload URL","type":"n8n-nodes-base.httpRequest","position":[1300,1120],"parameters":{},"typeVersion":4.2},{"id":"4025ddce-afd4-4526-9a94-b59cbaa5837a","name":"Gemini - Upload File","type":"n8n-nodes-base.httpRequest","position":[1720,1120],"parameters":{},"typeVersion":4.2},{"id":"c116efd1-ac34-46bd-ae31-4650cc369f25","name":"Download from Google Drive","type":"n8n-nodes-base.googleDrive","position":[1520,1120],"parameters":{},"typeVersion":3},{"id":"cd25f2c2-5697-44d7-919b-1ef23505d124","name":"Create Asset","type":"n8n-nodes-base.googleSheets","position":[2380,780],"parameters":{},"typeVersion":4.5},{"id":"55aae2bf-e57b-4e06-baca-9ca3ca99d8b5","name":"Get All Rows","type":"n8n-nodes-base.googleSheets","position":[2640,780],"parameters":{},"executeOnce":true,"typeVersion":4.5},{"id":"5dc2e330-814b-43c7-9228-7c412a4bd4a3","name":"AI Description is Empty","type":"n8n-nodes-base.filter","position":[2880,780],"parameters":{},"typeVersion":2.2},{"id":"b402bfd8-7e64-4220-b5e8-7e88b765d896","name":"Check State","type":"n8n-nodes-base.httpRequest","position":[2340,1120],"parameters":{},"typeVersion":4.2},{"id":"e81071cf-e86a-42f0-ac80-13432e6b2097","name":"If","type":"n8n-nodes-base.if","position":[2540,1120],"parameters":{},"typeVersion":2.2},{"id":"0719ebaf-3c86-4d46-b5f3-9ed00c53936e","name":"Wait 2 Seconds","type":"n8n-nodes-base.wait","position":[2720,1220],"webhookId":"34306fcb-9f52-44cd-8343-333bb6032833","parameters":{},"typeVersion":1.1},{"id":"110d630e-0e17-42b9-998a-a224fa844b54","name":"Wait 3 Seconds","type":"n8n-nodes-base.wait","position":[2140,1120],"webhookId":"4451f2eb-68a3-420f-9c07-833308375076","parameters":{},"typeVersion":1.1},{"id":"48520a4b-7a8b-41e5-8c43-329c20870bc9","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[2960,1020],"parameters":{},"typeVersion":1.8},{"id":"57fa5985-8551-42a6-bd47-9519589a3bf7","name":"Video or Image","type":"n8n-nodes-base.switch","position":[3300,780],"parameters":{},"typeVersion":3.2},{"id":"649afa30-f30a-4c09-94ed-923f34515fd8","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2940,1220],"parameters":{},"typeVersion":1.2},{"id":"ab605d41-39a5-4a97-ab2f-8b1b52a5d846","name":"Get File Metadata","type":"n8n-nodes-base.httpRequest","position":[3100,780],"parameters":{},"typeVersion":4.2},{"id":"e571a88e-ca16-4572-ad6c-62f068504fb1","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[3160,1220],"parameters":{},"typeVersion":1.2},{"id":"29dc39cb-f783-4f94-868e-e5e6a40a73b2","name":"Get Ads to Process","type":"n8n-nodes-base.googleSheets","position":[1260,2020],"parameters":{},"typeVersion":4.5},{"id":"7d39fa34-bca9-45f1-b88f-76480317de39","name":"Get Settings","type":"n8n-nodes-base.googleSheets","position":[1260,2300],"parameters":{},"typeVersion":4.5},{"id":"304aafc4-5bd0-44f5-b20e-a38e5baefa75","name":"Merge","type":"n8n-nodes-base.merge","position":[1720,2160],"parameters":{},"typeVersion":3.1},{"id":"618ec524-d237-4495-8a51-0333069784e3","name":"AI Agent1","type":"@n8n/n8n-nodes-langchain.agent","position":[2960,1440],"parameters":{},"typeVersion":1.8},{"id":"b56d7a32-7772-48ec-bf20-dbc8709484ab","name":"Google Drive","type":"n8n-nodes-base.googleDrive","position":[1300,1440],"parameters":{},"typeVersion":3},{"id":"6a63d1f4-4e33-4cb5-ac02-7b73c9c7e216","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2940,1660],"parameters":{},"typeVersion":1.2},{"id":"d24b46b8-2dfe-4979-a678-5f43e23491ec","name":"Structured Output Parser1","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[3160,1660],"parameters":{},"typeVersion":1.2},{"id":"655d8706-a92c-4ad7-8b07-0bf14ce3febf","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[920,2140],"parameters":{},"typeVersion":1},{"id":"4ad90a98-acbc-4866-a51a-4d11d7a3a44e","name":"Get Video","type":"n8n-nodes-base.httpRequest","position":[2160,1980],"parameters":{},"typeVersion":4.2},{"id":"f02961b4-328a-4b5f-9d99-6ea5be623123","name":"Wait","type":"n8n-nodes-base.wait","position":[2540,1980],"webhookId":"c022fd1f-a2ca-445d-ba8b-1e847b03ac3a","parameters":{},"typeVersion":1.1},{"id":"e7f640d3-b382-4076-895b-3482bce6bee6","name":"Video or Image Asset","type":"n8n-nodes-base.switch","position":[1900,2160],"parameters":{},"typeVersion":3.2},{"id":"7133563d-7b1a-4ad2-94b8-92e09c1bf7dd","name":"Facebook Graph API","type":"n8n-nodes-base.facebookGraphApi","position":[3800,2280],"parameters":{},"typeVersion":1},{"id":"6b07b2cd-a0cd-494d-9243-0f3ebe836830","name":"Get image 1","type":"n8n-nodes-base.httpRequest","position":[2160,2280],"parameters":{},"typeVersion":4.2},{"id":"783616dd-ddae-459a-b01b-381c0616812f","name":"Get image ","type":"n8n-nodes-base.httpRequest","position":[2800,2200],"parameters":{},"typeVersion":4.2},{"id":"dae5668c-4be2-4a19-800f-83d7b63e1518","name":"Google Drive Folder Updated","type":"n8n-nodes-base.googleDriveTrigger","position":[1260,780],"parameters":{},"typeVersion":1},{"id":"9b6145e0-3fd8-4664-a9dc-297f7d949191","name":"Fetch All Files","type":"n8n-nodes-base.googleDrive","position":[1520,780],"parameters":{},"typeVersion":3},{"id":"d3566142-d98e-47dc-a0a1-74a0be61170f","name":"Get Files Metadata","type":"n8n-nodes-base.httpRequest","position":[1780,780],"parameters":{},"typeVersion":4.2},{"id":"5135bbca-2715-401c-9019-5b21b1b76362","name":"Extract File Specs","type":"n8n-nodes-base.set","position":[2060,780],"parameters":{},"typeVersion":3.4},{"id":"75a91825-ea89-461c-85e5-77a2a6736dee","name":"Save Video Analysis Output","type":"n8n-nodes-base.googleSheets","position":[3320,1020],"parameters":{},"typeVersion":4.5},{"id":"367910e1-f247-4bcd-8ba3-e65afd3ac731","name":"Save Image Analysis Output","type":"n8n-nodes-base.googleSheets","position":[3340,1440],"parameters":{},"typeVersion":4.5},{"id":"d730546f-874b-4f85-882b-415f201f3941","name":"Filter Unprocessed Ads","type":"n8n-nodes-base.filter","position":[1480,2020],"parameters":{},"typeVersion":2.2},{"id":"485afc5d-4490-44a1-b25a-d87b21f1fe04","name":"Create Video Ad Creative","type":"n8n-nodes-base.facebookGraphApi","position":[2960,1980],"parameters":{},"typeVersion":1},{"id":"31fc206d-3f57-4c40-a24e-8299bbd6e452","name":"Create Video Ad","type":"n8n-nodes-base.facebookGraphApi","position":[3580,1980],"parameters":{},"typeVersion":1},{"id":"51e84264-cd4a-4385-be69-ee11ae4429d5","name":"Save Video Ad Details","type":"n8n-nodes-base.googleSheets","position":[4120,1980],"parameters":{},"typeVersion":4.5},{"id":"cb41025e-e1e0-454c-93b5-a36eba57dba5","name":"Check if two or one image","type":"n8n-nodes-base.if","position":[2560,2280],"parameters":{},"typeVersion":2.2},{"id":"73757cd6-9a2c-4bc5-8842-f92177a31cd3","name":"Upload Ad Image","type":"n8n-nodes-base.facebookGraphApi","position":[2340,2280],"parameters":{},"typeVersion":1},{"id":"93f5be7e-8a94-4aaa-8e65-e2316e7bc15a","name":"Create Multiple Image Creative","type":"n8n-nodes-base.facebookGraphApi","position":[3240,2200],"parameters":{},"typeVersion":1},{"id":"49efc025-f772-4669-96c7-a9ed4b2dca63","name":"Create Image Creative","type":"n8n-nodes-base.facebookGraphApi","position":[3000,2520],"parameters":{},"typeVersion":1},{"id":"d7fe1213-3db6-47b3-ac69-debc873c79e0","name":"Upload Second Ad Image","type":"n8n-nodes-base.facebookGraphApi","position":[3020,2200],"parameters":{},"typeVersion":1},{"id":"4887b86c-c0be-4810-90ff-0a5be4a07b71","name":"Create Image Ad","type":"n8n-nodes-base.facebookGraphApi","position":[3580,2280],"parameters":{},"typeVersion":1},{"id":"77f3371f-b818-4bf0-9381-126aa374f453","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1260,660],"parameters":{"content":""},"typeVersion":1},{"id":"92a00fa1-89be-45e0-9055-189ac0479114","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2380,660],"parameters":{"content":""},"typeVersion":1},{"id":"c064fecd-9d51-4839-bf86-9134b12102c4","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3500,1100],"parameters":{"content":""},"typeVersion":1},{"id":"f27867dc-13f3-4d7a-8a5b-04776c6389ff","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[3520,1520],"parameters":{"content":""},"typeVersion":1},{"id":"cc280912-6f45-4836-8c22-edd471c13ec8","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[4080,1880],"parameters":{"content":""},"typeVersion":1},{"id":"225cde15-4ded-41b1-a6ea-b40ea1c9e961","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[4080,2460],"parameters":{"content":""},"typeVersion":1},{"id":"9875016f-c878-4215-ba17-a350d8fa26e6","name":"Save Image Ad Details","type":"n8n-nodes-base.googleSheets","position":[4120,2280],"parameters":{},"typeVersion":4.5},{"id":"72d1819a-b983-4f0c-afc2-1f83baf6416f","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1220,2460],"parameters":{"content":""},"typeVersion":1},{"id":"79292ebc-98f7-4acb-aca7-01d641091301","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1220,1920],"parameters":{"content":""},"typeVersion":1},{"id":"bb4afb0c-97cb-41db-a42d-44c10aed33f3","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[680,660],"parameters":{"content":""},"typeVersion":1},{"id":"729d2f7e-4e14-4c91-8fa5-1d42eef3923c","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[2900,1340],"parameters":{"content":""},"typeVersion":1},{"id":"82abdc96-707e-4a9f-8717-217dc583c06f","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[2900,1780],"parameters":{"content":""},"typeVersion":1},{"id":"051d9a9f-d786-4188-91a5-0f33cf8dba24","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[640,1940],"parameters":{"content":""},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"7ec4840f-4712-4879-b777-fa11bb265770","connections":{"If":{"main":[[{"node":"Analyze Video with Gemini","type":"main","index":0}],[{"node":"Wait 2 Seconds","type":"main","index":0}]]},"Wait":{"main":[[{"node":"Get Video Preview Image","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Video or Image Asset","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Save Video Analysis Output","type":"main","index":0}]]},"AI Agent1":{"main":[[{"node":"Save Image Analysis Output","type":"main","index":0}]]},"Get Video":{"main":[[{"node":"Upload Ad Video","type":"main","index":0}]]},"Get image ":{"main":[[{"node":"Upload Second Ad Image","type":"main","index":0}]]},"Check State":{"main":[[{"node":"If","type":"main","index":0}]]},"Get image 1":{"main":[[{"node":"Upload Ad Image","type":"main","index":0}]]},"Create Asset":{"main":[[{"node":"Get All Rows","type":"main","index":0}]]},"Get All Rows":{"main":[[{"node":"AI Description is Empty","type":"main","index":0}]]},"Get Settings":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Google Drive":{"main":[[{"node":"AI Agent1","type":"main","index":0}]]},"Video or Image":{"main":[[{"node":"Gemini - Generate Upload URL","type":"main","index":0}],[{"node":"Google Drive","type":"main","index":0}]]},"Wait 2 Seconds":{"main":[[{"node":"Check State","type":"main","index":0}]]},"Wait 3 Seconds":{"main":[[{"node":"Check State","type":"main","index":0}]]},"Create Image Ad":{"main":[[{"node":"Facebook Graph API","type":"main","index":0}]]},"Create Video Ad":{"main":[[{"node":"Save Video Ad Details","type":"main","index":0}]]},"Fetch All Files":{"main":[[{"node":"Get Files Metadata","type":"main","index":0}]]},"Upload Ad Image":{"main":[[{"node":"Check if two or one image","type":"main","index":0}]]},"Upload Ad Video":{"main":[[{"node":"Wait","type":"main","index":0}]]},"Get File Metadata":{"main":[[{"node":"Video or Image","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Extract File Specs":{"main":[[{"node":"Create Asset","type":"main","index":0}]]},"Facebook Graph API":{"main":[[{"node":"Save Image Ad Details","type":"main","index":0}]]},"Get Ads to Process":{"main":[[{"node":"Filter Unprocessed Ads","type":"main","index":0}]]},"Get Files Metadata":{"main":[[{"node":"Extract File Specs","type":"main","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"AI Agent1","type":"ai_languageModel","index":0}]]},"Gemini - Upload File":{"main":[[{"node":"Wait 3 Seconds","type":"main","index":0}]]},"Video or Image Asset":{"main":[[{"node":"Get Video","type":"main","index":0}],[{"node":"Get image 1","type":"main","index":0}]]},"Create Image Creative":{"main":[[{"node":"Create Image Ad","type":"main","index":0}]]},"Filter Unprocessed Ads":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Upload Second Ad Image":{"main":[[{"node":"Create Multiple Image Creative","type":"main","index":0}]]},"AI Description is Empty":{"main":[[{"node":"Get File Metadata","type":"main","index":0}]]},"Get Video Preview Image":{"main":[[{"node":"Create Video Ad Creative","type":"main","index":0}]]},"Create Video Ad Creative":{"main":[[{"node":"Create Video Ad","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"AI Agent","type":"ai_outputParser","index":0}]]},"Analyze Video with Gemini":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Check if two or one image":{"main":[[{"node":"Get image ","type":"main","index":0}],[{"node":"Create Image Creative","type":"main","index":0}]]},"Structured Output Parser1":{"ai_outputParser":[[{"node":"AI Agent1","type":"ai_outputParser","index":0}]]},"Download from Google Drive":{"main":[[{"node":"Gemini - Upload File","type":"main","index":0}]]},"Google Drive Folder Updated":{"main":[[{"node":"Fetch All Files","type":"main","index":0}]]},"Gemini - Generate Upload URL":{"main":[[{"node":"Download from Google Drive","type":"main","index":0}]]},"Create Multiple Image Creative":{"main":[[{"node":"Create Image Ad","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Get Ads to Process","type":"main","index":0},{"node":"Get Settings","type":"main","index":0}]]}}}


name: Lead Generation Automate on LinkedIn - Personalisation, Enrichment
author_name: Krupal Patel
author_username: krupalpatel
categories: []
created_at: 2025-06-05T10:57:25.716Z
updated_at: 2025-06-05T10:57:25.716Z
url: https://n8n.io/workflows/4685
scraped_at: 2025-07-06 21:16:30
description:
  🔧 Workflow Summary

  This system automates LinkedIn lead generation and enrichment in six clear stages:

  1. Lead Collection (via Apollo.io)
  Automatically pulls leads based on keywords, roles, or industries using Apollo’s API.
  Captures name, job title, company, and LinkedIn profile URL.
  You can kick off the workflow via form, webhook, WhatsApp, Telegram, or any other custom trigger that passes search parameters.

  2. LinkedIn Username Extraction
  Extracts usernames from LinkedIn profile URLs using a script step.
  These usernames are required for further enrichment using RapidAPI.

  3. Email Retrieval (via Apollo.io User ID)
  Fetches verified work email using the Apollo User ID.
  Email validity is double-checked using www.mails.so filtering out undeliverable or inactive emails by checking MX records and deliverability.

  4. Profile Summary (via LinkedIn API on RapidAPI)
  Enriches lead data by pulling bio/summary details to understand their background and expertise.

  5. Activity Insights (Posts & Reposts)
  Collects recent posts or reposts to help craft personalised messages based on what they’re currently engaging with.

  6. Leads Sheet Update
  All data is written into a Google Sheet.
  New columns are populated dynamically without erasing existing data.

  ⸻

  ✅ Smart Retry Logic

  Each workflow is equipped with a fail-safe system:
  Tracks status per row: ✅ done, ❌ failed, ⏳ pending
  Failed rows are automatically retried after a custom delay (e.g., 2 weeks).
  Ensures minimal drop-offs and complete data coverage.

  📊 Google Sheets Setup

  Make a copy of the following:
  Template 1: Apollo Leads Scraper & Enrichment
  Template 2: Final Enriched Leads 

  The system appends data (like emails, bios, activity) step by step.

  🔐 API Credentials Needed

  1. Apollo API
  Sign up and generate API key at Apollo Developer Portal
  Be sure to enable the “Master API Key” toggle so the same key works for all endpoints.

  2. LinkedIn Data API (via RapidAPI)
  Subscribe at RapidAPI - LinkedIn Data
  Use your key in the x-rapidapi-key
   header.

  3. Mails.so API
  Get your API Key from mails.so dashboard

  🛠️ Troubleshooting – LinkedIn Lead Machine

  ✅ Common Mistakes & Fixes

  1. API Keys Not Working
  Make sure API keys for Apollo, RapidAPI, and mails.so are correct.
  Apollo “Master API Key” must be enabled.
  Keys should be saved as Generic Credentials in n8n.

  2. Leads Not Found
  Check if the search query (keyword/job title) is too narrow.
  Apollo might return empty results if the filters are incorrect.

  3. LinkedIn URLs Missing or Invalid
  Ensure Apollo is returning valid LinkedIn URLs.
  Improper URLs will cause username extraction and enrichment steps to fail.

  4. Emails Not Coming Through
  Apollo may not have verified emails for all leads.
  mails.so might reject invalid or expired email addresses.

  5. Google Sheet Not Updating
  Make sure the Google Sheet is shared with the right Google account (linked to n8n).
  Check if the column names match and data isn’t blocked due to formatting.

  6. Status Columns Not Changing
  Each row must have done, failed, or pending in the status column.
  If the status doesn’t update, the retry logic won’t trigger.

  7. RapidAPI Not Returning Data
  Double-check if username is present and valid.
  Make sure the RapidAPI plan is active and within limits.

  8. Workflow Not Running
  Check if the trigger node (form, webhook, etc.) is connected and active.
  Make sure you’re passing the required inputs (keyword, role, etc.).

  Need Help? Contact www.KrupalPatel.com for support and custom workflow development

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"id":"Dbzu6lmK6zWsyyQP","meta":{"instanceId":"2cff59bc4079733bed2846cef09ebd74d667b91742f344a1b849c8c2f8c8dd5a","templateCredsSetupCompleted":true},"name":"Lead 1","tags":[],"nodes":[{"id":"4cab7c48-1c69-479e-83ce-fe4d3974b5ce","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[220,140],"webhookId":"28ff6927-5d05-4182-910b-be2381e3b2c4","parameters":{"options":{},"formTitle":"Leads Search","formFields":{"values":[{"fieldLabel":"Job Title","requiredField":true},{"fieldLabel":"Location","requiredField":true},{"fieldType":"number","fieldLabel":"Number of Leads","requiredField":true}]}},"typeVersion":2.2},{"id":"5ed7d147-f2a2-4a9e-911f-45f5ca0bafdb","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[660,140],"parameters":{"options":{},"fieldToSplitOut":"people"},"typeVersion":1,"alwaysOutputData":false},{"id":"6851151e-6b2a-42b7-8e0a-729c650da6c4","name":"OpenAI1","type":"@n8n/n8n-nodes-langchain.openAi","position":[740,380],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=remove the http or https://www.linkedin.com/in/ from this  {{ $json.linkedin_url }}"}]}},"credentials":{"openAiApi":{"id":"AxgLOaYQtHmZdGyY","name":"krishna openai"}},"typeVersion":1.8},{"id":"f1a9b0fb-f9a8-48f5-b369-f52516214503","name":"Google Sheets Trigger2","type":"n8n-nodes-base.googleSheetsTrigger","position":[20,580],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"4c198be2-a508-4269-ad59-0e490caafd60","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-200,-60],"parameters":{"width":1820,"height":1020,"content":"## Automated Lead Generation and Enrichment Workflow\n\nDescription: This workflow automates lead generation by collecting job title, location, and lead count via a form, using Apollo.io to fetch leads, and OpenAI to extract LinkedIn usernames. It stores and updates lead data in Google Sheets, validating email addresses and tracking scrape statuses for efficient lead management.\n"},"typeVersion":1},{"id":"4db87428-54a3-4110-bb3e-16ac2a64927b","name":"Clean Data","type":"n8n-nodes-base.set","position":[880,140],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e3bfe30e-9136-4ac9-b3da-c26eb678153b","name":"id","type":"string","value":"={{ $json.id }}"},{"id":"d45c81fb-1461-45fd-be95-d5d9901d72d7","name":"name","type":"string","value":"={{ $json.name }}"},{"id":"b4b8f660-7758-4a5f-a8f6-dc8ab6355132","name":"linkedin_url","type":"string","value":"={{ $json.linkedin_url }}"},{"id":"399f533a-6e6b-4f40-8ed8-aa5dd39017cd","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"227d34c5-17db-4436-b0c2-f74e5ae453f2","name":"organization","type":"string","value":"={{ $json.employment_history[0].organization_name }}"}]}},"typeVersion":3.4},{"id":"a34921c3-cdae-4db0-9c7b-cd857d0cd552","name":"Add Linkedin Username","type":"n8n-nodes-base.googleSheets","position":[1080,380],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Username Row').item.json.apollo_id }}","linkedin_username":"={{ $json.message.content }}","extract_username_status":"finished"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":false,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":false,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"be0a482f-69be-4906-a944-ae480bddc445","name":"Get Pending Username Row","type":"n8n-nodes-base.googleSheets","position":[500,380],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"extract_username_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"f87ef1f1-ba4a-4104-9c4b-f6d93f770ede","name":"Add Email Address","type":"n8n-nodes-base.googleSheets","position":[1340,500],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Email Statuses').item.json.apollo_id }}","email_address":"={{ $json.data.email }}","contacts_scrape_status":"finished"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":false,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"1f9cb0e4-2b26-4948-9294-82d8abfab4eb","name":"If","type":"n8n-nodes-base.if","position":[1000,580],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"dd16c397-c6f6-4a91-b92c-24a1f24b707f","operator":{"type":"string","operation":"notContains"},"leftValue":"={{ $json.data.mx_record }}","rightValue":"null"},{"id":"bc3200af-7ae4-4944-b410-ebb459e2d927","operator":{"type":"string","operation":"contains"},"leftValue":"={{ $json.data.result }}","rightValue":"deliverable"}]},"looseTypeValidation":true},"typeVersion":2.2},{"id":"d539aec1-0584-4d04-8d6c-0492d0ead4dd","name":"Mark Invalid Email","type":"n8n-nodes-base.googleSheets","position":[1340,700],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Email Statuses').item.json.apollo_id }}","contacts_scrape_status":"invalid_email"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"08fd30c9-acfe-4775-81fa-ccc3153160b8","name":"Confirm Email Validity","type":"n8n-nodes-base.httpRequest","position":[740,580],"parameters":{"url":"=https://api.mails.so/v1/validate?email={{ $json.person.email }}","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"x-mails-api-key","value":"83bd75d6-5fd4-4ea9-8554-5e2b1ba90893"}]}},"typeVersion":4.2},{"id":"37ac82ac-ee91-42ed-8d62-9b5ba959fb25","name":"Get Pending Email Statuses","type":"n8n-nodes-base.googleSheets","position":[260,580],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"contacts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"5f5cfd40-520b-4abc-a073-bfa2aa89afb5","name":"Google Sheets Trigger3","type":"n8n-nodes-base.googleSheetsTrigger","position":[-40,1060],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"4fe13d3a-553d-45e1-88d6-b75d53b4f58c","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-180,960],"parameters":{"color":6,"width":1320,"height":700,"content":"## LinkedIn Profile Summary Enrichment Workflow\nThis workflow automates the enrichment of lead data by fetching LinkedIn profile details for records marked as \"pending\" in a Google Sheets document, using the LinkedIn Data API. It cleans and summarizes the profile data with OpenAI, then updates the Google Sheet with the summarized profile and status, marking failed attempts if errors occur."},"typeVersion":1},{"id":"f00b7fe0-1bb8-44b9-b19e-cca7576bd7fe","name":"Get Profile Posts","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","maxTries":2,"position":[640,1900],"parameters":{"url":"https://linkedin-data-api.p.rapidapi.com/get-profile-posts","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"username","value":"={{ $json.linkedin_username }}"},{"name":"start","value":"0"}]},"headerParameters":{"parameters":[{"name":"x-rapidapi-host","value":"linkedin-data-api.p.rapidapi.com"},{"name":"x-rapidapi-key","value":"faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"}]}},"retryOnFail":true,"typeVersion":4.2},{"id":"102398c4-8760-4cc7-8664-293b5de3c460","name":"Get About Profile","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","maxTries":2,"position":[760,1060],"parameters":{"url":"https://linkedin-data-api.p.rapidapi.com","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"username","value":"={{ $json.linkedin_username }}"}]},"headerParameters":{"parameters":[{"name":"x-rapidapi-host","value":"linkedin-data-api.p.rapidapi.com"},{"name":"x-rapidapi-key","value":"faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"}]}},"retryOnFail":true,"typeVersion":4.2},{"id":"747e0b11-839f-4335-bf62-f695575372b1","name":"Get Pending About and Posts Rows","type":"n8n-nodes-base.googleSheets","position":[220,1060],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"profile_summary_scrape"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"f5e0160c-2602-4e62-a230-4b4a73136b88","name":"Clean Profile Data","type":"n8n-nodes-base.code","onError":"continueErrorOutput","maxTries":2,"position":[-60,1360],"parameters":{"mode":"runOnceForEachItem","jsCode":"return {\n  summary: $json.summary || null,\n  headline: $json.headline || null,\n  nationality: $json.geo?.country || null,\n  language: $json.languages?.[0]?.name || null,\n  education: $json.educations?.[0]?.schoolName || null,\n  fieldOfStudy: $json.educations?.[0]?.fieldOfStudy || null,\n  employment_company: $json.position?.[0]?.companyName || null,\n  company_industry: $json.position?.[0]?.companyIndustry || null,\n  position: $json.position?.[0]?.title || null,\n  company_location: $json.position?.[0]?.location || null,\n  employment_description_1: $json.position?.[0]?.description || null,\n};\n"},"retryOnFail":true,"typeVersion":2},{"id":"470a2381-fdcc-4e62-bda2-9ef81db3acb0","name":"Google Sheets Trigger4","type":"n8n-nodes-base.googleSheetsTrigger","position":[-80,1900],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"b19f9d0d-b0fa-409a-b3e1-d9b2f52f25e8","name":"Get Pending About and Posts Rows1","type":"n8n-nodes-base.googleSheets","position":[160,1900],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"unscraped","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"3d42dfba-2a1c-4457-bc16-e868c597a381","name":"Clean Posts Data","type":"n8n-nodes-base.code","onError":"continueErrorOutput","maxTries":2,"position":[920,1900],"parameters":{"mode":"runOnceForEachItem","jsCode":"const data = $json.data || [];\n\nfunction getText(post, reshared = false) {\n  if (!post) return \"\";\n  return reshared ? (post.resharedPost?.text || \"\") : (post.text || \"\");\n}\n\nfunction getDate(post) {\n  if (!post) return \"\";\n  return post.postedDate || post.postedDateTimestamp || \"\";\n}\n\nreturn {\n  json: {\n    post_1: getText(data[0]),\n    post_1_date: getDate(data[0]),\n\n    post_2: getText(data[1]),\n    post_2_date: getDate(data[1]),\n\n    post_3: getText(data[2]),\n    post_3_date: getDate(data[2]),\n\n    \n  }\n};\n"},"retryOnFail":true,"typeVersion":2,"waitBetweenTries":3000},{"id":"afa569d3-3fbc-4b16-b869-3461e442a740","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-220,1680],"parameters":{"color":4,"width":2420,"height":560,"content":"## LinkedIn Posts Scraping and Lead Enrichment Workflow\nThis workflow retrieves recent LinkedIn posts for leads marked \"unscraped\" in a Google Sheet, using the LinkedIn Data API, and summarizes them with OpenAI to enhance lead profiles for personalized outreach. It updates the Google Sheet with post summaries, tracks failed attempts, and transfers fully enriched profiles (with validated emails, profile summaries, and post summaries) to a separate Enriched Leads Database."},"typeVersion":1},{"id":"31928be6-191f-4ec3-a88d-dbd7f613f1aa","name":"Google Sheets Trigger5","type":"n8n-nodes-base.googleSheetsTrigger","position":[1200,2420],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"f0c78b3d-be0c-4113-8392-2d91c4f707d7","name":"Schedule Trigger2","type":"n8n-nodes-base.scheduleTrigger","position":[2120,340],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"0661680e-a4d0-4595-aef7-e832fc812f0e","name":"get invalid email rows","type":"n8n-nodes-base.googleSheets","position":[2360,1180],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"invalid_email","lookupColumn":"contacts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"d1da0dbc-85f8-4b95-88b4-7cf68e59560a","name":"update_to_pending","type":"n8n-nodes-base.googleSheets","position":[2580,1180],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","contacts_scrape_status":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"2f87a52a-83fa-4a57-90c3-7b9cf658091d","name":"get_failed_profile_summary_rows","type":"n8n-nodes-base.googleSheets","position":[2340,340],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"failed","lookupColumn":"profile_summary_scrape"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"3ba33190-7e23-4b61-a12c-b014e04dec27","name":"update_to_pending1","type":"n8n-nodes-base.googleSheets","position":[2560,340],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","profile_summary_scrape":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"c84a23f2-c19b-4752-8195-6bb03dc2c3f4","name":"Schedule Trigger3","type":"n8n-nodes-base.scheduleTrigger","position":[2180,800],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"7dd1874a-3be3-4c8f-8118-d2f0881f06ba","name":"get_failed_posts_summary_rows1","type":"n8n-nodes-base.googleSheets","position":[2400,800],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"failed","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"2ebf97c9-381f-4823-8a08-c9943c1abf80","name":"Posts AI Summarizer","type":"@n8n/n8n-nodes-langchain.openAi","position":[1560,1820],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=Below are the most recent posts and reposts from a LinkedIn user. Summarize them collectively in no more than two short paragraphs. Focus on capturing the main themes, tone, and any recurring interests or professional concerns.\n\nAvoid listing each post separately — instead, synthesize the information into a narrative that gives a clear idea of what this person is currently focused on or passionate about.\n\nPosts: {{ $json.postsString }}\n\nKeep it insightful but brief — no more than 2 concise paragraphs."}]},"simplify":false},"credentials":{"openAiApi":{"id":"X2hq9OSGP3TFsKt6","name":"AIX 1"}},"executeOnce":false,"typeVersion":1.8},{"id":"6dbcfab2-e3fe-46ed-9fa5-9301f0762815","name":"AI Profile Summarizer","type":"@n8n/n8n-nodes-langchain.openAi","position":[420,1280],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=Please summarize the following linkedin profile data {{ $json.profileString }} for a lead I want to cold email. I want to combine this summary with another information about them to send personalied emails, so please make sure you include relevant bits in the summary"}]},"simplify":false},"credentials":{"openAiApi":{"id":"X2hq9OSGP3TFsKt6","name":"AIX 1"}},"executeOnce":false,"typeVersion":1.8},{"id":"a03e2002-840c-4792-a4aa-35b4a1886584","name":"Update Profile Summary","type":"n8n-nodes-base.googleSheets","position":[900,1280],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}","about_linkedin_profile":"={{ $json.choices[0].message.content }}","profile_summary_scrape":"completed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":false,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"a259f9ad-4e43-4d96-8d37-7312e7658fc2","name":"Update Posts Summary","type":"n8n-nodes-base.googleSheets","position":[2020,1820],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows1').item.json.apollo_id }}","posts_scrape_status":"scraped","recent_posts_summary":"={{ $json.choices[0].message.content }}"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"1e27ce31-3f74-458b-bdd1-b8aaa6cc709a","name":"Get Completely Enriched Profiles","type":"n8n-nodes-base.googleSheets","position":[1420,2420],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"finished","lookupColumn":"contacts_scrape_status"},{"lookupValue":"completed","lookupColumn":"profile_summary_scrape"},{"lookupValue":"scraped","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"80ee87ce-8f6b-4dda-a065-888fe5f485fc","name":"update_to_unscraped","type":"n8n-nodes-base.googleSheets","position":[2600,800],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","posts_scrape_status":"unscraped"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"5f39b0e9-da20-48d1-b169-57252c514f36","name":"Append to Enriched Leads Database","type":"n8n-nodes-base.googleSheets","position":[1620,2420],"parameters":{"columns":{"value":{"Position":"={{ $json.title }}","Lead Name":"={{ $json.name }}","Email Address":"={{ $json.email_address }}","Company/Organization":"={{ $json.organization }}","Recent Posts Summary":"={{ $json.recent_posts_summary }}","Linkedin Profile Summary":"={{ $json.about_linkedin_profile }}"},"schema":[{"id":"Lead Name","type":"string","display":true,"required":false,"displayName":"Lead Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Email Address","type":"string","display":true,"removed":false,"required":false,"displayName":"Email Address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Company/Organization","type":"string","display":true,"required":false,"displayName":"Company/Organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Position","type":"string","display":true,"required":false,"displayName":"Position","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Linkedin Profile Summary","type":"string","display":true,"required":false,"displayName":"Linkedin Profile Summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Recent Posts Summary","type":"string","display":true,"required":false,"displayName":"Recent Posts Summary","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["Email Address"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"appendOrUpdate","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit?usp=drivesdk","cachedResultName":"Enriched Leads Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"3c2ced03-2b9d-4cae-8ce2-3d280575448e","name":"update status to failed","type":"n8n-nodes-base.googleSheets","position":[200,1440],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}","profile_summary_scrape":"failed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"e23649fb-6414-46e1-86ff-040e69896c0b","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[1320,1980],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows1').item.json.apollo_id }}","posts_scrape_status":"failed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"7b086a49-f227-4883-9391-25e5acb8780a","name":"Stringify Profile Data1","type":"n8n-nodes-base.code","position":[200,1280],"parameters":{"mode":"runOnceForEachItem","jsCode":"const profile = item.json;\n\nreturn {\n  json: {\n    profileString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"},"typeVersion":2},{"id":"608eb567-2f5f-4113-acb8-d2ef2a2990e5","name":"Stringify Posts Data","type":"n8n-nodes-base.code","position":[1320,1820],"parameters":{"mode":"runOnceForEachItem","jsCode":"const profile = item.json;\n\nreturn {\n  json: {\n    postsString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"},"typeVersion":2},{"id":"a873dbe2-c2fd-41ab-bad7-7e058446ffc2","name":"Schedule Trigger1","type":"n8n-nodes-base.scheduleTrigger","position":[2140,1180],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"e6a3abf6-bb85-4b7e-9498-5490d1d9a3b4","name":"Generate Leads with Apollo.io1","type":"n8n-nodes-base.httpRequest","position":[460,140],"parameters":{"url":"=https://api.apollo.io/api/v1/mixed_people/search","method":"POST","options":{"response":{"response":{}}},"jsonBody":"={\n  \"person_locations\": [\"{{ $json.Location }}\"],\n  \"person_titles\": [\"{{ $json['Job Title'] }}\"],\n  \"page\": 1,\n  \"per_page\": {{$json['Number of Leads']}},\n  \"projection\": [\"id\", \"name\", \"linkedin_url\", \"title\"]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Cache-Control","value":"no-cache"},{"name":"accept","value":"application/json"},{"name":"x-api-key","value":"\"your-api_key_here\""}]}},"typeVersion":4.2},{"id":"ddc7ed41-4be8-4daf-85ef-0cdb706f3003","name":"Add Leads to Google Sheet","type":"n8n-nodes-base.googleSheets","position":[1080,140],"parameters":{"columns":{"value":{"name":"={{ $json.name }}","title":"={{ $json.title }}","apollo_id":"={{ $json.id }}","linkedin_url":"={{ $json.linkedin_url }}","organization":"={{ $json.organization }}","posts_scrape_status":"pending","contacts_scrape_status":"pending","profile_summary_scrape":"pending","extract_username_status":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"836386bd-a5c4-4cb1-8ba6-8ce2310fcc96","name":"HTTP Request","type":"n8n-nodes-base.httpRequest","position":[520,5040],"parameters":{"url":"=https://blessed-gently-stag.ngrok-free.app/contacts","options":{}},"typeVersion":4.2},{"id":"ed3b325d-80a5-491a-9f1d-165df1d5b0ec","name":"Get Email from Apollo11","type":"n8n-nodes-base.httpRequest","position":[480,580],"parameters":{"url":"https://api.apollo.io/api/v1/people/match","method":"POST","options":{},"sendBody":true,"sendQuery":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"id","value":"={{ $json.apollo_id }}"}]},"queryParameters":{"parameters":[{"name":"reveal_personal_emails","value":"true"},{"name":"reveal_phone_number","value":"false"}]},"headerParameters":{"parameters":[{"name":"Cache-Control","value":"no-cache"},{"name":"accept","value":"application/json"},{"name":"x-api-key","value":"\"your_api_key\""}]}},"typeVersion":4.2},{"id":"f9b631b7-d5ad-49be-9a84-c8eceaedb264","name":"Limit","type":"n8n-nodes-base.limit","position":[440,1060],"parameters":{"maxItems":2},"typeVersion":1},{"id":"91810b86-6b72-402a-a11f-fea6c6d79b80","name":"Limit1","type":"n8n-nodes-base.limit","position":[380,1900],"parameters":{"maxItems":8},"typeVersion":1},{"id":"302e4c03-82bc-42f6-bb17-e03db2f50a4a","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1060,2300],"parameters":{"color":4,"width":960,"height":360,"content":"## Update Completely Enriched Profile to Final Database"},"typeVersion":1},{"id":"630174c3-35a3-424f-aa93-6b679cf21624","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[2040,660],"parameters":{"color":7,"width":800,"height":360,"content":"## Update posts summary status from failed back to pending"},"typeVersion":1},{"id":"c689c67c-5169-4d7d-a1e8-70b986cd1a47","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2040,1100],"parameters":{"color":5,"width":800,"height":360,"content":"## Update Contact Scrape Status from Invalid back to Pending"},"typeVersion":1},{"id":"c27398fd-76d0-470f-b8c8-969e5a1c6a87","name":"Google Sheets Trigger","type":"n8n-nodes-base.googleSheetsTrigger","position":[260,380],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"427f85ab-7b49-4b6d-89a2-dbe0bc3e0534","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[2000,220],"parameters":{"color":6,"width":820,"height":360,"content":"## Update profile summary status from failed back to pending"},"typeVersion":1},{"id":"0dc99522-a422-4321-b51e-676a70936c8b","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1720,40],"parameters":{"color":4,"width":1280,"height":1540,"content":"## Scheduled Lead Status Reset Workflow\nThis workflow runs on a schedule every four weeks to identify Google Sheets rows with invalid email addresses or failed post summary scrapes. It updates the status of these rows to \"pending\" for email revalidation and \"unscraped\" for post rescraping, enabling automated retry attempts for lead enrichment."},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"5436ea49-4d99-4996-a2ff-6feb039aac43","connections":{"If":{"main":[[{"node":"Add Email Address","type":"main","index":0}],[{"node":"Mark Invalid Email","type":"main","index":0}]]},"Limit":{"main":[[{"node":"Get About Profile","type":"main","index":0}]]},"Limit1":{"main":[[{"node":"Get Profile Posts","type":"main","index":0}]]},"OpenAI1":{"main":[[{"node":"Add Linkedin Username","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"Clean Data","type":"main","index":0}]]},"Clean Data":{"main":[[{"node":"Add Leads to Google Sheet","type":"main","index":0}]]},"HTTP Request":{"main":[[]]},"Clean Posts Data":{"main":[[{"node":"Stringify Posts Data","type":"main","index":0}],[{"node":"Google Sheets","type":"main","index":0}]]},"Get About Profile":{"main":[[{"node":"Clean Profile Data","type":"main","index":0}]]},"Get Profile Posts":{"main":[[{"node":"Clean Posts Data","type":"main","index":0}]]},"Schedule Trigger1":{"main":[[{"node":"get invalid email rows","type":"main","index":0}]]},"Schedule Trigger2":{"main":[[{"node":"get_failed_profile_summary_rows","type":"main","index":0}]]},"Schedule Trigger3":{"main":[[{"node":"get_failed_posts_summary_rows1","type":"main","index":0}]]},"Clean Profile Data":{"main":[[{"node":"Stringify Profile Data1","type":"main","index":0}],[{"node":"update status to failed","type":"main","index":0}]]},"On form submission":{"main":[[{"node":"Generate Leads with Apollo.io1","type":"main","index":0}]]},"Posts AI Summarizer":{"main":[[{"node":"Update Posts Summary","type":"main","index":0}]]},"Stringify Posts Data":{"main":[[{"node":"Posts AI Summarizer","type":"main","index":0}]]},"AI Profile Summarizer":{"main":[[{"node":"Update Profile Summary","type":"main","index":0}]]},"Google Sheets Trigger":{"main":[[{"node":"Get Pending Username Row","type":"main","index":0}]]},"Confirm Email Validity":{"main":[[{"node":"If","type":"main","index":0}]]},"Google Sheets Trigger2":{"main":[[{"node":"Get Pending Email Statuses","type":"main","index":0}]]},"Google Sheets Trigger3":{"main":[[{"node":"Get Pending About and Posts Rows","type":"main","index":0}]]},"Google Sheets Trigger4":{"main":[[{"node":"Get Pending About and Posts Rows1","type":"main","index":0}]]},"Google Sheets Trigger5":{"main":[[{"node":"Get Completely Enriched Profiles","type":"main","index":0}]]},"get invalid email rows":{"main":[[{"node":"update_to_pending","type":"main","index":0}]]},"Get Email from Apollo11":{"main":[[{"node":"Confirm Email Validity","type":"main","index":0}]]},"Stringify Profile Data1":{"main":[[{"node":"AI Profile Summarizer","type":"main","index":0}]]},"Get Pending Username Row":{"main":[[{"node":"OpenAI1","type":"main","index":0}]]},"Get Pending Email Statuses":{"main":[[{"node":"Get Email from Apollo11","type":"main","index":0}]]},"Generate Leads with Apollo.io1":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"get_failed_posts_summary_rows1":{"main":[[{"node":"update_to_unscraped","type":"main","index":0}]]},"get_failed_profile_summary_rows":{"main":[[{"node":"update_to_pending1","type":"main","index":0}]]},"Get Completely Enriched Profiles":{"main":[[{"node":"Append to Enriched Leads Database","type":"main","index":0}]]},"Get Pending About and Posts Rows":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Get Pending About and Posts Rows1":{"main":[[{"node":"Limit1","type":"main","index":0}]]}}}


name: AI Email Organizer for GMail - Advanced Email Management & Sorting
author_name: Milan Vasarhelyi - SmoothWork
author_username: vasarmilan
categories: []
created_at: 2025-06-05T11:49:49.978Z
updated_at: 2025-06-05T11:49:49.978Z
url: https://n8n.io/workflows/4687
scraped_at: 2025-07-06 21:16:30
description:
  What the workflow does
  Organizes your emails into categories, based on your category definitions in a Google Sheets

  How to set up
  Find the detailed setup instructions on the note on the sticky notes within the workflow!

  To get a similar business tool tailored to your processes, book a call with us: Book a Call, or write to me at: hello@smoothwork.ai

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.gmail","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenRouter"]

workflow_json:
  {"meta":{"instanceId":"c8c9ba5d3eb26ae47a06d24ff164a01c0d73ed4753a74903c2bb609d434a0f6b","templateCredsSetupCompleted":true},"nodes":[{"id":"fd08b5e1-f370-46b6-8088-c2e59c73d71c","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[0,0],"parameters":{"rule":{"interval":[{"field":"hours"}]}},"typeVersion":1.2},{"id":"78f01440-ef12-4ee6-a9a5-af4d39104c0c","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-520,-140],"parameters":{"width":420,"content":"## 1 - Config\n\n1) [G Sheets to Duplicate](https://docs.google.com/spreadsheets/d/1LKIx1Z3dCSX1uzyZH9s2HE0QRMvLTDI6sJApFU5LTj0/edit?gid=0#gid=0)\n2) Copy the URL of your Sheets in *Config* node ➡️➡️"},"typeVersion":1},{"id":"58417d60-eaaf-4d3f-affb-3a1655d2777b","name":"Config","type":"n8n-nodes-base.set","position":[220,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"cf1d4687-98df-4f65-b72e-6722075ab703","name":"sheets_url","type":"string","value":"https://docs.google.com/spreadsheets/d/1LKIx1Z3dCSX1uzyZH9s2HE0QRMvLTDI6sJApFU5LTj0/edit?gid=0#gid=0"},{"id":"5df50301-a77a-483f-80ce-7717daa04231","name":"extra_filter","type":"string","value":""},{"id":"4fc76947-79c9-4f73-bf36-c18e664b14b4","name":"limit","type":"number","value":2}]}},"typeVersion":3.4},{"id":"8f8812bc-dc04-4405-8d33-e6d457e2d1e8","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[880,0],"parameters":{"text":"=Email subject:\n\n{{ $json.headers.subject }}\n\n\nText: {{ $json.text }}\n\nChoose the best fitting of the category names below, based on their definition:\n{{ JSON.stringify($('Get Labels').all()) }}\n\nImportant: ONLY respond with the category Name. EXACTLY one of the names, do not add any other texts.\n\nSo response should be one of:\n{{ $('Get Labels').all().map(({ json: { Name } }) => Name ).join('\\n') }}","options":{},"promptType":"define"},"typeVersion":1.8},{"id":"e1bf4a15-a2b5-48a4-83d4-af649f20101f","name":"OpenRouter Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenRouter","position":[900,220],"parameters":{"model":"deepseek/deepseek-r1:free","options":{}},"credentials":{"openRouterApi":{"id":"iZmDjXmiYrP8nGux","name":"OpenRouter account"}},"typeVersion":1},{"id":"5c597cd5-69f0-42ac-a158-a5ef766157b0","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-520,20],"parameters":{"width":420,"height":400,"content":"## 2 - Connect AI (Optional: find free model)\n\n1) Get OpenRouter API Key: https://openrouter.ai/settings/keys\n\n2) [List of currently free models](https://openrouter.ai/models?max_price=0&order=top-weekly)\n[List of Popular models](https://openrouter.ai/models?order=top-weekly)\n\nBest in 2025 May: deepseek/deepseek-chat-v3-0324:free\nPaid recommended: gpt-4.1-mini\n\n3) Go to **OpenRouter Chat Model** Node\n+ \"Add Credential\" - Enter API Key\n+ Choose your preferred AI model"},"typeVersion":1},{"id":"8ec93dff-52a4-410e-b45f-f492bcc0bb88","name":"Get Labels","type":"n8n-nodes-base.googleSheets","position":[440,0],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"url","value":"={{ $json.sheets_url }}"},"documentId":{"__rl":true,"mode":"url","value":"={{ $json.sheets_url }}"}},"credentials":{"googleSheetsOAuth2Api":{"id":"gbEbCNKqCMSRZPql","name":"Google Sheets account 3"}},"typeVersion":4.5},{"id":"221de31a-e662-402d-8795-1bcd40757855","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-520,-220],"parameters":{"height":80,"content":"# Setup"},"typeVersion":1},{"id":"e41fb3ca-5de0-4a1a-a0f7-4f6fddc739ed","name":"Create Label if Doesn't exist","type":"n8n-nodes-base.gmail","onError":"continueRegularOutput","position":[1620,280],"webhookId":"9482c1cf-26bd-42a6-98cd-78c34810597d","parameters":{"name":"={{ $json.output }}","options":{},"resource":"label","operation":"create"},"credentials":{"gmailOAuth2":{"id":"duhSaIumY2CifCex","name":"Gmail account"}},"typeVersion":2.1},{"id":"fea8a543-0bb4-460e-9862-06c711ec30e6","name":"Get Existing Labels","type":"n8n-nodes-base.gmail","position":[1820,280],"webhookId":"bb39b430-d756-4a9f-8bfb-9d1a63c495c4","parameters":{"resource":"label","returnAll":true},"credentials":{"gmailOAuth2":{"id":"duhSaIumY2CifCex","name":"Gmail account"}},"typeVersion":2.1},{"id":"a45806ca-6b98-411a-a8b2-a8b9f071d6c0","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","position":[1460,0],"parameters":{"options":{}},"typeVersion":3},{"id":"de31842d-88de-4281-a8f7-5e88db026ece","name":"Filter","type":"n8n-nodes-base.filter","position":[2020,280],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e36a5069-09dd-424d-a2b8-096cefa059d7","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.name }}","rightValue":"={{ $('Loop Over Items').item.json.output }}"}]}},"typeVersion":2.2},{"id":"fe0c9d60-bd76-4a72-adb4-0b04bcd971bc","name":"Gmail1","type":"n8n-nodes-base.gmail","position":[2200,280],"webhookId":"332f57fb-6795-4a88-aff7-25d3838ffea7","parameters":{"labelIds":"={{ $json.id }}","resource":"thread","threadId":"={{ $('Loop Over Items').item.json.threadId }}","operation":"addLabels"},"credentials":{"gmailOAuth2":{"id":"duhSaIumY2CifCex","name":"Gmail account"}},"typeVersion":2.1},{"id":"3f3c2627-c20d-443f-8a6f-c803139c4143","name":"Fields For Loop","type":"n8n-nodes-base.set","position":[1240,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"cf0978da-37a2-48e8-8da9-8ec110638a42","name":"threadId","type":"string","value":"={{ $('Get Messages').item.json.threadId }}"},{"id":"71cac306-cca3-4e28-8bba-d920d83037ac","name":"output","type":"string","value":"={{ $json.output }}"}]}},"typeVersion":3.4},{"id":"10ede08e-bdbc-4c3f-8c25-2724bfbda6f5","name":"Get Messages","type":"n8n-nodes-base.gmail","position":[660,0],"webhookId":"5d1e7386-2e1c-4743-b03a-daffea28b66b","parameters":{"limit":"={{ $('Config').item.json.limit }}","simple":false,"filters":{"q":"=has:nouserlabels {{ $('Config').item.json.extra_filter }}"},"options":{},"operation":"getAll"},"credentials":{"gmailOAuth2":{"id":"duhSaIumY2CifCex","name":"Gmail account"}},"executeOnce":true,"typeVersion":2.1},{"id":"f15bda54-5a37-49e1-b06c-322308689c6e","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[220,160],"parameters":{"width":310,"content":"👆⬆️\n1 - sheets_url - Where the category definitions live\n2 - extra_filter - Leave empty to process all emails. Use any gmail search filters.\n3 - limit - max no. of emails to process in a run"},"typeVersion":1},{"id":"d34f5149-6749-4064-bfcf-6fc32651e945","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-280,-540],"parameters":{"color":5,"width":580,"height":400,"content":"# About the Author\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n## Milan - SmoothWork.ai\n\nWe help businesses eliminate busywork by building compact business tools tailored to your process.\n\n▶️ [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n📞 [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n"},"typeVersion":1}],"connections":{"Config":{"main":[[{"node":"Get Labels","type":"main","index":0}]]},"Filter":{"main":[[{"node":"Gmail1","type":"main","index":0}]]},"Gmail1":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Fields For Loop","type":"main","index":0}]]},"Get Labels":{"main":[[{"node":"Get Messages","type":"main","index":0}]]},"Get Messages":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Fields For Loop":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"Create Label if Doesn't exist","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Config","type":"main","index":0}]]},"Get Existing Labels":{"main":[[{"node":"Filter","type":"main","index":0}]]},"OpenRouter Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Create Label if Doesn't exist":{"main":[[{"node":"Get Existing Labels","type":"main","index":0}]]}}}


name: Zendesk: Visual Summarization, Sentiment Analysis, and Slack Integration
author_name: InfraNodus
author_username: infranodus
categories: []
created_at: 2025-06-05T13:01:17.102Z
updated_at: 2025-06-05T13:01:17.102Z
url: https://n8n.io/workflows/4688
scraped_at: 2025-07-06 21:16:30
description:
  Analyze and Explore your ZenDesk Support Requests using AI-Powered Knowledge Graph

  This template helps you create an interactive InfraNodus knowledge graph for your ZenDesk tickets using any search criteria (e.g. after a certain date, specific status, sender, keyword) that will automatically be sent to a selected Slack channel.

  Here's an example of the InfraNodus graph that shows the main topics and gaps in ZenDesk support tickets: 

  You can use the workflow to:

  Get an instant overview of the main topics your customers are talking about
  Generate business and product ideas based on the blind spots identified using the InfraNodus AI
  See which topics correlate to the negative / positive sentiment understanding the weak and strong sides of your product and support 
  Receive daily notifications on the main topics your customers are talking about via Slack / Telegram / Email and other channels
  Perform detailed search using a password-protected web form for tickets filtered by a certain date, status, tag, sender, keyword.
  Use the interactive graph to explore specific topics and concepts your customers are talking about — a great way to engage with their concerns in a non-linear way, bypassing the boring tabular interface
  Use the graph to explore the support requests by specific segments — e.g. status, priority, sentiment, tags, urgency.
  Use the graph generated as an AI expert available to your AI agents in other n8n workflows via InfraNodus GraphRAG. For instance, you could connect your knowledge base to the support tickets graph and let the agent discover possible solutions to your customers' most typical problems. See an sample template here.

  How it works
  You can start this workflow 

  manually, 
  with a daily / weekly trigger, or 
  via a password-protected web form, where you can provide search requests. 

  Once started, it will perform a ZenDesk tickets search with the default or your custom criteria. Then it will use the search results to generate an InfraNodus graph (or add the new data to an existing one), and — finally — use the InfraNodus AI endpoints to generate a topical summary and a product business idea based on the blind spots identified. The results are delivered a channel of your choice.

  Here's a description step by step:

  Start the workflow (manually or on schedule)
  Assign values to variables (search criteria, graph name)
  Perform ZenDesk support tickets search
  Convert the data received and submit it to InfraNodus to generate a knowledge graph
  Generate topical summary with InfraNodus
  Generate a business idea with InfraNodus (you can also change the setting to generate a question instead)
  Send a notification via Slack / Telegram / Email or back to the webform

  How to use

  You need an InfraNodus API account and key to use this workflow. You also need a ZenDesk account. It takes about 5 minutes to set everything up.

  Create an InfraNodus account.
  Get the API key at https://infranodus.com/api-access and create a Bearer authorization key for the InfraNodus HTTP nodes.
  Add the authorization key to all the InfraNodus HTTP nodes in the template (Steps 3, 5, and 6).
  Generate a ZenDesk authorization token following the instructions in n8n's ZenDesk node (Step 3).
  Optionally: connect your Slack or Telegram or Gmail account to receive automated notifications with the link to the graph, once the workflow is ready (it takes about 30 seconds to run).
  Run it with using the form to play around with the search criteria that works best for you (you can leave everything empty at first), then choose the parameters you like and activate the Daily Trigger node to receive executive summaries to a channel of your choice.
  Open the graph in InfraNodus and use our customer feedback analysis guide to explore the graph and generate new insights.

  Requirements

  An InfraNodus account and API key
  A ZenDesk API key
  (Optional) — a Slack / Telegram / Gmail connection for notifications

  FAQ

  1. What are the best use cases to try?

  I love to set the graph to deliver me a daily visual briefing of what's happening in my support portal. It shows me the main topics and gaps and generates product ideas based on them. Great to keep the pulse on the business. 

  I also really like generating a graph for the past week manually, using the form, and then exploring the graph in InfraNodus directly using the customer feedback analysis workflow to:

  discover main topics my customers are talking about?
  understand the topics that have the most negative connotation for them (using the sentiment filter)?
  discover some support tickets that need more attention or that talk about the topics I'm personally interested in and engage with the client
  identify the gaps in your customers' discourse based on the blind spots — useful for generating ideas, see the graph below with a demo of how it works:




  2. Why use the graph and not just AI summary?

  AI summary will just give you generic results. You'll see what you already know. Using the graph helps you deconstruct the discourse and get a much more nuanced understanding of the main pain points and interests of your customers. The auto-generated InfraNodus summary and business ideas have a direct explainable connection to the discourse, so you can always see where they are coming from and maintain the focus on all the topics, rather than the most prominent ones. 

  Additionally, having an interactive graph opens a possibility to explore your customers' concerns in a more engaging way, finding the topics and concepts that are relevant to your interests or to your agents' expertise, helping you find the conversations that you'd otherwise have missed.


  3. Is my customers' data safe?

  Absolutely. InfraNodus' terms of use and privacy policy state that the customers' data and text graphs are not used in AI training and are not offered to any third parties. Its underlying API system uses the Open API which explicitly states that data is not used for training either. So all the customers' data are private and safe. As an extra precaution, you can always delete the graphs after you analyzed them, in which case there is no trace of this data left on the servers.

  Customizing this workflow

  Check out the complete setup guide for this workflow at https://support.noduslabs.com/hc/en-us/articles/20447530961308-Zendesk-Tickets-Summarization-Sentiment-Analysis-and-Slack-Integration-with-n8n-and-InfraNodus

  For support with this template, please, contact 
  https://support.noduslabs.com

  For more InfraNodus n8n workflows, please, see our creators page:
  https://n8n.io/creators/infranodus/

  To learn more about InfraNodus, GraphRAG, and knowledge graph analysis:
  https://infranodus.com

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.slack","n8n-nodes-base.telegram","n8n-nodes-base.zendesk","n8n-nodes-base.gmail","n8n-nodes-base.code"]

workflow_json:
  {"id":"Ps6Vyn4fFbtSDAIa","meta":{"instanceId":"2a26454b0172ffcb8d70ba77c235b1209f92cd71bf06c79ba609c7173b416d68","templateCredsSetupCompleted":true},"name":"Summarize Zendesk Tickets and Generate Insights with Knowledge Graphs","tags":[{"id":"66wgFoDi9Xjl74M3","name":"Support","createdAt":"2025-05-21T17:06:32.355Z","updatedAt":"2025-05-21T17:06:32.355Z"},{"id":"9QurS5Kb1CkCYrnG","name":"Product","createdAt":"2025-05-21T17:06:29.704Z","updatedAt":"2025-05-21T17:06:29.704Z"},{"id":"Hd23erjIskV5mwPl","name":"Sales","createdAt":"2025-06-05T12:03:26.567Z","updatedAt":"2025-06-05T12:03:26.567Z"},{"id":"kldZpTCan1suEN8v","name":"Marketing","createdAt":"2025-05-20T13:16:20.459Z","updatedAt":"2025-05-20T13:16:20.459Z"},{"id":"sJk9cUvmMU8FkJXv","name":"AI","createdAt":"2025-05-20T13:16:15.636Z","updatedAt":"2025-05-20T13:16:15.636Z"}],"nodes":[{"id":"a90faec1-0007-4e18-b2cb-90c5ba40bc4c","name":"Zendesk","type":"n8n-nodes-base.zendesk","position":[500,120],"parameters":{"options":{"query":"=created>={{ $json.analyze_from_date }}{{$json.searh_query ? ` ${$json.searh_query}` : ``}}{{ $json.status ? ` status:${$json.status.toLowerCase()}` : `` }}"},"operation":"getAll"},"credentials":{"zendeskApi":{"id":"i5bOpw0SnJ616AzW","name":"Zendesk account"}},"typeVersion":1},{"id":"84bf6e0c-76a5-4b70-ae04-c3c684044be8","name":"InfraNodus Build a Text Knowledge Graph","type":"n8n-nodes-base.httpRequest","position":[1000,120],"parameters":{"url":"https://infranodus.com/api/v1/graphAndStatements?doNotSave=false&includeGraph=false&includeGraphSummary=true&includeStatements=false","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"name","value":"={{ $('Set Parameters').first().json.graph_name }}"},{"name":"statements","value":"={{ $json.statements }}"},{"name":"contextSettings","value":"={{{ \"partOfSpeechToProcess\":\"HASHTAGS_AND_WORDS\", \"doubleSquarebracketsProcessing\":\"EXCLUDE\", \"mentionsProcessing\":\"EXCLUDE\"} }}"},{"name":"categories","value":"={{ $json.categories }}"},{"name":"timestamps","value":"={{ $json.timestamps }}"}]},"genericAuthType":"httpBearerAuth"},"credentials":{"httpBearerAuth":{"id":"FPDx6PA5CtzGEIQc","name":"InfraNodus DeeMeeTree API Key"}},"typeVersion":4.2},{"id":"228b5644-60c1-438a-9568-9f616c44ac15","name":"Add meta data to tickets for graph filters","type":"n8n-nodes-base.code","position":[800,120],"parameters":{"jsCode":"\nlet statements = []\nlet categories = []\nlet timestamps = []\nfor (const item of $input.all()) {\n\n  const isChatMessage = item.json.description.includes('Offline transcript:') || false\n  \n  const fromSender = isChatMessage ? extractEmail(item.json.description) : item.json.via.source.from.address\n  const createdDate = item.json.created_at\n  const messageSubject = isChatMessage ? '' : item.json.subject + ' '\n  \n  const cleanMessageText = isChatMessage ? item.json.description.split('Offline transcript:')[1] : item.json.description\n  const messageText = messageSubject +\n  removeLineBreaks(removeHtmlCssScript(cleanMessageText))\n  \n  const messageUrl = item.json.url.split('/api/')[0] + '/agent/tickets/' + item.json.id\n  \n  const messageStatus = item.json.status\n  const messageType = item.json.type\n  const messagePriority = item.json.priority\n  const messageCategories = []\n  const messageTags = item.json.tags\n  if (messageStatus) messageCategories.push('status: ' + messageStatus)\n  if (messageType) messageCategories.push('type: ' + messageType)\n  if (messagePriority) messageCategories.push('priority: ' + messagePriority)\n  if (messageTags && messageTags.length > 0) messageTags.forEach(tag => messageCategories.push('tag: ' + tag))\n\n  statements.push('[[' + fromSender + ']] ' + messageText + ' ' + messageUrl)\n  categories.push(messageCategories)\n  timestamps.push(createdDate)\n}\n\nreturn { statements, categories, timestamps }\n\nfunction extractEmail(text) {\n  const match = text.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/);\n  const email = match ? match[0] : '';\n  return email\n}\nfunction removeLineBreaks(text) {\n  const cleanText = text.replaceAll('\\n', ' ')\n  return cleanText\n}\nfunction removeHtmlCssScript(text) {\n  if (!text || typeof text !== 'string') {\n    return '';\n  }\n  \n  let cleanText = text;\n  \n  // Remove script tags and their content (case insensitive)\n  cleanText = cleanText.replace(/<script[^>]*>[\\s\\S]*?<\\/script>/gi, '');\n  \n  // Remove style tags and their content (case insensitive)\n  cleanText = cleanText.replace(/<style[^>]*>[\\s\\S]*?<\\/style>/gi, '');\n  \n  // Remove HTML comments\n  cleanText = cleanText.replace(/<!--[\\s\\S]*?-->/g, '');\n  \n  // Remove all remaining HTML tags\n  cleanText = cleanText.replace(/<[^>]*>/g, '');\n  \n  // Decode common HTML entities\n  const htmlEntities = {\n    '&amp;': '&',\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&#39;': \"'\",\n    '&nbsp;': ' ',\n    '&copy;': '©',\n    '&reg;': '®',\n    '&trade;': '™'\n  };\n  \n  Object.keys(htmlEntities).forEach(entity => {\n    const regex = new RegExp(entity, 'g');\n    cleanText = cleanText.replace(regex, htmlEntities[entity]);\n  });\n  \n  // Clean up extra whitespace\n  cleanText = cleanText.replace(/\\s+/g, ' ').trim();\n  \n  return cleanText;\n}"},"typeVersion":2},{"id":"2354e6b3-a9de-47ba-a146-a3180126f59b","name":"Wait","type":"n8n-nodes-base.wait","position":[1280,120],"webhookId":"e9aad8e5-4d65-43b9-9af0-33e221c36e84","parameters":{"amount":10},"typeVersion":1.1},{"id":"6a070df2-3eb3-4686-ae03-e74b8a9530e5","name":"InfraNodus AI Summary & Graph Link","type":"n8n-nodes-base.httpRequest","position":[1480,120],"parameters":{"url":"https://infranodus.com/api/v1/graphAndAdvice?doNotSave=true&includeGraph=false&includeGraphSummary=true","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"aiTopics","value":"true"},{"name":"requestMode","value":"summary"},{"name":"name","value":"={{ $('Set Parameters').first().json.graph_name }}"}]},"genericAuthType":"httpBearerAuth"},"credentials":{"httpBearerAuth":{"id":"FPDx6PA5CtzGEIQc","name":"InfraNodus DeeMeeTree API Key"}},"retryOnFail":false,"typeVersion":4.2},{"id":"a66e966a-cfb6-41a7-901c-3df07392ad82","name":"Send Report to Telegram","type":"n8n-nodes-base.telegram","onError":"continueRegularOutput","position":[2460,580],"webhookId":"50dc4ad9-b803-4e13-8c5e-048f6f06ea47","parameters":{"text":"=💎 Visual **overview of your Zendesk tickets** is ready at [https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit](https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit)\n\n**💎 Topical summary:**\n{{ $('InfraNodus AI Summary & Graph Link').item.json.aiAdvice[0].text }}\n\n**💡 Idea to think about:**\n{{ $json.aiAdvice[0].text }}\n","chatId":"your_telegram_chat_id","additionalFields":{"appendAttribution":false}},"credentials":{"telegramApi":{"id":"jaBITBhfModUjHo9","name":"Telegram apartment notifications"}},"typeVersion":1.2},{"id":"8baa3b72-d15f-4757-bfd7-dfd73d573d89","name":"Send Full Report via Gmail","type":"n8n-nodes-base.gmail","onError":"continueRegularOutput","position":[2460,360],"webhookId":"18e8d5df-3ac6-45fb-ab41-d2e1e578fa51","parameters":{"sendTo":"your_own_email_12312dsadfas@gmail.com","message":"=Hello\n\nWe successfully analyzed your Zendesk tickets on {{ $('Set Parameters').first().json.lauch_time }}\n\n💎 Visual overview of your Zendesk tickets is ready at https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit\n\n📋 Search parameters:\nAnalyzing from date: {{ $('Set Parameters').first().json.analyze_from_date }}\nSearch query: {{ $('Set Parameters').first().json.search_query}} \nStatus: {{$('Set Parameters').first().json.status}}\n\n💎 Topical summary:\n{{ $('InfraNodus AI Summary & Graph Link').item.json.aiAdvice[0].text }}\n\n{{ $('InfraNodus AI Summary & Graph Link').item.json.graphSummary }}\n\n💡 Idea to think about:\n{{ $json.aiAdvice[0].text }}\n\nThank you, till next time!\n","options":{},"subject":"Zendesk Summary","emailType":"text"},"credentials":{"gmailOAuth2":{"id":"w7b4H8WpgY9Oit56","name":"Gmail supadelicious"}},"typeVersion":2.1},{"id":"56204c2b-f70b-436b-aa52-7bc7b0994822","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","disabled":true,"position":[-80,200],"parameters":{"rule":{"interval":[{"triggerAtHour":10}]}},"typeVersion":1.2},{"id":"5f6ab402-79f7-468e-a8f1-770322136cb4","name":"Slack","type":"n8n-nodes-base.slack","onError":"continueRegularOutput","position":[2460,120],"webhookId":"6d836f75-04ad-4430-9461-27845de8ab8e","parameters":{"text":"=Zendesk Support Overview ran on {{ $('Set Parameters').first().json.lauch_time }}\n\n📋 Search parameters:\nAnalyzing from date: {{ $('Set Parameters').first().json.analyze_from_date }}\nSearch query: {{ $('Set Parameters').first().json.search_query}} \nStatus: {{$('Set Parameters').first().json.status}}\n\n\n💎 Visual overview of your Zendesk tickets is ready at [https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit](https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit)\n\n💎 Topical summary:\n{{ $('InfraNodus AI Summary & Graph Link').item.json.aiAdvice[0].text }}\n\n{{ $('InfraNodus AI Summary & Graph Link').item.json.graphSummary }}\n\n💡 Idea to think about:\n{{ $json.aiAdvice[0].text }}\n\nThank you, till next time!\n","select":"channel","channelId":{"__rl":true,"mode":"list","value":"C0905QEULAG","cachedResultName":"customer-support"},"otherOptions":{"includeLinkToWorkflow":false},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"nFuZU4b0kZ0PiHXR","name":"Slack account"}},"typeVersion":2.3},{"id":"187c5d5f-a984-4784-9da2-ca7db7b899f8","name":"Set Parameters","type":"n8n-nodes-base.set","position":[220,120],"parameters":{"mode":"raw","options":{},"jsonOutput":"={\n  \"analyze_from_date\": \"{{ $json[\"Starting from Date\"] || $today.minus({days: 1}).toString()}}\",\n  \"search_query\": \"{{ $json[\"Search Query\"] || `` }}\",\n  \"status\": \"{{ $json['Ticket Status to Filter'] || `` }}\",\n  \"graph_name\": \"{{ $json[\"Graph Name\"] || ($json.submittedAt ? `zendesk_tickets_${$json.submittedAt.split('.')[0].replaceAll(':', '_')}` : `zendesk_tickets_${$json.timestamp.split('.')[0].replaceAll(':','_')}`) }}\",\n  \"launch_time\": \"{{ $json.submittedAt ? $json.submittedAt.split('.')[0] : $json.timestamp.split('.')[0] }}\"\n}\n"},"typeVersion":3.4},{"id":"3629d33e-5b56-4a9a-a32d-be1125b0a1b9","name":"Wait Again","type":"n8n-nodes-base.wait","position":[1920,120],"webhookId":"0e4e854f-bac4-4d6f-b036-e277b4eb68ef","parameters":{"amount":2},"typeVersion":1.1},{"id":"2998db19-1fb6-46d1-8fbb-59e87b3c81ff","name":"InfraNodus Insight Generator","type":"n8n-nodes-base.httpRequest","position":[2100,120],"parameters":{"url":"https://infranodus.com/api/v1/graphAndAdvice?doNotSave=true&optimize=gap&includeGraph=false&includeGraphSummary=true","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"aiTopics","value":"true"},{"name":"requestMode","value":"idea"},{"name":"name","value":"={{ $('Set Parameters').first().json.graph_name }}"}]},"genericAuthType":"httpBearerAuth"},"credentials":{"httpBearerAuth":{"id":"FPDx6PA5CtzGEIQc","name":"InfraNodus DeeMeeTree API Key"}},"typeVersion":4.2},{"id":"2f06e74a-dcb1-4228-8a5e-688b1fbedbb6","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[-80,40],"webhookId":"34bdb9d4-1b26-4810-bab6-33427bec0331","parameters":{"options":{"appendAttribution":false,"respondWithOptions":{"values":{"formSubmittedText":"You will receive a notification via the channel of your choice once this workflow completes."}}},"formTitle":"Visual Summary of Zendesk Tickets","formFields":{"values":[{"fieldType":"date","fieldLabel":"Starting from Date"},{"fieldLabel":"Search Query"},{"fieldType":"dropdown","fieldLabel":"Ticket Status to Filter","fieldOptions":{"values":[{"option":"Open"},{"option":"Closed"},{"option":"Pending"},{"option":"New"},{"option":"On Hold"}]}},{"fieldLabel":"Graph Name","placeholder":"e.g. zendesk_tickets_search"}]},"authentication":"basicAuth","formDescription":"Create a knowledge graph from your Zendesk tickets and send a notification via Slack with the insights."},"credentials":{"httpBasicAuth":{"id":"dnRnDRFSRoubvTh8","name":"Basic n8n Form Auth"}},"typeVersion":2.2},{"id":"dba86f3f-6f65-4339-b720-26da46c62a0b","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[160,-280],"parameters":{"height":660,"content":"## 2. Set Parameters\n\n### Set ticket search parameters and graph name to save to. \n\nFor Zendesk search parameters, please, refer to their [search parameters support page](https://developer.zendesk.com/documentation/api-basics/working-with-data/searching-with-the-zendesk-YOUR_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE/)\n\nYou can also set search parameters directly in the Zendesk node in the Step 3."},"typeVersion":1},{"id":"513993e9-a258-4b45-a4b8-6691779689ab","name":"Form Response","type":"n8n-nodes-base.form","onError":"continueRegularOutput","position":[2460,780],"webhookId":"e4c7f004-04c7-45f4-ba09-2bac2967093f","parameters":{"options":{"formTitle":"Zendesk Analysis Results"},"operation":"completion","completionTitle":"The workflow is complete","completionMessage":"=Visual overview of your Zendesk tickets is delivered to your channels of choice and is ready at https://infranodus.com/Deemeetree/{{ $('Set Parameters').first().json.graph_name }}/edit"},"typeVersion":1},{"id":"5e7c5976-c1bb-414a-a4bc-ec6776ebe9e2","name":"If","type":"n8n-nodes-base.if","position":[1660,200],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"cb0387d5-e633-4885-a91b-cf9cb889e7f9","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.error }}","rightValue":""}]}},"typeVersion":2.2},{"id":"2a2134ba-3d8c-4d79-bf90-affa433bd17c","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-140,-280],"parameters":{"height":660,"content":"## 1. Set a Trigger\n\n### Start with the search form first or set up a scheduled daily or weekly trigger.\n\nYou can leave all the fields empty. Once you find the search parameters you like, you can specify them in the Step 2 and have an automated trigger run the workflow for you. "},"typeVersion":1},{"id":"13976533-6e27-48c1-81dd-73c9a65f724f","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[440,-280],"parameters":{"height":660,"content":"## 3. Get ZenDesk Tickets\n\n### We use search criteria defined in the Step 2. You can also set your own in this node directly. \n\n🚨 Set up your ZenDesk connection here. \n\n"},"typeVersion":1},{"id":"56bf6145-fc79-4c12-a505-fc0be369997f","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[720,-280],"parameters":{"width":480,"height":660,"content":"## 4. Process Tickets and Generate an [InfraNodus](https://infranodus.com) Knowledge Graph\n\n### You will get a link to an interactive graph at [InfraNodus](https://infranodus.com) where you can see the main topics and concepts and sort your tickets by \n\n- ticket status\n- priority\n- tag\n- urgency\n- sentiment\n\n\n🚨 Set up your InfraNodus API connection here.\n\n"},"typeVersion":1},{"id":"97ff4272-6b64-44a7-aef6-280c98b0d894","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1240,-280],"parameters":{"width":600,"height":660,"content":"## 5. Generate Topical Summary\n\n### Using the [InfraNodus AI text analysis](https://infranodus.com) we generate a topical summary of the tickets you searched for. You will discover:\n\n- the main topics (good for an overview)\n- main keywords (userful for SEO)\n- content gaps (good for product ideas)\n\n\n🚨 Set up your InfraNodus API connection here.\n\n"},"typeVersion":1},{"id":"42300a56-8816-4274-a6ba-703a2ddce1e4","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1880,-280],"parameters":{"width":380,"height":660,"content":"## 6. Generate a Business Idea\n\n### Using the [InfraNodus AI](https://infranodus.com) we generate a business idea based on the gap found in your Zendesk tickets\n\n*You can also change the `requestMode` to `question` to generate an interesting question instead. For more parameters, refer to the [InfraNodus API documentation](https://support.noduslabs.com/hc/en-us/sections/13605105764124-InfraNodus-API).*\n\n\n🚨 Set up your InfraNodus API connection here.\n\n"},"typeVersion":1},{"id":"deee904a-832f-4e73-8851-89d75c07458e","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[2320,-280],"parameters":{"width":380,"height":1260,"content":"## 7. Notify of Results via Slack / Email / Telegram / Form\n\n### Receive a summary with the link to the interactive graph to a channel of your choice, once the workflow is ready.\n\nYou can deactivate the channels you don't want to use. We provide multiple channels, so you have an option. \n\n🚨 Set up your API connections here.\n\n"},"typeVersion":1},{"id":"e69ffee3-5d11-4a6c-afe9-93b3187016e6","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-140,-1080],"parameters":{"color":6,"width":760,"height":760,"content":"# Generate Visual Topical Summary and Business Ideas from ZenDesk Tickets\n\n### Using this workflow, you can generate an [InfraNodus knowledge graph](https://infranodus.com) based on your ZenDesk tickets (using any search criteria) to:\n\n- Learn what your customers are talking about (main topical clusters)\n- Discover the topics and concepts they mention with a negative / positive sentiment\n- Find the support requests for a certain topic\n- Explore the requests in a non-linear way, based on the agent's expertise\n- Identify the content gaps, generate business ideas based on them\n\n\nFor support, please, contact us at [https://support.noduslabs.com](https://support.noduslabs.com)\n\nAn example of the graph that shows the main topics:\n[![Zendesk knowledge graph made with InfraNodus](https://support.noduslabs.com/hc/article_attachments/20447708129820)](https://infranodus.com)"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"40b28280-3224-450f-a045-9609c06ee1be","connections":{"If":{"main":[[{"node":"InfraNodus AI Summary & Graph Link","type":"main","index":0}],[{"node":"Wait Again","type":"main","index":0}]]},"Wait":{"main":[[{"node":"InfraNodus AI Summary & Graph Link","type":"main","index":0}]]},"Zendesk":{"main":[[{"node":"Add meta data to tickets for graph filters","type":"main","index":0}]]},"Wait Again":{"main":[[{"node":"InfraNodus Insight Generator","type":"main","index":0}]]},"Set Parameters":{"main":[[{"node":"Zendesk","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Set Parameters","type":"main","index":0}]]},"On form submission":{"main":[[{"node":"Set Parameters","type":"main","index":0}]]},"InfraNodus Insight Generator":{"main":[[{"node":"Send Report to Telegram","type":"main","index":0},{"node":"Send Full Report via Gmail","type":"main","index":0},{"node":"Slack","type":"main","index":0},{"node":"Form Response","type":"main","index":0}]]},"InfraNodus AI Summary & Graph Link":{"main":[[{"node":"If","type":"main","index":0}]]},"InfraNodus Build a Text Knowledge Graph":{"main":[[{"node":"Wait","type":"main","index":0}]]},"Add meta data to tickets for graph filters":{"main":[[{"node":"InfraNodus Build a Text Knowledge Graph","type":"main","index":0}]]}}}


name: Build a Chatbot with Reinforced Learning Human Feedback (RLHF) and RAG
author_name: NovaNode
author_username: thomasgpt
categories: []
created_at: 2025-06-05T13:39:18.776Z
updated_at: 2025-06-05T13:39:18.776Z
url: https://n8n.io/workflows/4689
scraped_at: 2025-07-06 21:16:30
description:
  Who is this for?
  This template is designed for internal support teams, product specialists, and knowledge managers who want to build an AI-powered knowledge assistant with retrieval-augmented generation (RAG) and reinforcement learning from human feedback (RLHF) via Telegram.

  What problem is this workflow solving?
  Manual knowledge management and answering support queries can be time-consuming and error-prone. This solution automates importing and indexing official documentation into MongoDB vector search and enhances AI responses with Telegram-based user feedback to continuously improve answer quality.

  What these workflows do
  Workflow 1: Document ingestion & indexing
  Manually triggered workflow imports product documentation from Google Docs.
  Documents are split into manageable chunks and embedded using OpenAI embeddings.
  Embedded document chunks are stored in MongoDB Atlas vector store to enable semantic search.

  Workflow 2: Telegram chat with RLHF feedback loop
  Listens for user messages via Telegram bot integration.
  Uses vector similarity search on MongoDB to retrieve relevant documentation chunks.
  Generates answers with OpenAI GPT-4o-mini model using retrieval-augmented generation.
  Sends answers back via Telegram and waits for user feedback (approval or disapproval).
  Captures feedback, maps it as positive or negative, and stores it with the conversation data for future model improvement.

  Setup
  Setting up vector embeddings
  Authenticate Google Docs and connect your Google Docs URL containing the product documentation you want to index.
  Authenticate MongoDB Atlas and connect the collection where you want to store the vector embeddings. Create a search index on this collection to support vector similarity queries. 
  Ensure the index name matches the one configured in n8n (data_index). 
  See the example MongoDB search index template below for reference.

  Setting up chat with Telegram RLHF
  Create a bot in Telegram with @botFather using the /newbot command.
  Connect the MongoDB database and search index used for vector search in the previous workflow. Also create two new collections in MongoDB Atlas: one for feedback and one for chat history. Create a search index for feedback, copying the provided template.
  Configure the AI system prompt in the “Knowledge Base Agent” node, making sure it references all three tools connected (productDocs, feedbackPositive, feedbackNegative) as provided in the template prompt.
  Make sure
  Product documentation and feedback collections must connect to the same MongoDB database.
  There are three distinct MongoDB collections: one for product documentation, one for feedback, and one for chat history (chat history collection can be separate).
  Telegram API credentials are valid and webhook URLs are correctly set up.

  MongoDB Search Index Templates
  Documentation Collection Index

  {
    "mappings": {
      "dynamic": false,
      "fields": {
        "_id": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "embedding": {
          "type": "knnVector",
          "dimensions": 1536,
          "similarity": "cosine"
        },
        "source": {
          "type": "string"
        },
        "doc_id": {
          "type": "string"
        }
      }
    }
  }

  Feedback Collection Index

  {
    "mappings": {
      "dynamic": false,
      "fields": {
        "prompt": {
          "type": "string"
        },
        "response": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "embedding": {
          "type": "knnVector",
          "dimensions": 1536,
          "similarity": "cosine"
        },
        "feedback": {
          "type": "token"
        }
      }
    }
  }

nodes_used:
  ["n8n-nodes-base.telegram","n8n-nodes-base.googleDocs","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.embeddingsOpenAi","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","@n8n/n8n-nodes-langchain.documentDefaultDataLoader","@n8n/n8n-nodes-langchain.memoryMongoDbChat","@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas"]

workflow_json:
  {"meta":{"instanceId":"074f90e2bb5206c5f405a8aac6551497c72005283a5405fb08207b1b3a78c2b8","templateCredsSetupCompleted":true},"nodes":[{"id":"e39a0b25-53ce-4ac0-9c93-7750b8e6105b","name":"Knowledge Base Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[220,0],"parameters":{"text":"={{ $json.message.text }}","options":{"systemMessage":"You are the AI assistant for a company specializing in advanced technology solutions. Your task is to help internal users by consulting the official product documentation for the company’s platforms.\n\nAvailable References:\n\nproductDocs: Step-by-step guides, technical configurations, and official manuals from the developer documentation.\n\nfeedbackPositive: Previous responses rated positively by users, useful as examples for generating high-quality answers.\n\nfeedbackNegative: Previous responses rated negatively by users. Use this tool to avoid making similar mistakes in your replies.\n\nCurrently, there are no use cases or update history documented in the available materials.\n\nBehavior Rules\n\nSearch & Response:\n\nAlways consult the official documentation first using the productDocs tool.\n\nAlso search feedbackPositive for highly rated previous responses to similar questions.\n\nCheck feedbackNegative to see if similar answers were poorly rated, and avoid repeating those mistakes.\n\nIf multiple tools return relevant results, combine the information to provide the best answer. If only one tool returns relevant content, use that as your source.\n\nRespond directly and clearly, explaining exactly how to perform the requested task.\n\nDo not filter by category unless the user explicitly asks.\n\nLanguage (Strict Per-Message Rule):\n\nDetect the language of each incoming message individually.\n\nRespond in the same language as the most recent message.\n\nDo not use the language of previous messages or conversation history to decide the language.\n\nLinks (Not Allowed):\n\nNever provide links, even if the user requests them.\n\nIf a user asks for a link, respond with:\n“I cannot provide links. If you need specific information, let me know and I will help with the details.”\n\nResponse Style:\n\nUse a professional, direct, and human tone.\n\nKeep responses between 2 and 4 lines unless the user asks for more detail.\n\nDo not make up information that isn’t in MongoDB.\n\nIf your answer contains numbered steps or lists, always number them sequentially (1, 2, 3...) without skipping or repeating numbers, even if the original content uses a different numbering style."},"promptType":"define"},"typeVersion":1.9},{"id":"775b7991-88f3-4959-a068-3fb2b667567e","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[200,180],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"4c2e0ea6-f5d0-4d5b-a065-606b2dc2cff5","name":"Embeddings OpenAI","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[440,460],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"2f813af6-3432-4201-93d0-ff503013642e","name":"Document Section Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","position":[580,-340],"parameters":{"options":{"metadata":{"metadataValues":[{"name":"doc_id","value":"={{ $json.documentId }}"}]}},"jsonData":"={{ $json.content }}","jsonMode":"expressionData"},"typeVersion":1},{"id":"c6386d7b-f3cb-4884-9477-a69e9743e6c6","name":"Document Chunker","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","position":[560,-220],"parameters":{"options":{"splitCode":"markdown"},"chunkSize":3000,"chunkOverlap":200},"typeVersion":1},{"id":"4ff1a843-5e1c-4a23-bdf3-2fdc91ba7032","name":"OpenAI Embeddings Generator","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[440,-340],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"64624ed6-cbb2-43c1-b348-df92f26d8efe","name":"Google Docs Importer","type":"n8n-nodes-base.googleDocs","position":[220,-520],"parameters":{"operation":"get","documentURL":"https://docs.google.com/document/d/1gvgp71e9edob8WLqFIYCdzC7kUq3pLO37VKb-a-vVW4/edit?tab=t.0"},"credentials":{"googleDocsOAuth2Api":{"id":"FNXMwqMf7vl1WUFj","name":"Google Docs account"}},"typeVersion":2},{"id":"09c262ab-ba89-429c-b8a8-41c3ae79d97c","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-420,-500],"parameters":{"color":5,"content":"Run this workflow manually to import and index Google Docs product documentation into MongoDB with vector embeddings for fast search."},"typeVersion":1},{"id":"f309ff4a-194f-413a-b8f5-d8210cb5e0c6","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-420,40],"parameters":{"color":4,"height":180,"content":"This workflow uses retrieval-augmented generation (RAG) to answer user questions by searching the MongoDB vector store and generating AI responses enhanced with Telegram-based RLHF feedback."},"typeVersion":1},{"id":"caf481b3-7a19-40df-b5fb-52e74a8edd73","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1800,-480],"parameters":{"width":520,"height":1040,"content":"Documentation Search Index\n\n{\n  \"mappings\": {\n    \"dynamic\": false,\n    \"fields\": {\n      \"_id\": {\n        \"type\": \"string\"\n      },\n      \"text\": {\n        \"type\": \"string\"\n      },\n      \"embedding\": {\n        \"type\": \"knnVector\",\n        \"dimensions\": 1536,\n        \"similarity\": \"cosine\"\n      },\n      \"source\": {\n        \"type\": \"string\"\n      },\n      \"doc_id\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n}\n\n\nFeedback Search Index\n\n{\n  \"mappings\": {\n    \"dynamic\": false,\n    \"fields\": {\n      \"prompt\": {\n        \"type\": \"string\"\n      },\n      \"response\": {\n        \"type\": \"string\"\n      },\n      \"text\": {\n        \"type\": \"string\"\n      },\n      \"embedding\": {\n        \"type\": \"knnVector\",\n        \"dimensions\": 1536,\n        \"similarity\": \"cosine\"\n      },\n      \"feedback\": {\n        \"type\": \"token\"\n      }\n    }\n  }\n}\n"},"typeVersion":1},{"id":"8a3abf9e-6f3f-47cf-b9ec-bb9da9835e5c","name":"When clicking \"Execute Workflow\"","type":"n8n-nodes-base.manualTrigger","position":[0,-520],"parameters":{},"typeVersion":1},{"id":"4235ba8c-d671-40b8-b3a4-d7cccac36d54","name":"MongoDB Chat Memory","type":"@n8n/n8n-nodes-langchain.memoryMongoDbChat","position":[320,180],"parameters":{"sessionKey":"={{ $('Receive Message on Telegram').item.json.message.chat.id }}","sessionIdType":"customKey","collectionName":"n8n-template-chat-history"},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1},{"id":"000e272a-3f19-4c17-86b5-07505eba2c3b","name":"Embeddings OpenAI1","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[160,440],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"dca02c04-2921-4982-83a3-6b2f6fb32663","name":"Default Data Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","position":[1400,180],"parameters":{"options":{"metadata":{"metadataValues":[{"name":"prompt","value":"={{ $json.prompt }}"},{"name":"response","value":"={{ $json.response }}"},{"name":"feedback","value":"={{ $json.feedback }}"}]}},"jsonData":"={{ $json.text }}","jsonMode":"expressionData"},"typeVersion":1},{"id":"757073e3-f8b5-42b5-ab02-d310d5f6e8a4","name":"Recursive Character Text Splitter","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","position":[1380,300],"parameters":{"options":{},"chunkSize":4000},"typeVersion":1},{"id":"588ef94b-9723-440a-ac13-d97d744ae26d","name":"Embeddings OpenAI3","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[320,720],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"355654d8-95e2-4337-9b1f-af2a08573f08","name":"Search Positive Interactions","type":"@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas","position":[160,320],"parameters":{"mode":"retrieve-as-tool","options":{"metadata":{"metadataValues":[{"name":"feedback","value":"positive"}]}},"toolName":"feedbackPositive","mongoCollection":{"__rl":true,"mode":"list","value":"n8n-template-feedback","cachedResultName":"n8n-template-feedback"},"toolDescription":"Retrieve previous examples of similar questions that were rated positively by users. Use this tool before responding to improve your answer based on those approved examples.","vectorIndexName":"template-feedback-search"},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1.1},{"id":"84a95dfb-6cc4-4a18-be40-6fa201073750","name":"Search Documentation","type":"@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas","position":[440,320],"parameters":{"mode":"retrieve-as-tool","options":{},"toolName":"productDocs","mongoCollection":{"__rl":true,"mode":"list","value":"n8n-template","cachedResultName":"n8n-template"},"toolDescription":"retreive documentation","vectorIndexName":"data_index"},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1.1},{"id":"f2001c81-081b-4417-8349-3db459c0f191","name":"Search Negative Interactions","type":"@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas","position":[240,580],"parameters":{"mode":"retrieve-as-tool","options":{"metadata":{"metadataValues":[{"name":"feedback","value":"negative"}]}},"toolName":"feedbackNegative","mongoCollection":{"__rl":true,"mode":"list","value":"n8n-template-feedback","cachedResultName":"n8n-template-feedback"},"toolDescription":"Retrieve previous examples of similar questions that were rated negatively by users. Use this tool before responding to avoid generating answers similar to those that did not work well in the past.","vectorIndexName":"template-feedback-search"},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1.1},{"id":"1a0de194-3508-4d21-b1a2-35c3b4a998c1","name":"Receive Message on Telegram","type":"n8n-nodes-base.telegramTrigger","position":[0,0],"webhookId":"fff1b90c-59ce-406b-a7f0-08953c90c0ce","parameters":{"updates":["message"],"additionalFields":{}},"credentials":{"telegramApi":{"id":"wb9guorEXe6W5V8C","name":"Telegram account"}},"typeVersion":1.2},{"id":"92458560-feb5-40df-b52a-ec1c5156829d","name":"Send Message on Telegram, Wait for Feedback","type":"n8n-nodes-base.telegram","position":[600,0],"webhookId":"ed8fc221-70ad-47df-b70e-6667c580553b","parameters":{"chatId":"={{ $('Receive Message on Telegram').item.json.message.chat.id }}","message":"={{ $json.output }}","options":{"appendAttribution":false},"operation":"sendAndWait","approvalOptions":{"values":{"approvalType":"double"}}},"credentials":{"telegramApi":{"id":"wb9guorEXe6W5V8C","name":"Telegram account"}},"typeVersion":1.2},{"id":"ef40200d-5f19-4199-8ae3-9f2e0f52ac1b","name":"Map feedback data","type":"n8n-nodes-base.code","position":[820,0],"parameters":{"jsCode":"let response;\n\nif ($input.first().json.data.approved) {\n  response = \"positive\"\n} \nelse {\n  response = \"negative\"\n}\n\nreturn {\n  feedback: response\n}\n"},"typeVersion":2},{"id":"d688073c-9a97-4b39-9640-c368cccf3491","name":"Set feedback fields for collection storage","type":"n8n-nodes-base.set","position":[1040,0],"parameters":{"values":{"string":[{"name":"prompt","value":"={{ $('Receive Message on Telegram').item.json.message.text }}"},{"name":"response","value":"={{ $('Knowledge Base Agent').item.json.output }}"},{"name":"text","value":"=Prompt: {{ $('Receive Message on Telegram').item.json.message.text }}. Completion: {{ $('Knowledge Base Agent').item.json.output }}"},{"name":"feedback","value":"={{ $json.feedback }}"}]},"options":{},"keepOnlySet":true},"typeVersion":1},{"id":"9907480f-3e5d-4240-adbb-790be2d68496","name":"Submit embedded chat feedback","type":"@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas","position":[1260,0],"parameters":{"mode":"insert","options":{},"mongoCollection":{"__rl":true,"mode":"list","value":"n8n-template-feedback","cachedResultName":"n8n-template-feedback"},"vectorIndexName":"template-feedback-search","embeddingBatchSize":1},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1.1},{"id":"1a470ad3-845a-4890-b103-65a21b1940de","name":"OpenAI Embeddings Generator1","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[1260,180],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"cJRah9hGPQ7eX4jd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"fdc22256-f014-4ed0-8781-1abb20134b1a","name":"MongoDB Documentation Inserter","type":"@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas","position":[440,-520],"parameters":{"mode":"insert","options":{},"mongoCollection":{"__rl":true,"mode":"list","value":"n8n-template","cachedResultName":"n8n-template"},"vectorIndexName":"data_index"},"credentials":{"mongoDb":{"id":"7riubYENUDZsmjyK","name":"MongoDB account 2"}},"typeVersion":1.1}],"connections":{"Document Chunker":{"ai_textSplitter":[[{"node":"Document Section Loader","type":"ai_textSplitter","index":0}]]},"Embeddings OpenAI":{"ai_embedding":[[{"node":"Search Documentation","type":"ai_embedding","index":0}]]},"Map feedback data":{"main":[[{"node":"Set feedback fields for collection storage","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Knowledge Base Agent","type":"ai_languageModel","index":0}]]},"Embeddings OpenAI1":{"ai_embedding":[[{"node":"Search Positive Interactions","type":"ai_embedding","index":0}]]},"Embeddings OpenAI3":{"ai_embedding":[[{"node":"Search Negative Interactions","type":"ai_embedding","index":0}]]},"Default Data Loader":{"ai_document":[[{"node":"Submit embedded chat feedback","type":"ai_document","index":0}]]},"MongoDB Chat Memory":{"ai_memory":[[{"node":"Knowledge Base Agent","type":"ai_memory","index":0}]]},"Google Docs Importer":{"main":[[{"node":"MongoDB Documentation Inserter","type":"main","index":0}]]},"Knowledge Base Agent":{"main":[[{"node":"Send Message on Telegram, Wait for Feedback","type":"main","index":0}]]},"Search Documentation":{"ai_tool":[[{"node":"Knowledge Base Agent","type":"ai_tool","index":0}]]},"Document Section Loader":{"ai_document":[[{"node":"MongoDB Documentation Inserter","type":"ai_document","index":0}]]},"OpenAI Embeddings Generator":{"ai_embedding":[[{"node":"MongoDB Documentation Inserter","type":"ai_embedding","index":0}]]},"Receive Message on Telegram":{"main":[[{"node":"Knowledge Base Agent","type":"main","index":0}]]},"OpenAI Embeddings Generator1":{"ai_embedding":[[{"node":"Submit embedded chat feedback","type":"ai_embedding","index":0}]]},"Search Negative Interactions":{"ai_tool":[[{"node":"Knowledge Base Agent","type":"ai_tool","index":0}]]},"Search Positive Interactions":{"ai_tool":[[{"node":"Knowledge Base Agent","type":"ai_tool","index":0}]]},"MongoDB Documentation Inserter":{"main":[[]]},"When clicking \"Execute Workflow\"":{"main":[[{"node":"Google Docs Importer","type":"main","index":0}]]},"Recursive Character Text Splitter":{"ai_textSplitter":[[{"node":"Default Data Loader","type":"ai_textSplitter","index":0}]]},"Set feedback fields for collection storage":{"main":[[{"node":"Submit embedded chat feedback","type":"main","index":0}]]},"Send Message on Telegram, Wait for Feedback":{"main":[[{"node":"Map feedback data","type":"main","index":0}]]}}}


name: Get Real-Time Security Insights with NixGuard RAG and Wazuh Integration
author_name: Jonathan | NEX
author_username: nex
nodes_used: ["n8n-nodes-base.httpRequest","n8n-nodes-base.code"]
categories: []
created_at: 2025-06-05T14:45:24.254Z
updated_at: 2025-06-05T14:45:24.254Z
url: https://n8n.io/workflows/4693
scraped_at: 2025-07-06 21:16:30
description:
  Effortlessly integrate NixGuard API into your n8n workflows for real-time security insights using your API key. This connector enables seamless interaction with Nix, providing rapid Retrieval-Augmented Generation (RAG) event knowledge with Wazuh integration - completely free and set up in under 5 minutes!

  🚀 Features:
  ✅ Query NixGuard's AI-driven security insights via API authentication
  ✅ Real-time security event knowledge integration
  ✅ Plug-and-play workflow trigger for effortless automation
  ✅ Wazuh compatibility for full security visibility

  🛠 How to Use:
  1️⃣ Add your API Key to authenticate with NixGuard.
  2️⃣ Integrate with your existing n8n workflows using the workflow trigger (default enabled).
  3️⃣ (Optional) Activate the chat trigger to streamline security queries via chat-based inputs.
  4️⃣ Run the workflow and get instant security intelligence!

  📢 Perfect for: Startup CTO's, SOC teams, security engineers, and developers needing real-time security automation within their infrastructure.

  🔗 Learn more about NixGuard: thenex.world  
  🔗 Get started with a free security subscription: thenex.world/security/subscribe  

workflow_json:
  {"id":"I0nUORqYTwDFZa51","meta":{"instanceId":"558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a"},"name":"Get Real-Time Security Insights with NixGuard RAG and Wazuh Integration","tags":[{"id":"q7fiN9zbxrNmsNbT","name":"NixGuard","createdAt":"2025-06-10T17:12:53.669Z","updatedAt":"2025-06-10T17:12:53.669Z"},{"id":"CaOFkWRRUPhl5zch","name":"NEX","createdAt":"2025-06-10T17:12:57.408Z","updatedAt":"2025-06-10T17:12:57.408Z"},{"id":"pQg0XfRi6hFoyuVB","name":"Wazuh","createdAt":"2025-06-10T17:13:00.952Z","updatedAt":"2025-06-10T17:13:00.952Z"},{"id":"nBFKoKp6KIhjRaEn","name":"Security","createdAt":"2025-06-10T17:13:09.106Z","updatedAt":"2025-06-10T17:13:09.106Z"},{"id":"to1DVLh70D0WBlIi","name":"Cybersecurity","createdAt":"2025-06-10T17:13:17.593Z","updatedAt":"2025-06-10T17:13:17.593Z"}],"nodes":[{"id":"dc94efb5-91a0-4d2b-9cd0-e72b1e97498d","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","disabled":true,"position":[-400,-80],"webhookId":"ec75b9db-22e6-4bb3-88c1-66afced7d2e5","parameters":{"options":{}},"typeVersion":1.1},{"id":"de233ffa-d892-4b6a-997f-5a7af8b51db8","name":"Execute Workflow Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-400,100],"parameters":{},"typeVersion":1},{"id":"ce9d6961-8cf9-435b-9ba9-88cc043ac60f","name":"Send Request to NixGuard API","type":"n8n-nodes-base.httpRequest","position":[640,120],"parameters":{"url":"https://nix.thenex.world","method":"POST","options":{},"sendBody":true,"jsonHeaders":"{\"Content-Type\": \"application/json\"}","sendHeaders":true,"bodyParameters":{"parameters":[{"name":"apiKey","value":"={{ $json.apiKey }}"},{"name":"prompt","value":"={{ $json.chatInput }}"}]},"specifyHeaders":"json"},"typeVersion":4.2},{"id":"aa084f8f-8f81-4079-a61a-3f3772ed351a","name":"Format API Response","type":"n8n-nodes-base.set","position":[780,340],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e41e3031-3669-432b-a669-8ece63e0a2a4","name":"content","type":"string","value":"={{ $json.content }}"}]}},"typeVersion":3.4},{"id":"b3bb011b-cf24-4c9e-b4aa-20f6718cc798","name":"Prepare Final Output","type":"n8n-nodes-base.code","position":[940,280],"parameters":{"jsCode":"const output = items[0].json.content;\n\nreturn [{json: {output}}];"},"typeVersion":2},{"id":"283c8732-fe9e-4e85-83f4-9ff00241b08b","name":"Parse NixGuard Response","type":"n8n-nodes-base.code","position":[620,400],"parameters":{"jsCode":"const nixResponse = JSON.parse($input.first().json.data);\nconst nixResult = nixResponse.result;\n\nreturn nixResponse;"},"typeVersion":2},{"id":"1bd49a13-db15-45ac-8d83-3a198b6d401c","name":"Merge Input Data","type":"n8n-nodes-base.merge","position":[160,-20],"parameters":{},"typeVersion":3},{"id":"60ce604d-a084-4895-9c3b-37ff29f98fd4","name":"Aggregate Security Data","type":"n8n-nodes-base.aggregate","position":[320,40],"parameters":{"options":{},"aggregate":"aggregateAllItemData"},"typeVersion":1},{"id":"9835ff41-0cae-491f-aade-2e8981c10232","name":"Combine Security Data","type":"n8n-nodes-base.code","position":[480,80],"parameters":{"jsCode":"\n// Combine properties from both objects into a single object \nconst combinedObject = Object.assign({}, ...$input.first().json.data); \n// Return the combined object as a single item \nreturn [combinedObject];"},"typeVersion":2},{"id":"9df08e53-a3df-434b-ba8e-909bfae11d24","name":"Prepare API Request Data","type":"n8n-nodes-base.set","disabled":true,"position":[-200,-80],"parameters":{"options":{},"assignments":{"assignments":[{"id":"78b78cf7-943f-4f4f-91c5-c71efeb7d78a","name":"apiKey","type":"string","value":""},{"id":"0ee0f3f2-2954-414b-a701-4ca14e3c5be2","name":"sessionId","type":"string","value":"={{ $json.sessionId }}"},{"id":"a0f7d4d4-0ac7-474e-b87a-b87536f5e303","name":"action","type":"string","value":"={{ $json.action }}"},{"id":"3d047460-d218-4408-aa7a-466f55a5de24","name":"chatInput","type":"string","value":"={{ $json.chatInput }}"}]}},"typeVersion":3.4},{"id":"1a040e52-30fb-4556-ac2c-71f173075d89","name":"Data Aggregation","type":"n8n-nodes-base.stickyNote","position":[-140,140],"parameters":{"color":7,"width":400,"height":340,"content":"## Data Aggregation\n\nThis section combines multiple security data sources:\n1. **Merge Input Data**: Combines triggers from different sources\n2. **Aggregate Security Data**: Consolidates security events\n3. **Combine Security Data**: Creates unified request payload\n\n### Use Cases:\n- Correlate Wazuh alerts with NixGuard insights\n- Combine multiple security queries\n- Process batch security events"},"typeVersion":1},{"id":"a4d8b9d0-84e2-4732-ac67-85985343a67c","name":"Setup Guide","type":"n8n-nodes-base.stickyNote","position":[-860,320],"parameters":{"color":7,"width":400,"height":420,"content":"## Getting Started\n\n### Prerequisites:\n- Valid NixGuard API key\n- Access to Wazuh security data (if integrating)\n\n### Setup Instructions:\n1. Configure your NixGuard API key in 'Prepare API Request Data' node\n2. Set up trigger method (chat or manual)\n3. Test with sample security queries\n4. Make sure NixGuard agents are installed on your network endpoints for real-time security events\n\n### Support:\nFor questions, visit [NixGuard Documentation](https://nixguard.thenex.world) or join our [Community Discord](https://discord.com/invite/ajCYwYCwHb)"},"typeVersion":1},{"id":"a94e8519-9783-4b2f-8ca9-e3e571784e40","name":"Workflow Overview1","type":"n8n-nodes-base.stickyNote","position":[-960,-80],"parameters":{"color":7,"width":500,"height":380,"content":"## NixGuard Security Connector Workflow\n\nThis workflow integrates NixGuard's RAG (Retrieval-Augmented Generation) with Wazuh security data to provide real-time security insights.\n\n### Key Features:\n- Processes security queries through NixGuard's AI\n- Combines multiple security data sources\n- Returns actionable security insights\n\n### Authentication:\nRequires valid API key for NixGuard endpoint (configured in 'Prepare API Request Data' node)."},"typeVersion":1},{"id":"69fd8854-8025-462f-b078-73b86803a8c7","name":"API Request Explanation1","type":"n8n-nodes-base.stickyNote","position":[-140,500],"parameters":{"color":7,"width":400,"height":380,"content":"## API Request Configuration\n\nThis node sends the security query to NixGuard's API endpoint with:\n- Proper authentication headers\n- Formatted request body\n- Required content type\n\n### Configuration:\n1. Set your NixGuard API endpoint URL\n2. Ensure headers include `Content-Type: application/json`\n3. Body contains:\n   - `apiKey`: Your NixGuard API key\n   - `prompt`: The security query/input"},"typeVersion":1},{"id":"b4d557c8-6db5-42d6-bf6a-6edbe4c84dec","name":"Response Processing1","type":"n8n-nodes-base.stickyNote","position":[800,500],"parameters":{"color":7,"width":400,"height":320,"content":"## Response Processing\n\nThis section handles the NixGuard API response:\n1. **Parse NixGuard Response**: Converts JSON string to object\n2. **Format API Response**: Extracts relevant content\n3. **Prepare Final Output**: Structures output for end users\n\n### Error Handling:\n- Invalid responses will trigger error paths\n- Ensure proper error handling in subsequent workflows"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"130b7c1c-428f-45c4-934c-14653965820d","connections":{"Merge Input Data":{"main":[[{"node":"Aggregate Security Data","type":"main","index":0}]]},"Format API Response":{"main":[[{"node":"Prepare Final Output","type":"main","index":0}]]},"Combine Security Data":{"main":[[{"node":"Send Request to NixGuard API","type":"main","index":0}]]},"Aggregate Security Data":{"main":[[{"node":"Combine Security Data","type":"main","index":0}]]},"Parse NixGuard Response":{"main":[[{"node":"Format API Response","type":"main","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"Merge Input Data","type":"main","index":0}]]},"Prepare API Request Data":{"main":[[{"node":"Merge Input Data","type":"main","index":0}]]},"When chat message received":{"main":[[{"node":"Prepare API Request Data","type":"main","index":0}]]},"Send Request to NixGuard API":{"main":[[{"node":"Parse NixGuard Response","type":"main","index":0}]]}}}


name: AI Agent that updates its own rules to modify behavior
author_name: GiovanniSegar
author_username: giosegar
categories: []
created_at: 2025-06-05T14:54:35.685Z
updated_at: 2025-06-05T14:54:35.685Z
url: https://n8n.io/workflows/4694
scraped_at: 2025-07-06 21:16:30
description:
  Summary of agent
  This agent can write and rewrite its own rules, allowing you to mold its behavior. It receives rules from a database as system instructions and has tools to create, edit, or delete them. This is a great baseline for new agent builds.

  You can tell it things like "Next time, use present tense when talking about this subject" and it will use a tool to save this as a rule, then receive that instruction in all future iterations. 

  How to start using it

  Option 1: With a Postgres database (e.g., Supabase)
  Supabase Schema: Create a table (e.g., agent_rules) with the following columns:
      id: bigint (Primary Key, auto-incrementing)
      created_at: timestamp with time zone (Default: now())
      rule_text: text
      agent: text
  Workflow Updates:
      Update the Postgres credentials in the "Get rules from database," "Insert rule into database," and "Execute query on rule database" nodes.
      Update the agent value (currently 'TestAgent') in the "Get rules from database" and "Insert rule into database" nodes if you want a different agent name.
      Update the Anthropic API credentials.

  Option 2: With Google Sheets
  Google Sheet Setup: Create a Google Sheet with columns for rule_text and agent.
  Workflow Updates:
      Example Google Sheets nodes are included. You will need to:
          Connect your Google Sheets credentials.
          Select your Google Sheet (with rule_text and agent columns) in all relevant Google Sheets nodes.
          Replace the existing Postgres nodes ("Get rules from database", "Insert rule into database", "Execute query on rule database") with the configured Google Sheets nodes.
      Update the agent value (currently 'TestAgent') in the Google Sheets nodes if you want a different agent name.
      Update the Anthropic API credentials.
      Agent Instructions: Update the agent's system message and remove the database schema section as it is no longer relevant

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.postgres","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatAnthropic","@n8n/n8n-nodes-langchain.memoryBufferWindow"]

workflow_json:
  {"meta":{"instanceId":"59761dc282918b63de68f8544bab8098be77f63f00c94bc04dd5d71886f7d2e1","templateCredsSetupCompleted":true},"nodes":[{"id":"c7c148ea-7896-4e51-b360-6f7fc59ceda8","name":"Ultimate Assistant1","type":"@n8n/n8n-nodes-langchain.agent","position":[1120,-80],"parameters":{"text":"={{ $json.body.message }}","options":{"systemMessage":"=# Overview\nYou are the ultimate personal assistant. Your job is to figure out the right tool to use, if applicable to the user's prompt.\n\n## Rules\n{{ \"- \" + $json.rules.join(\"\\n- \") }}\n\n## Rule Database Schema: \nTable name: datos_agent_rules\n[\n  {\n    \"column_name\": \"id\",\n    \"data_type\": \"bigint\",\n    \"character_maximum_length\": null,\n    \"is_nullable\": \"NO\",\n    \"column_default\": null\n  },\n  {\n    \"column_name\": \"created_at\",\n    \"data_type\": \"timestamp with time zone\",\n    \"character_maximum_length\": null,\n    \"is_nullable\": \"NO\",\n    \"column_default\": \"now()\"\n  },\n  {\n    \"column_name\": \"rule_text\",\n    \"data_type\": \"text\",\n    \"character_maximum_length\": null,\n    \"is_nullable\": \"YES\",\n    \"column_default\": null\n  },\n  {\n    \"column_name\": \"agent\",\n    \"data_type\": \"text\",\n    \"character_maximum_length\": null,\n    \"is_nullable\": \"YES\",\n    \"column_default\": null\n  }\n]\n\n## Final Context:\n- Here is the current date/time: {{ $now.toISO() }}\n- UNIX timestamp for current date/time: {{ $now.toMillis() }}\n- The user's timezone is PST\n- The user's name is Giovanni Segar (or Gio for short)","returnIntermediateSteps":true},"promptType":"define"},"typeVersion":1.7},{"id":"7f623864-efc7-4873-8a94-becaa4b507da","name":"Chat History1","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[1180,180],"parameters":{"contextWindowLength":10},"typeVersion":1.3},{"id":"b3bfd8ea-511b-407e-9f40-2c33115d8521","name":"Anthropic Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[1000,180],"parameters":{"model":"=claude-sonnet-4-20250514","options":{"temperature":0.2}},"credentials":{"anthropicApi":{"id":"9n2PuVH0HamhCE46","name":"Anthropic account"}},"typeVersion":1.2},{"id":"90557906-3244-4dd0-b511-f20d64380183","name":"Get rules from database","type":"n8n-nodes-base.postgres","position":[460,-200],"parameters":{"query":"SELECT rule_text FROM datos_agent_rules WHERE agent = 'TestAgent';","options":{},"operation":"executeQuery"},"credentials":{"postgres":{"id":"1UmU4low0qyDbv99","name":"Datos Postgres"}},"typeVersion":2.6},{"id":"1b462765-5889-4688-af7d-3cebd51efa05","name":"Merge","type":"n8n-nodes-base.merge","position":[900,-80],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3.1},{"id":"7d3a71f9-79f5-4b4b-920c-fc37f148602c","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[680,-200],"parameters":{"options":{},"fieldsToAggregate":{"fieldToAggregate":[{"renameField":true,"outputFieldName":"rules","fieldToAggregate":"rule_text"}]}},"typeVersion":1},{"id":"a5df493e-27ba-485c-a14b-ad3217d3232f","name":"Insert rule into database","type":"n8n-nodes-base.postgresTool","position":[1560,160],"parameters":{"table":{"__rl":true,"mode":"list","value":"datos_agent_rules","cachedResultName":"datos_agent_rules"},"schema":{"__rl":true,"mode":"list","value":"public"},"columns":{"value":{"agent":"TestAgent","rule_text":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('rule_text', `Write a simple reminder for the future based on the user's instructions. `, 'string') }}"},"schema":[{"id":"id","type":"number","display":true,"removed":true,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"created_at","type":"dateTime","display":true,"removed":true,"required":false,"displayName":"created_at","defaultMatch":false,"canBeUsedToMatch":true},{"id":"rule_text","type":"string","display":true,"required":false,"displayName":"rule_text","defaultMatch":false,"canBeUsedToMatch":true},{"id":"agent","type":"string","display":true,"required":false,"displayName":"agent","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"descriptionType":"manual","toolDescription":"This should be used when the user corrects you in some way to add a rule that will be included in the future prompts. This can be specific to a certain client or can be a general rule for how to do things. Make sure to let the user know if you added a rule."},"credentials":{"postgres":{"id":"1UmU4low0qyDbv99","name":"Datos Postgres"}},"typeVersion":2.6},{"id":"6382b5f0-2aab-49ee-ad89-bc329e24d6e4","name":"Execute query on rule database","type":"n8n-nodes-base.postgresTool","position":[1740,160],"parameters":{"query":"{{ $fromAI('valid_postgres_sql_query', 'Write any valid SQL query for the Postgres rule database.', 'string') }}","options":{},"operation":"executeQuery","descriptionType":"manual","toolDescription":"Use this to get rules and their IDs for modification, delete items, add multiple items, or any other operation not covered by the simple insert tool"},"credentials":{"postgres":{"id":"1UmU4low0qyDbv99","name":"Datos Postgres"}},"typeVersion":2.6},{"id":"3c8d3c66-bddf-47ab-85ca-a4146a6b59cb","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[180,-60],"webhookId":"8f2b6d22-043e-4dab-b39a-44a8bbef4694","parameters":{"options":{}},"typeVersion":1.1},{"id":"5a62af2c-6952-4a7d-b945-cf5c1c437aaf","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-460,180],"parameters":{"width":1000,"height":760,"content":"## Summary of agent\nThis agent can write and rewrite its own rules, allowing you to mold its behavior. It receives rules from a database as system instructions and has tools to create, edit, or delete them. This is a great baseline for new agent builds.\n\n## How to start using it\n\n### Option 1: With a Postgres database (e.g., Supabase)\n1.  **Supabase Schema:** Create a table (e.g., `agent_rules`) with the following columns:\n    *   `id`: `bigint` (Primary Key, auto-incrementing)\n    *   `created_at`: `timestamp with time zone` (Default: `now()`)\n    *   `rule_text`: `text`\n    *   `agent`: `text`\n2.  **Workflow Updates:**\n    *   Update the **Postgres credentials** in the \"Get rules from database,\" \"Insert rule into database,\" and \"Execute query on rule database\" nodes.\n    *   Update the `agent` value (currently 'TestAgent') in the \"Get rules from database\" and \"Insert rule into database\" nodes if you want a different agent name.\n    *   Update the **Anthropic API credentials**.\n\n### Option 2: With Google Sheets\n1.  **Google Sheet Setup:** Create a Google Sheet with columns for `rule_text` and `agent`.\n2.  **Workflow Updates:**\n    *   Example Google Sheets nodes are included. You will need to:\n        *   Connect your **Google Sheets credentials**.\n        *   Select your Google Sheet (with `rule_text` and `agent` columns) in all relevant Google Sheets nodes.\n        *   Replace the existing Postgres nodes (\"Get rules from database\", \"Insert rule into database\", \"Execute query on rule database\") with the configured Google Sheets nodes.\n    *   Update the `agent` value (currently 'TestAgent') in the Google Sheets nodes if you want a different agent name.\n    *   Update the **Anthropic API credentials**.\n    *   **Agent Instructions:** Update the agent's system message and remove the database schema section as it is no longer relevant"},"typeVersion":1},{"id":"d4bb6943-7806-4630-9991-8dd5a177352c","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[700,400],"parameters":{"color":4,"width":1240,"height":540,"content":"## Prefer Google Sheets? Here are nodes to replace Postgres"},"typeVersion":1},{"id":"a90397f4-b7c7-4477-84d1-7466d0e700bf","name":"Get rules from sheets","type":"n8n-nodes-base.googleSheets","position":[780,500],"parameters":{"sheetName":{"__rl":true,"mode":"list","value":""},"documentId":{"__rl":true,"mode":"list","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"12","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"d7e5e896-5479-4ea5-817b-7e8b8763a926","name":"Add rule to sheet","type":"n8n-nodes-base.googleSheetsTool","position":[1040,520],"parameters":{"operation":"append","sheetName":{"__rl":true,"mode":"list","value":""},"documentId":{"__rl":true,"mode":"list","value":""},"descriptionType":"manual","toolDescription":"Use this to add rules to the google sheet"},"credentials":{"googleSheetsOAuth2Api":{"id":"12","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"6abf1348-2822-426b-ac6a-9c0cb439e081","name":"Update rule in sheet","type":"n8n-nodes-base.googleSheetsTool","position":[1220,520],"parameters":{"operation":"update","sheetName":{"__rl":true,"mode":"list","value":""},"documentId":{"__rl":true,"mode":"list","value":""},"descriptionType":"manual","toolDescription":"Use this to update an existing rule in the sheet"},"credentials":{"googleSheetsOAuth2Api":{"id":"12","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"53b15f2a-1f33-4d1c-b270-f687aa1f0e85","name":"Delete rule in sheet","type":"n8n-nodes-base.googleSheetsTool","position":[1360,520],"parameters":{"operation":"delete","sheetName":{"__rl":true,"mode":"list","value":""},"documentId":{"__rl":true,"mode":"list","value":""},"descriptionType":"manual","toolDescription":"Use this to delete an existing rule in the sheet"},"credentials":{"googleSheetsOAuth2Api":{"id":"12","name":"Google Sheets account"}},"typeVersion":4.6}],"connections":{"Merge":{"main":[[{"node":"Ultimate Assistant1","type":"main","index":0}]]},"Aggregate":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Chat History1":{"ai_memory":[[{"node":"Ultimate Assistant1","type":"ai_memory","index":0}]]},"Ultimate Assistant1":{"main":[[]]},"Anthropic Chat Model":{"ai_languageModel":[[{"node":"Ultimate Assistant1","type":"ai_languageModel","index":0}]]},"Get rules from database":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"Insert rule into database":{"ai_tool":[[{"node":"Ultimate Assistant1","type":"ai_tool","index":0}]]},"When chat message received":{"main":[[{"node":"Merge","type":"main","index":1},{"node":"Get rules from database","type":"main","index":0}]]},"Execute query on rule database":{"ai_tool":[[{"node":"Ultimate Assistant1","type":"ai_tool","index":0}]]}}}


name: Conversational Telegram Bot with GPT-4o for Text and Voice Messages
author_name: Roninimous
author_username: roninimous
categories: []
created_at: 2025-06-05T15:13:35.483Z
updated_at: 2025-06-05T15:13:35.483Z
url: https://n8n.io/workflows/4696
scraped_at: 2025-07-06 21:16:30
description:
  This n8n workflow leverages a Telegram Message Trigger to activate an intelligent AI Agent capable of processing both text and voice messages. When a user sends a message in text or in voice format, the workflow captures and transcribes it (if necessary), then passes it to the AI Agent for understanding and response generation.

  To enhance user experience, the bot also displays a typing indicator while processing requests, simulating a natural, human-like interaction.

  Key Features
  Multi-Modal Input: Supports both text messages and voice notes from users.
  Real-Time Interaction: Shows a “typing…” action in Telegram while the AI processes the input.
  AI Agent Integration: Provides intelligent, context-aware, and conversational responses.
  Seamless Feedback Loop: Replies are sent directly back to the user within Telegram for smooth interaction.

  How It Works
  The workflow triggers whenever a message or voice note is received on Telegram.
  If the input is a voice note, the workflow transcribes it into text.
  The text input is sent to the AI Agent for processing.
  While processing, the bot sends a typing indicator to the user.
  Once the AI generates a response, the workflow sends it back to the user in Telegram.

  Setup Instructions
  Create a Telegram Bot:
  	Use @BotFather to create a bot and obtain your bot token.
  Configure n8n Credentials:
  	Add Telegram API credentials in n8n with your bot token.
  	Add credentials for any speech-to-text service used for voice transcription (e.g., Open AI Transcribe A Recording).
  Import the Workflow:
  	Import this workflow into your n8n instance.
  	Update all credential nodes to use your Telegram and transcription service credentials.
  Set Webhook URLs:
  	Ensure Telegram webhook is set properly for your bot to receive messages.
  	Make sure your n8n instance is publicly accessible for Telegram callbacks.
  Test the Workflow:
  	Send text messages and voice notes to your Telegram bot and observe the AI responses.

  Customization Guidance
  Add new message handlers: Extend the workflow to handle additional message types (images, documents, etc.).
  Improve transcription: Swap or add speech-to-text services for better accuracy or language support.
  Enhance AI Agent: Customize prompts and context management to tailor the AI’s personality and responses.
  AI Model Flexibility: Swap between different AI models (e.g., GPT-4, Claude, or custom LLMs) based on task type, cost, or performance preferences.
  Tool-Based Control: Add custom tools to the AI Agent such as calendar access, Notion, Google Sheets, web search, database queries, or custom APIs—allowing for dynamic, multi-functional agents

  Security and Implementation 
  Notes The Telegram node manages message reception and sending but does not directly handle AI processing.
  Voice transcription requires integration with external APIs; secure those credentials in n8n and monitor usage.
  To simulate typing, the workflow uses Telegram’s “sendChatAction” API method, providing users with feedback that the bot is processing.
  Ensure your AI API keys and Telegram tokens are securely stored in n8n credentials and not exposed in workflows or logs.

  Benefits
  Handles natural conversational inputs with text or voice.
  Provides a smooth, engaging user experience via typing indicators.
  Easy integration of advanced AI conversational agents with Telegram.
  Flexible for personal assistants, helpdesks, or interactive chatbots.

nodes_used:
  ["n8n-nodes-base.telegram","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"id":"RV4zArpzN5InxYND","meta":{"instanceId":"1e9c5d216f82eece259bdabdf191aced054cce6456f87af0ff7807ca2b37638a","templateCredsSetupCompleted":true},"name":"Conversational Telegram Bot with GPT-4o for Text and Voice Messages","tags":[{"id":"hlEHEpOdSg5lhIqi","name":"Template","createdAt":"2025-06-05T15:35:52.689Z","updatedAt":"2025-06-05T15:35:52.689Z"}],"nodes":[{"id":"a33e3f45-f16e-4107-937e-0ce1d230060f","name":"Telegram Trigger","type":"n8n-nodes-base.telegramTrigger","position":[-660,-180],"webhookId":"912e007f-19d9-4b5a-a90e-12ba01c9978d","parameters":{"updates":["message","*"],"additionalFields":{}},"credentials":{"telegramApi":{"id":"ya9idB8joP5s1Xf4","name":"Your Telegram Access Token"}},"typeVersion":1.2},{"id":"e17f452c-4f9a-48f8-91a2-526260159676","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[520,420],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"gpt-4o"},"options":{}},"credentials":{"openAiApi":{"id":"WOlQJiwanaNPGe2f","name":"OpenAi Credential"}},"typeVersion":1.2},{"id":"9b33ec46-8772-4bfb-a448-fea5a673bbaa","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[740,460],"parameters":{"sessionKey":"={{ $json.sessionId }}","sessionIdType":"customKey","contextWindowLength":10},"typeVersion":1.3},{"id":"8cdd7ba8-c998-4ea7-b861-8dcaf12febfe","name":"Get Voice","type":"n8n-nodes-base.telegram","position":[80,0],"webhookId":"1962cd81-9991-4199-a78a-2250bf29631a","parameters":{"fileId":"={{ $json.message.voice.file_id }}","resource":"file"},"credentials":{"telegramApi":{"id":"ya9idB8joP5s1Xf4","name":"Your Telegram Access Token"}},"typeVersion":1.2},{"id":"7fa34d0e-5215-44e5-b1d3-1e8abb5771ae","name":"Text Or Voice","type":"n8n-nodes-base.switch","position":[-240,-180],"parameters":{"rules":{"values":[{"outputKey":"Text","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"0a236099-525e-4748-a57d-8b8e2c63c48b","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.message.text }}","rightValue":""}]},"renameOutput":true},{"outputKey":"Voice","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"24b7e8b8-6fce-4ddc-94b6-30b852891995","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{  $json.message.voice.file_id }}","rightValue":""}]},"renameOutput":true}]},"options":{}},"typeVersion":3.2},{"id":"b90a586b-5d90-4f76-8e4e-bd44095f9aac","name":"Transcribe The Voice","type":"@n8n/n8n-nodes-langchain.openAi","position":[280,0],"parameters":{"options":{},"resource":"audio","operation":"transcribe"},"credentials":{"openAiApi":{"id":"WOlQJiwanaNPGe2f","name":"OpenAi Credential"}},"typeVersion":1.8},{"id":"587adf8a-2e69-4078-a603-84f0322207cb","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[720,80],"parameters":{"text":"={{ $json.message.text }}","options":{"systemMessage":"=# Overview\nYou are a personal assistant that helps user to fulfill their request.\n\nWhen you are asked to perform a task on the current date, please use the current time and date: {{$now}}\n\n## Output\nYou should output the result and don't include any link. Just mentioned where you added it to."},"promptType":"define"},"typeVersion":1.9},{"id":"2455c7cb-f341-4891-9096-dc62116298c0","name":"Typing Action","type":"n8n-nodes-base.telegram","position":[-240,-360],"webhookId":"2479f7f8-6d54-4d45-921e-af6dcfae768e","parameters":{"chatId":"={{ $json.message.chatId }}","operation":"sendChatAction"},"credentials":{"telegramApi":{"id":"ya9idB8joP5s1Xf4","name":"Your Telegram Access Token"}},"typeVersion":1.2},{"id":"8c2b6195-6101-4652-848c-505d13a3c1d2","name":"Send Response To Telegram","type":"n8n-nodes-base.telegram","position":[1340,80],"webhookId":"76e4b8a4-1086-4d24-b60e-b96942d83bdf","parameters":{"text":"={{ $json.output }}","chatId":"={{$('Telegram Trigger').first().json.message.chat.id}}","additionalFields":{"appendAttribution":false}},"credentials":{"telegramApi":{"id":"ya9idB8joP5s1Xf4","name":"Your Telegram Access Token"}},"typeVersion":1.2},{"id":"c8fd047d-8575-484e-939a-46064b81d035","name":"Send Context To AI Agent","type":"n8n-nodes-base.set","position":[460,-200],"parameters":{"options":{},"assignments":{"assignments":[{"id":"590b803f-833c-4854-bde7-5241d25b2b32","name":"message.text","type":"string","value":"={{ $json.message.text }}"},{"id":"303e0b5d-3d37-48fc-bbd3-ce62dbe7ef78","name":"sessionId","type":"string","value":"={{ $json.message.chat.id }}"}]}},"typeVersion":3.4},{"id":"f7e90526-08a5-4a59-956f-d39e6ff472f0","name":"Send Transcribe Context To AI Agent","type":"n8n-nodes-base.set","position":[460,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"2bb71aef-0ca1-4c26-95e1-c0c83bc82068","name":"message.text","type":"string","value":"={{ $json.text }}"},{"id":"692a2bae-35da-41d3-be8d-32c0f5dfbbef","name":"sessionId","type":"string","value":"={{ $('Telegram Trigger').item.json.message.chat.id }}"}]}},"typeVersion":3.4}],"active":false,"settings":{"timezone":"Australia/Sydney","callerPolicy":"workflowsFromSameOwner","executionOrder":"v1"},"versionId":"3a29c25b-e7bd-41a7-91ee-4438fa9c1c1a","connections":{"AI Agent":{"main":[[{"node":"Send Response To Telegram","type":"main","index":0}]]},"Get Voice":{"main":[[{"node":"Transcribe The Voice","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Text Or Voice":{"main":[[{"node":"Send Context To AI Agent","type":"main","index":0}],[{"node":"Get Voice","type":"main","index":0}]]},"Typing Action":{"main":[[]]},"Telegram Trigger":{"main":[[{"node":"Text Or Voice","type":"main","index":0},{"node":"Typing Action","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Transcribe The Voice":{"main":[[{"node":"Send Transcribe Context To AI Agent","type":"main","index":0}]]},"Send Context To AI Agent":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Send Transcribe Context To AI Agent":{"main":[[{"node":"AI Agent","type":"main","index":0}]]}}}


name: Daily News Digest: Summarize RSS Feeds with OpenAI and Deliver to WhatsApp
author_name: Danielle Gomes
author_username: daniellegomes
nodes_used: ["n8n-nodes-base.httpRequest","@n8n/n8n-nodes-langchain.openAi"]
categories: []
created_at: 2025-06-05T22:10:34.527Z
updated_at: 2025-06-05T22:10:34.527Z
url: https://n8n.io/workflows/4709
scraped_at: 2025-07-06 21:16:30
description:
  This n8n workflow collects and summarizes news from multiple RSS feeds, using OpenAI to generate a concise summary that can be sent to WhatsApp or other destinations. Perfect for automating your daily news digest.

  🔁 Workflow Breakdown:
  Schedule Trigger
  Start the workflow on your desired schedule (daily, hourly, etc.).

  🟨 Note: Set the trigger however you wish.

  RSS Feeds (My RSS 01–04)
  Fetches articles from four different RSS sources.

  🟨 Note: You can add as many RSS feeds as you want.

  Edit Fields (Edit Fields1–3)
  Normalizes RSS fields (title, link, etc.) to ensure consistency across different sources.

  Merge (append mode)
  Combines the RSS items into a single unified list.

  Filter
  Optionally filter articles by keywords, date, or categories.

  Limit
  Limits the analysis to the 10 most recent articles.

  🟨 Note: This keeps the result concise and avoids overloading the summary.

  Aggregate
  Prepares the selected news for summarization by combining them into a single content block.

  OpenAI (Message Assistant)
  Summarizes the aggregated news items in a clean and readable format using AI.

  Send Summary to WhatsApp
  Sends the AI-generated summary to a WhatsApp endpoint via webhook (yoururlapi.com). You can replace this with an email service, Google Drive, or any other destination.

  🟨 Note: You can send it to your WhatsApp API, email, drive, etc.

  No Operation (End)
  Final placeholder to safely close the workflow. You may expand from here if needed.

workflow_json:
  {"id":"xD6cGHJBF0QwUUc5","meta":{"instanceId":"47132c409ea4cfc382a6c48656c8a35b5da4c1fa7ef892882b424c42ae8a05b2"},"name":"RSS - WhatsApp","tags":[],"nodes":[{"id":"810a8040-2bfc-4125-9c5d-273e089a857c","name":"Filter","type":"n8n-nodes-base.filter","position":[2240,500],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"30d4f694-9378-42b4-b1d5-cbc38fb3e7fe","operator":{"type":"dateTime","operation":"after"},"leftValue":"={{ $json.pubDate }}","rightValue":"={{ $today.minus({ days: 1 }) }}"}]}},"typeVersion":2.2},{"id":"ffe9e174-749f-4864-8402-629e5a850961","name":"Edit Fields","type":"n8n-nodes-base.set","position":[1820,420],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e2ffe594-180d-4e1d-b869-8056ac67015d","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"87c5a171-9ab9-4043-a72a-32aec218fe63","name":"pubDate","type":"string","value":"={{ $json.pubDate }}"},{"id":"978b05c9-6e6b-4a18-bc06-4de785b19413","name":"conteudo","type":"string","value":"={{ $json['content:encoded'] }}"}]}},"typeVersion":3.4},{"id":"22d05f1c-7c65-4226-b842-e3a357994615","name":"Edit Fields1","type":"n8n-nodes-base.set","position":[1820,620],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e2ffe594-180d-4e1d-b869-8056ac67015d","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"87c5a171-9ab9-4043-a72a-32aec218fe63","name":"pubDate","type":"string","value":"={{ $json.pubDate }}"},{"id":"bae1b890-716b-442c-8714-b4ece09063d7","name":"conteudo","type":"string","value":"={{ $json.contentSnippet }}"}]}},"typeVersion":3.4},{"id":"5ebcfd94-fa94-46cb-b4ff-a487af4520c2","name":"Edit Fields2","type":"n8n-nodes-base.set","position":[1820,840],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e2ffe594-180d-4e1d-b869-8056ac67015d","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"87c5a171-9ab9-4043-a72a-32aec218fe63","name":"pubDate","type":"string","value":"={{ $json.pubDate }}"},{"id":"978b05c9-6e6b-4a18-bc06-4de785b19413","name":"conteudo","type":"string","value":"={{ $json.contentSnippet }}"}]}},"typeVersion":3.4},{"id":"5e2f2364-a0a0-4a93-99ec-d1c477c7e6bc","name":"Edit Fields3","type":"n8n-nodes-base.set","position":[1820,200],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e2ffe594-180d-4e1d-b869-8056ac67015d","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"87c5a171-9ab9-4043-a72a-32aec218fe63","name":"pubDate","type":"string","value":"={{ $json.pubDate }}"},{"id":"978b05c9-6e6b-4a18-bc06-4de785b19413","name":"conteudo","type":"string","value":"={{ $json.content }}"}]}},"typeVersion":3.4},{"id":"a9600807-9562-4ddc-a830-b18b81daffe4","name":"Merge","type":"n8n-nodes-base.merge","position":[2040,480],"parameters":{"numberInputs":4},"typeVersion":3.1},{"id":"39c8f94b-27ba-4676-9197-e87a493bcae6","name":"OpenAI","type":"@n8n/n8n-nodes-langchain.openAi","position":[2820,500],"parameters":{"text":"=I've received news articles via RSS. Please analyze them and provide a concise summary of the top 3 to 5 main highlights. My goal is to get a quick overview of what's most relevant in these articles.\n1.{{ $json.data[0].title }}{{ $json.data[0].conteudo }}\n2.{{ $json.data[1].title }}{{ $json.data[1].conteudo }}\n3.{{ $json.data[2].title }}{{ $json.data[2].conteudo }}\n4.{{ $json.data[3].title }}{{ $json.data[3].conteudo }}\n5.{{ $json.data[4].title }}{{ $json.data[4].conteudo }}\n6.{{ $json.data[5].title }}{{ $json.data[5].conteudo }}\n7.{{ $json.data[6].title }}{{ $json.data[6].conteudo }}\n8.{{ $json.data[7].title }}{{ $json.data[7].conteudo }}\n9.{{ $json.data[8].title }}{{ $json.data[8].conteudo }}\n10.{{ $json.data[9].title }}{{ $json.data[9].conteudo }}","prompt":"define","options":{},"resource":"assistant","assistantId":{"__rl":true,"mode":"list","value":"asst_7Miwcww78kuTtx5rVQ7m5Nnw","cachedResultName":"Linkedin"}},"credentials":{"openAiApi":{"id":"","name":""}},"typeVersion":1.8},{"id":"2e096826-70ee-433c-b59b-477eec5c3905","name":"Limit","type":"n8n-nodes-base.limit","position":[2440,500],"parameters":{"maxItems":10},"typeVersion":1},{"id":"2910734f-73c3-45c5-9470-5a08868cd66e","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[2640,500],"parameters":{"include":"specifiedFields","options":{},"aggregate":"aggregateAllItemData","fieldsToInclude":"title, pubDate, conteudo"},"typeVersion":1},{"id":"fda99f10-0a33-49f3-a46b-37d61567e851","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[1260,520],"parameters":{"rule":{"interval":[{"triggerAtHour":3}]}},"typeVersion":1.2},{"id":"1b0fa8c7-bfd8-4267-b9ac-eb3c90b2160d","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[3380,500],"parameters":{},"typeVersion":1},{"id":"08cf9756-8407-4b9f-826d-ce21272de911","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[2380,680],"parameters":{"content":"## About Limit\nlimits the analysis to the 10 most recent articles"},"typeVersion":1},{"id":"a747f665-ff17-4972-bb40-28c8251520dd","name":"My RSS 01","type":"n8n-nodes-base.rssFeedRead","onError":"continueRegularOutput","position":[1600,200],"parameters":{"url":"https://uxdesign.cc/feed","options":{"ignoreSSL":false}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"ce492fd5-c8f9-4074-a080-56a55fc5074d","name":"My RSS 02","type":"n8n-nodes-base.rssFeedRead","onError":"continueRegularOutput","position":[1600,420],"parameters":{"url":"https://www.technologyreview.com/topic/artificial-intelligence/feed/","options":{}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"1418186b-ee9a-480b-93e6-6483014a3ddf","name":"My RSS 03","type":"n8n-nodes-base.rssFeedRead","onError":"continueRegularOutput","position":[1600,620],"parameters":{"url":"https://the-decoder.com/feed/","options":{}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"31da3f86-a150-4cd4-83bd-57bcb348f7c3","name":"My RSS 04","type":"n8n-nodes-base.rssFeedRead","onError":"continueRegularOutput","position":[1600,840],"parameters":{"url":"https://www.theverge.com/rss/index.xml","options":{"ignoreSSL":false}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"a2e2bf11-d56a-470f-b183-751ff5a2d7f9","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1540,1000],"parameters":{"content":"## About RSS\nYou can add how many RSS you want"},"typeVersion":1},{"id":"90ea767f-aa1f-4475-8378-85f9b34487eb","name":"Send resum to  Whatsapp","type":"n8n-nodes-base.httpRequest","position":[3160,500],"parameters":{"url":"yoururlapi.com","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"phone","value":"=your phone number"},{"name":"message","value":"={{ $json.output }}"}]},"genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"2CmkjW0hZ9FO0rd3","name":"Header Zapi"}},"typeVersion":4.2},{"id":"55a91be7-2fe8-45ea-9ac5-51e90a9bb2c9","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3100,700],"parameters":{"content":"## About Resum\nyou can send to your whatsapp api, or email, drive..."},"typeVersion":1},{"id":"16acc038-b6f3-4a7d-a2d9-415c4287532b","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1200,680],"parameters":{"content":"## About Trgger\nSet trigger how you wish"},"typeVersion":1},{"id":"47783f2d-e603-4325-9031-09d3eefe9fcd","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[2820,700],"parameters":{"content":"## System message (change if you want)\nI've received 10 news articles via RSS. Please analyze them and provide a concise summary of the top 3 to 5 main highlights. My goal is to get a quick overview of what's most relevant in these articles."},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"a24e6662-345a-4746-913d-104bfc17c63f","connections":{"Limit":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Filter","type":"main","index":0}]]},"Filter":{"main":[[{"node":"Limit","type":"main","index":0}]]},"OpenAI":{"main":[[{"node":"Send resum to  Whatsapp","type":"main","index":0}]]},"Aggregate":{"main":[[{"node":"OpenAI","type":"main","index":0}]]},"My RSS 01":{"main":[[{"node":"Edit Fields3","type":"main","index":0}]]},"My RSS 02":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"My RSS 03":{"main":[[{"node":"Edit Fields1","type":"main","index":0}]]},"My RSS 04":{"main":[[{"node":"Edit Fields2","type":"main","index":0}]]},"Edit Fields":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Edit Fields1":{"main":[[{"node":"Merge","type":"main","index":2}]]},"Edit Fields2":{"main":[[{"node":"Merge","type":"main","index":3}]]},"Edit Fields3":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"My RSS 01","type":"main","index":0},{"node":"My RSS 02","type":"main","index":0},{"node":"My RSS 03","type":"main","index":0},{"node":"My RSS 04","type":"main","index":0}]]},"Send resum to  Whatsapp":{"main":[[{"node":"No Operation, do nothing","type":"main","index":0}]]}}}


name: Generate Landing Page Layouts from Competitor Analysis with GPT-4
author_name: Henry
author_username: henry
nodes_used: ["@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi"]
categories: []
created_at: 2025-06-06T07:48:52.208Z
updated_at: 2025-06-06T07:48:52.208Z
url: https://n8n.io/workflows/4717
scraped_at: 2025-07-06 21:16:30
description:
  Who is this for?

  This workflow is ideal for SEO specialists, web designers, and digital marketers who want to quickly draft effective landing page layouts by referencing established competitors. It suits users who need a fast, structured starting point for web design while ensuring competitive relevance.

  What problem is this workflow solving? / Use case

  Designing a high-converting landing page from scratch can be time-consuming. This workflow automates the process of analyzing a competitor’s website, identifying essential sections, and producing a tailored layout—helping users save time and improve their website’s effectiveness.

  What this workflow does

  The workflow fetches and analyzes your chosen competitor’s landing page, using web scraping and structure-detection nodes in n8n. It identifies primary sections like hero banners, service highlights, testimonials, and contact forms, and then generates a simplified, customizable layout suitable for wireframing or initial design.

  Setup

  Prepare your unique services and target audience profile for customization later.
  Gather the competitor’s landing page URL you wish to analyze.
  Run the workflow, inputting your competitor’s URL when prompted.

  How to customize this workflow to your needs

  After generating the initial layout, adapt section names and content blocks to highlight your services and brand messaging.
  Add or remove sections based on your objectives and audience insights.
  Integrate additional nodes for richer analysis, such as keyword extraction or design pattern detection, to tailor the output further.

workflow_json:
  {"id":"jw0iSqoXu4hKWAuj","meta":{"instanceId":"1af8a0dc0d2f537b7c08209af728c271b5a03806bdf309bedf99d668f2608ee6","templateCredsSetupCompleted":true},"name":"Create Landing Page Layouts with OpenAI GPT-4.1 from Competitor Analysis","tags":[],"nodes":[{"id":"8a674b3c-7544-49d5-8fd6-f96d74bc0991","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-180,-100],"parameters":{},"typeVersion":1},{"id":"6bed28c7-6383-4ec2-bc54-24c659faf413","name":"GenerateLayout","type":"@n8n/n8n-nodes-langchain.agent","position":[1036,-100],"parameters":{"text":"=## Input\nYou will be provided with:\n- Research outlines from other websites (summaries or structures of similar main pages) :  {{ $json.output }}\n- A list of services to be featured : {{ $('Set input data').item.json.my_services }}\n- A description of the target audience: {{ $('Set input data').item.json['my_target_audience '] }}\n## Role / Persona\nYou are a senior website content strategist, skilled at synthesizing competitive research, business offerings, and audience insights to design high-impact website main page structures.\n\n## Context\nA user is planning the main (home) page of a website. They have collected research outlines from similar websites, clarified the services to be highlighted, and defined the target audience. Your task is to recommend an effective main page outline that reflects best practices, showcases the services, and appeals to the intended audience.\n\n## Task / Instruction\n- Review the provided research outlines, list of services, and target audience description.\n- Synthesize this information to recommend a main page outline that is logical, engaging, and tailored to the target audience.\n- For each main section in your recommended outline, provide a brief description explaining its purpose and the type of content it should include.\n\n## Output Formatting / Style\nPresent your recommended main page outline as a bulleted list. For each main section, include:\n- The section title (in bold)\n- A concise description (one sentence) of the section’s content or function.\n\n## Additional Requirements\n- Focus only on the main (home) page structure.\n- Use clear, professional English.\n- Ensure the outline is relevant and appealing to the specified target audience.\n- Do not include subsections unless specifically requested.\n- Suitable for business or professional website planning.\n","options":{},"promptType":"define"},"typeVersion":1.9},{"id":"423ed9a0-e914-4d88-8148-acc41b199629","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-740,-380],"parameters":{"color":4,"width":500,"height":1000,"content":"## Create Landing Page Layouts with OpenAI GPT-4.1 from Competitor Analysis\n\n### Who is this for?\n\nThis workflow is ideal for SEO specialists, web designers, and digital marketers who want to quickly draft effective landing page layouts by referencing established competitors. It suits users who need a fast, structured starting point for web design while ensuring competitive relevance.\n\n### What problem is this workflow solving? / Use case\n\nDesigning a high-converting landing page from scratch can be time-consuming. This workflow automates the process of analyzing a competitor’s website, identifying essential sections, and producing a tailored layout—helping users save time and improve their website’s effectiveness.\n\n### What this workflow does\n\nThe workflow fetches and analyzes your chosen competitor’s landing page, using web scraping and structure-detection nodes in n8n. It identifies primary sections like hero banners, service highlights, testimonials, and contact forms, and then generates a simplified, customizable layout suitable for wireframing or initial design.\n\n### Setup\n\n- Prepare your unique services and target audience profile for customization later.\n- Gather the competitor’s landing page URL you wish to analyze.\n- Run the workflow, inputting your competitor’s URL when prompted.\n\n### How to customize this workflow to your needs\n\n- After generating the initial layout, adapt section names and content blocks to highlight your services and brand messaging.\n- Add or remove sections based on your objectives and audience insights.\n- Integrate additional nodes for richer analysis, such as keyword extraction or design pattern detection, to tailor the output further.\n"},"typeVersion":1},{"id":"b69a6ded-7495-4021-b150-e7e668a9f86c","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-30,-320],"parameters":{"width":400,"height":580,"content":"### Setup Initial Data\n\n- Prepare your unique services and target audience profile for customization later.\n- Gather the competitor’s landing page URL you wish to analyze."},"typeVersion":1},{"id":"e9e60657-2e08-4bf9-83dd-26ba10b531a7","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[400,-320],"parameters":{"color":3,"width":540,"height":580,"content":"### Analyzed Competitor Site Layout\n\nFetches and analyzes your chosen competitor’s landing page"},"typeVersion":1},{"id":"fe3e9edd-d50a-4e81-9a28-10cefaeeff10","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[960,-320],"parameters":{"width":440,"height":580,"content":"### Create Layouts Tailored to Your Services and Audience\n\n- Generate Layouts Tailored to Your Services and Target Audience\nIdentify the key sections needed for your landing page.\n- Next, use this output as input for wireframing or your initial design process."},"typeVersion":1},{"id":"63d34012-303a-40fd-93d6-0fc76fa93196","name":"Set input data","type":"n8n-nodes-base.set","position":[0,-100],"parameters":{"options":{},"assignments":{"assignments":[{"id":"950865ac-6e4d-4f31-bf0d-dc272c2c386a","name":"my_services","type":"string","value":"We provide an all-in-one data solution for AI development. It offers a SaaS platform for data collection, creation, and annotation on a monthly subscription model."},{"id":"12f40d6b-9894-415f-b43e-face74d74f81","name":"my_target_audience ","type":"string","value":"AI developers"},{"id":"138fefb6-cbc8-492e-930e-e9e4c990867f","name":"competitor_url","type":"array","value":"[\"https://competitor1.com/\", \"https://competitor2.com/\", \"https://competitor3.com/\", \"https://competitor4.com/\"]"}]}},"typeVersion":3.4},{"id":"2334badc-bb0a-4fe5-909e-d0409c1538a7","name":"Split competitor url","type":"n8n-nodes-base.splitOut","position":[220,-100],"parameters":{"options":{},"fieldToSplitOut":"competitor_url"},"typeVersion":1},{"id":"d69d09f2-a3d0-4ca6-8ff5-e45c4f6f8841","name":"Analyze competitor","type":"@n8n/n8n-nodes-langchain.agent","position":[440,-100],"parameters":{"text":"=## Role / Persona\nYou are a web content analyst with expertise in summarizing and structuring website information for quick reference.\n\n## Context\nA user needs a concise overview of the main sections of the website {{ $json.competitor_url }}. The user wants to understand the website’s structure without visiting it directly.\n\n## Task / Instruction\nVisit the  website and identify its main sections or navigation categories. List and briefly describe each primary section, focusing on the purpose and content of each area.\n\n## Output Formatting / Style\nPresent the output as a bulleted or numbered list. Use clear headings for each section, and provide a 1–2 sentence summary for each. Keep formatting clean and easy to scan.\n\n## Additional Requirements\n- Tone: Professional, concise, and informative  \n- Length: No more than 10 sections, each with a brief description  \n- Language: English  \n- Audience: Business professionals or developers seeking an overview of website’s offerings\n","options":{},"promptType":"define"},"typeVersion":1.9},{"id":"a6ea53ae-bc16-4415-a156-e9fb64fc632a","name":"OpenAI GPT 4.1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[528,120],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1","cachedResultName":"gpt-4.1"},"options":{}},"credentials":{"openAiApi":{"id":"8cWUJS0NExv35YHi","name":"OpenAi account"}},"typeVersion":1.2},{"id":"374416f3-d8de-4d0f-b426-7fffed8b62e9","name":"Aggregate analyzed result","type":"n8n-nodes-base.aggregate","position":[816,-100],"parameters":{"options":{},"fieldsToAggregate":{"fieldToAggregate":[{"fieldToAggregate":"output"}]}},"typeVersion":1},{"id":"6e2c5334-8a12-4348-ab15-abf35b8ad564","name":"OpenAI GPT 4.","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1124,120],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1","cachedResultName":"gpt-4.1"},"options":{}},"credentials":{"openAiApi":{"id":"8cWUJS0NExv35YHi","name":"OpenAi account"}},"typeVersion":1.2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"1d45e541-b0fd-4b0d-aa33-e14af63ca480","connections":{"OpenAI GPT 4.":{"ai_languageModel":[[{"node":"GenerateLayout","type":"ai_languageModel","index":0}]]},"OpenAI GPT 4.1":{"ai_languageModel":[[{"node":"Analyze competitor","type":"ai_languageModel","index":0}]]},"Set input data":{"main":[[{"node":"Split competitor url","type":"main","index":0}]]},"Analyze competitor":{"main":[[{"node":"Aggregate analyzed result","type":"main","index":0}]]},"Split competitor url":{"main":[[{"node":"Analyze competitor","type":"main","index":0}]]},"Aggregate analyzed result":{"main":[[{"node":"GenerateLayout","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Set input data","type":"main","index":0}]]}}}


name: Deep Research - Sales Lead Magnet Agent
author_name: Max Mitcham
author_username: maxmitcham
categories: []
created_at: 2025-06-06T12:18:33.114Z
updated_at: 2025-06-06T12:18:33.114Z
url: https://n8n.io/workflows/4721
scraped_at: 2025-07-06 21:16:30
description:
  Want to check out all my flows, follow me on:

  https://maxmitcham.substack.com/

  https://www.linkedin.com/in/max-mitcham/


  This automation flow is designed to generate comprehensive, research-backed lead magnet articles based on a user-submitted topic, conduct deep research across multiple sources, and automatically create a professional Google Doc ready for LinkedIn sharing.

  ⚙️ How It Works (Step-by-Step):

  📝 Chat Input (Entry Point)
  A user submits a topic through the chat interface:
  Topic for lead magnet content
  Target audience (automatically detected)
  Company context (when relevant)

  🔍 Query Builder Agent
  An AI agent refines the input by:
  Converting the topic into 5 targeted research queries
  Determining if topic relates to *company for specialized research
  Using structured output parsing for consistent results

  📚 Research Leader Agent
  Conducts comprehensive research that:
  Uses Perplexity API for real-time web research
  Integrates *company knowledge base when relevant
  Creates detailed table of contents with research insights
  Identifies key trends, expert opinions, and case studies

  📋 Project Planner Agent
  Structures the content by:
  Generating professional title and subtitle
  Creating 8-10 logical chapter outlines
  Developing detailed writing prompts for each section
  Ensuring step-by-step actionable guidance

  ✍️ Research Assistant Team
  Multiple AI agents write simultaneously:
  Each agent writes one chapter with proper citations
  Maintains consistent voice across all sections
  Includes real-world examples and implementation steps
  Uses both web research and *company knowledge

  📝 Editor Agent
  Professional content polishing:
  Refines tone for authenticity and engagement
  Adds image placeholders where appropriate
  Ensures proper flow between chapters
  Optimizes for LinkedIn lead magnet format

  📄 Google Docs Creation
  Automated document generation:
  Creates new Google Doc with formatted content
  Sets proper sharing permissions (public link)
  Organizes in designated company folder
  Returns shareable URL for immediate use

  🛠️ Tools Used:
  n8n: Workflow orchestration platform
  Anthropic Claude: Primary AI model for content generation
  OpenRouter: Backup AI model options
  Perplexity API: Real-time research capabilities
  *Company Knowledge Hub: Internal documentation access
  Google Docs API: Document creation and formatting
  Google Drive API: File management and sharing

  📦 Key Features:
  End-to-end automation from topic to published document
  Multi-agent approach ensures comprehensive coverage
  Real-time research with proper citations
  Company-specific knowledge integration
  Professional editing and formatting
  Automatic Google Docs creation with sharing
  Scalable content generation (3-5 minutes per article)

  🚀 Ideal Use Cases:
  B2B companies building thought leadership content
  Sales teams creating industry-specific lead magnets
  Marketing departments scaling content production
  Consultants developing expertise-demonstrating resources
  SaaS companies creating feature-focused educational content
  Startups establishing market presence without content teams
  `

nodes_used:
  ["n8n-nodes-base.googleDrive","n8n-nodes-base.googleDocs","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatAnthropic","@n8n/n8n-nodes-langchain.outputParserStructured","@n8n/n8n-nodes-langchain.toolWorkflow","@n8n/n8n-nodes-langchain.toolHttpRequest","@n8n/n8n-nodes-langchain.lmChatOpenRouter"]

workflow_json:
  {"id":"gMlV2BS7Aj3XlgCC","meta":{"instanceId":"[REDACTED_INSTANCE_ID]","templateCredsSetupCompleted":true},"name":"Lead Magnet Agent - Trigify","tags":[],"nodes":[{"id":"cfea2918-c8af-49a4-bfd0-c841a925c047","name":"Query Builder","type":"@n8n/n8n-nodes-langchain.agent","position":[2200,280],"parameters":{"text":"={{ $json.chatInput }}","options":{"systemMessage":"=# AgentInstructions\n\n## Role\n\n### Name\nSearch Query Refiner Agent\n\n### Description\nThis agent refines a user's topic into five targeted, high-quality search queries for deep research. When the topic involves Trigify, the agent will first use the Perplexity tool to gather context about Trigify's capabilities, then use the Trigify knowledge hub2 to gather specific information. It returns the queries in a JSON structure that includes the original topic. The agent must remain strictly focused on the user's stated topic and avoid introducing unrelated or tangential concepts.\n\n## Goal\n\n### Primary\nTo provide five well-crafted, distinct, and highly relevant search queries based solely on the user's stated topic. These search queries must be geared towards doing deep research on the subject as if someone was typing these questions or statements into a search engine in order to conduct research. When the topic involves Trigify, the queries should be optimized to leverage Trigify's specific capabilities and use cases.\n\n## Instructions\n\n1. **Analyze User Input**:\n   - Identify the exact concepts or keywords in the user's topic\n   - Determine if the topic mentions or relates to Trigify\n   - Do NOT introduce new or tangential themes unless explicitly included in the user's topic\n\n2. **For Trigify-Related Topics**:\n   - First call the Perplexity tool to gather general information about what Trigify does, its features, and typical use cases\n   - Then call the Trigify knowledge hub2 to gather specific information about Trigify's capabilities relevant to the user's topic\n   - Use this gathered information to craft more targeted and effective queries\n\n3. **Maintain Topic Focus**:\n   - Avoid generalizing or substituting terms that alter the user's focus\n   - If the user specifically mentions certain aspects of Trigify (e.g., \"booking meetings\"), keep that exact focus\n\n4. **Generate Queries**:\n   - Create exactly five unique search queries\n   - Each query should include:\n     - The main keywords from the user's input\n     - Minor variations or synonyms that preserve the same narrow focus\n     - For Trigify topics: specific features, methodologies, or use cases discovered from the knowledge tools\n\n5. **Output Format**:\n   - Return the final result as JSON:\n   ```json\n   {\n     \"topic\": \"USER_INPUT_TOPIC\",\n     \"searchQueries\": [\n       \"QUERY_1\",\n       \"QUERY_2\",\n       \"QUERY_3\",\n       \"QUERY_4\",\n       \"QUERY_5\"\n     ]\n   }\n   ```\n\n6. **Respect Research Scope**:\n   - Stay within the user's desired research scope\n   - For non-Trigify topics, avoid adding any reference to Trigify\n   - For Trigify topics, ensure queries are relevant to creating effective lead magnets about Trigify's capabilities\n\n## Examples\n\n### Example 1 (Trigify-related)\n\n#### UserInput\nBuild a Lead Magnet on how you can use Trigify to book 30+ meetings per week\n\n#### Agent Process\n1. Identifies this is a Trigify-related topic\n2. Calls Perplexity tool to understand Trigify's basic functionality\n3. Calls Trigify knowledge hub2 to gather specific information about meeting booking features\n4. Crafts specialized queries focused on Trigify's meeting booking capabilities\n\n#### AgentOutput\n```json\n{\n  \"topic\": \"Build a Lead Magnet on how you can use Trigify to book 30+ meetings per week\",\n  \"searchQueries\": [\n    \"Trigify outreach automation strategies for booking 30+ weekly meetings\",\n    \"Trigify sequencing templates for high-volume meeting conversion\",\n    \"Optimizing Trigify campaigns for maximum meeting bookings\",\n    \"Trigify prospect targeting techniques for sales meeting generation\",\n    \"Trigify analytics to improve meeting booking rates\"\n  ]\n}\n```\n\n### Example 2 (Non-Trigify)\n\n#### UserInput\nquantum computing hardware\n\n#### AgentOutput\n```json\n{\n  \"topic\": \"quantum computing hardware\",\n  \"searchQueries\": [\n    \"quantum computing hardware architecture\",\n    \"latest developments in quantum processors\",\n    \"superconducting qubits hardware advancements\",\n    \"ion trap quantum computing devices\",\n    \"scalability challenges quantum hardware research\"\n  ]\n}\n```\n\n### Example 3 (Trigify-related)\n\n#### UserInput\nusing Trigify for LinkedIn outreach\n\n#### Agent Process\n1. Identifies this is a Trigify-related topic\n2. Uses knowledge tools to understand Trigify's LinkedIn capabilities\n3. Crafts specialized queries focused on Trigify's LinkedIn features\n\n#### AgentOutput\n```json\n{\n  \"topic\": \"using Trigify for LinkedIn outreach\",\n  \"searchQueries\": [\n    \"Trigify LinkedIn connection request automation best practices\",\n    \"Trigify personalization techniques for LinkedIn messaging\",\n    \"Trigify campaign analytics for LinkedIn outreach optimization\",\n    \"Trigify LinkedIn profile targeting strategies\",\n    \"Comparing Trigify LinkedIn outreach performance to manual methods\"\n  ]\n}\n```"},"promptType":"define","hasOutputParser":true},"typeVersion":1.7},{"id":"3b82df55-0e26-4bf6-b366-e5525758ca86","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[2500,440],"parameters":{"jsonSchemaExample":"{\n  \"topic\": \"USER_INPUT_TOPIC\",\n  \"searchQueries\": [\n    \"QUERY_1\",\n    \"QUERY_2\",\n    \"QUERY_3\",\n    \"QUERY_4\",\n    \"QUERY_5\"\n  ]\n}"},"typeVersion":1.2},{"id":"03c1d654-5e0b-4232-9c0e-fb905494ecd7","name":"Research Leader","type":"@n8n/n8n-nodes-langchain.agent","position":[2600,280],"parameters":{"text":"=Research the following topics:\n{{ $json.output.searchQueries[0] }}\n{{ $json.output.searchQueries[1] }}\n{{ $json.output.searchQueries[2] }}\n{{ $json.output.searchQueries[3] }}\n{{ $json.output.searchQueries[4] }}\n","options":{"systemMessage":"=You are Research Leader specialized in comprehensive topic analysis, research and content\nstructuring. Your task is to create an enriched, research-backed table of contents for a given topic.\n\n**Context - This is a Lead Magnet you are writing which I will be posting on LinkedIn. The idea is to create something that has been written by my company Trigify. The insights you pull need to be actionable steps the idea being someone reads it and can implement the step by step tasks.**\n\nFollow these steps:\n1. Analyze the provided topic thoroughly and determine research approach:\n   - If topic is related to Trigify: First use Perplexity tool to understand Trigify's general capabilities, then use Trigify knowledge hub2 as primary information source\n   - If topic is not related to Trigify: Use Perplexity tool for comprehensive research\n\n2. Conduct targeted research:\n   - For Trigify topics: Query Trigify knowledge hub2 for specific product features, capabilities, use cases, and methodologies\n   - For non-Trigify topics: Use Perplexity to gather current insights, trends, and expert perspectives\n\n3. Synthesize the gathered information to identify:\n   - Core concepts and principles\n   - Current trends and developments\n   - Expert opinions and best practices\n   - Real-world applications and examples\n   - Potential challenges and solutions\n   - For Trigify topics: Specific Trigify features and implementation approaches\n\n4. Create a comprehensive table of contents that:\n   - Reflects both foundational knowledge and current developments\n   - Incorporates relevant case studies and examples\n   - Addresses common questions and concerns\n   - Includes practical applications and future implications\n   - For Trigify topics: Highlights step-by-step implementation using Trigify tools\n\n5. Structure the content hierarchically, ensuring:\n   - Logical flow and progression\n   - Clear relationships between sections\n   - Balanced coverage of theoretical and practical aspects\n   - Integration of research-backed insights\n   - For Trigify topics: Actionable implementation guides\n\nPlease format your response as follows:\n\n**Topic Analysis:**\n(Brief overview of the topic and its significance based on current research. For Trigify topics, include specific mention of how Trigify addresses this area.)\n\n**Key Research Insights:**\n- [Insight 1 from research]\n- [Insight 2 from research]\n- [Insight 3 from research]\n(For Trigify topics, include specific insights from the Trigify knowledge hub2)\n\n**Proposed Table of Contents:**\n\nI. **Introduction**\n   A. Topic Overview and Current Relevance  \n   B. Key Trends and Developments  \n   C. Why This Matters Now  \n\nII. **Background and Context**  \n   A. Historical Development  \n   B. Fundamental Concepts  \n   C. Current State of the Field  \n\nIII. **[Main Theme 1 from Research]**  \n   A. [Key Finding/Aspect]  \n   B. [Expert Perspectives]  \n   C. [Real-world Applications]  \n\nIV. **[Main Theme 2 from Research]**  \n   A. [Key Finding/Aspect]  \n   B. [Case Studies]  \n   C. [Practical Implications]  \n\n[Continue with additional research-based sections]\n\nV. **Future Perspectives**  \n   A. Emerging Trends  \n   B. Potential Developments  \n   C. Recommendations  \n\nVI. **Conclusion**  \n   A. Summary of Key Insights  \n   B. Actionable Takeaways  \n   C. Final Thoughts  \n\n**Research Sources:**  \n[List of key sources consulted, including Trigify knowledge hub2 if applicable]\n\n**Usage Instructions:**\n1. Provide a specific topic you want to analyze.\n2. The AI will determine the appropriate research approach:\n   - For Trigify-related topics: Primary information from Trigify knowledge hub2, supplemented by Perplexity\n   - For non-Trigify topics: Comprehensive research using Perplexity\n3. Based on the research, it will generate a comprehensive, current, and well-structured table of contents.\n4. Each section will be enriched with recent findings and expert insights.\n5. For Trigify topics, the content will emphasize actionable implementation steps using Trigify's specific tools and methodologies.\n6. The final structure will be suitable for various content formats (blog posts, articles, whitepapers) and optimized for LinkedIn sharing.\n\nToday's date is {{ $now }}"},"promptType":"define"},"typeVersion":1.7},{"id":"e12e7905-fe99-4b01-b364-139b77ca9a43","name":"Perplexity tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[3200,1000],"parameters":{"name":"Perplexity_tool","workflowId":{"__rl":true,"mode":"list","value":"[REDACTED_WORKFLOW_ID]","cachedResultName":"Trigify Agents — My Sub-Workflow 2"},"description":"Call this tool to run your research.","workflowInputs":{"value":{},"schema":[],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2},{"id":"8ec3e1d0-40fd-4594-97de-def75959f693","name":"Project Planner","type":"@n8n/n8n-nodes-langchain.agent","position":[2960,280],"parameters":{"text":"=Write the title, the subtitle, the chapters details, the introduction, the conclusions.\nPlease use this set of topics to create chapters:  \n{{ $json.output }}\n\n### Research Process\n1. Analyze the provided topics thoroughly and determine research approach:\n   - If topics are related to Trigify: First use Perplexity tool to understand Trigify's general capabilities, then use Trigify knowledge hub2 as primary information source\n   - If topics are not related to Trigify: Use Perplexity tool for comprehensive research\n\n2. Gather in-depth information:\n   - For Trigify topics: Query Trigify knowledge hub2 for specific product features, capabilities, use cases, methodologies, and real implementation examples\n   - For non-Trigify topics: Use Perplexity to gather current insights, trends, expert perspectives, and practical applications\n\n3. Ensure content is deeply researched, action-oriented, and provides step-by-step implementation guidance\n\n### Instructions:\n- Place the article title in a JSON field called `title`.\n- Place the subtitle in a JSON field called `subtitle`.\n- Place the introduction in a JSON field called `introduction`.\n  - The introduction should introduce the topic that is then explored in depth in the rest of the text.\n  - The introduction should be around 100 words.\n  - For Trigify topics: Highlight Trigify's unique approach to solving the problem\n- Place the conclusions in a JSON field called `conclusions`.\n  - The conclusions should be around 100 words.\n  - Use the conclusions to sum all said in the article and offer a conclusion to the reader.\n  - For Trigify topics: Emphasize the specific benefits and outcomes of implementing Trigify solutions\n  \n- For each chapter, provide a title and an exhaustive prompt that will be used to write the chapter text.\n  - Place the chapters in an array field called `chapters`.\n  - For each chapter, provide the fields `\"title\"` and `\"prompt\"`.\n  - The chapters should follow a logical flow and not repeat the same concepts.\n  - The chapters should be one related to the other and not isolated blocks of text.\n  - The text should be fluent and follow a linear logic.\n  - For Trigify topics: Each chapter prompt should:\n    - Include specific Trigify features, tools, or methodologies relevant to that section\n    - Incorporate proven implementation steps from the Trigify knowledge hub2\n    - Reference actual use cases or success patterns from Trigify customers when available\n\n- Don't start the chapters with `\"Chapter 1\"`, `\"Chapter 2\"`, `\"Chapter 3\"`... just write the title of the chapter.\n- For the title and the chapters' titles, don't use colons `(:)`.\n- Please use this text format.\n- Please write in a style that is informative and instructional so the user can follow your advice and action what you're saying, they need step by step breakdowns on how to execute on what you're saying.\n- Go deep into the topic you treat, don't just throw some superficial info.\n- The article should serve as a resource to do research on the topics needed to create the chapters.\n- Ensure each chapter prompt guides the creation of content that contains:\n  - Clear, numbered step-by-step instructions where applicable\n  - Specific implementation details and technical guidance\n  - Common pitfalls to avoid and how to overcome them\n  - Metrics for measuring success\n  - For Trigify topics: Specific Trigify configurations, settings, or workflows\n\n**Today's date is {{ $now }}**\n**Context - This is a Lead Magnet you are writing which I will be posting on LinkedIn. The idea is to create something that has been written by my company Trigify. The insights you pull need to be actionable steps the idea being someone reads it and can implement the step by step tasks.**","options":{},"promptType":"define","hasOutputParser":true},"typeVersion":1.7},{"id":"8e8f243a-6cb8-44ca-a9ec-e20f78561d34","name":"Structured Output Parser1","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[3260,520],"parameters":{"jsonSchemaExample":"{\n  \"title\": \"Dynamic AI-Generated Content Example\",\n  \"subtitle\": \"A Flexible JSON Structure for AI Content Creation\",\n  \"introduction\": \"This JSON example demonstrates a structured yet flexible approach for AI-generated content. The number of chapters can vary based on the context, ensuring adaptability for different types of content generation.\",\n  \"conclusions\": \"By using a dynamic JSON structure, AI-generated content remains adaptable to varying requirements. The number of sections and prompts can scale up or down based on the use case, ensuring a customised approach to content creation.\",\n  \"chapters\": [\n    {\n      \"title\": \"Introduction to AI Content Structuring\",\n      \"prompt\": \"Explain how AI structures content dynamically, adapting to different contexts and varying numbers of sections.\"\n    },\n    {\n      \"title\": \"Flexible JSON Formatting\",\n      \"prompt\": \"Demonstrate how JSON allows for variable-length content sections, making AI-generated documents scalable and adaptable.\"\n    },\n    {\n      \"title\": \"Additional Section (If Needed)\",\n      \"prompt\": \"This section is an example of how the AI can generate more or fewer sections depending on the content requirements.\"\n    }\n  ]\n}"},"typeVersion":1.2},{"id":"b95713f5-dd63-458e-991e-c0fb85ed35f1","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[3320,280],"parameters":{"options":{},"fieldToSplitOut":"output.chapters"},"typeVersion":1},{"id":"b75f2e21-dce5-4d04-b5c7-769cae617e47","name":"Team of Research Assistants","type":"@n8n/n8n-nodes-langchain.agent","position":[3520,280],"parameters":{"text":"=Write a chapter for this article -> {{ $('Project Planner').item.json.output.title }}\n\nwrite a chapter for -> {{ $json.title }} that {{ $json.prompt }}\n\nMake sure to use the Trigify knowledge hub.","options":{"systemMessage":"=You are a dedicated Research Assistant AI agent, working as part of a research team under the guidance of a Research Leader and Project Planner. Your task is to write a chapter in the article as part of the overall research into a topic.\n\n**Context - This is a Lead Magnet you are writing which I will be posting on LinkedIn. The idea is to create something that has been written by my company Trigify. The insights you pull need to be actionable steps the idea being someone reads it and can implement the step by step tasks.**\n\nGuidelines:\n- Just return the plain text for each chapter (no JSON structure).\n- Use the perplexity_ai_search tool to research the topic in the chapter.\n- Use html format for output\n- Don't add internal titles or headings.\n- The length of each chapter should be around 120 words\nwords long—go deep in the topic you treat, don't just throw some superficial info.\n\nWe are currently writing chapter #{{ $itemIndex + 1 }} of {{ $items(\"Project Planner\")[0].json.output.chapters.length }}.\n\nPrevious chapter:\n{{ $itemIndex > 0 ? $items(\"Project Planner\")[0].json.output.chapters[$itemIndex - 1].title : \"None\" }}\n\nNext chapter:\n{{ $itemIndex < $items(\"Project Planner\")[0].json.output.chapters.length - 1 ? $items(\"Project Planner\")[0].json.output.chapters[$itemIndex + 1].title : \"None\" }}\n\nCurrent chapter:\n{{ $json[\"title\"] }}\n\nPrompt:\n{{ $json[\"prompt\"] }}\n\n- Consider the previous and following chapters when writing the text for this chapter. The text must be coherent with the previous and following chapters.\n- This chapter should not repeat the concepts already exposed in the previous chapter.\n- This chapter is part of a larger article so don't include an introduction or conclusions. This chapter should merge seamlessly with the rest of the article.\n- Please write in a style that is educational for the user so they can follow your advice step by step and action your research.\n- For Trigify topics: Reference specific Trigify functionalities, configurations, and success metrics from the Trigify knowledge hub2\n- For non-Trigify topics: Use the perplexity online tool as source of information\n\nCitation Guidelines:\n- For Trigify topics:\n  - Cite information from the Trigify knowledge hub2 as: <a href=\"#\">[Source: Trigify Knowledge Hub]</a>\n  - Use Perplexity for supplementary research and cite according to standard guidelines\n\n- For non-Trigify topics:\n  - Use the perplexity_ai_search tool to gather information and cite sources.\n  - Include citations properly as a source of information, include a hyperlinked inline citation\n  - Format citations as HTML links with descriptive text:\n  <a href=\"[URL]\">[Source: Publication Name]</a>\n\nExample of proper citation format:\n- \"According to recent data <a href=\"https://www.mckinsey.com/article-url\">[Source: McKinsey & Company]</a>...\"\n- When directly quoting from a source, use quotation marks and include the citation\n\nFor Trigify topics, ensure the chapter includes:\n- Specific Trigify features or tools relevant to the topic\n- Step-by-step implementation guidance using Trigify\n- Real-world applications or success metrics from Trigify users\n- Technical details on configuration or setup where applicable"},"promptType":"define"},"typeVersion":1.7},{"id":"808845ba-f350-41c9-add3-4ee6412327db","name":"Merge","type":"n8n-nodes-base.merge","position":[3900,280],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3},{"id":"8882948d-a1d5-40a4-947d-ca219a41b540","name":"Code","type":"n8n-nodes-base.code","position":[4060,280],"parameters":{"jsCode":"const mergeData = $input.all().map((item) => item.json);\nconst combinedData = [];\n\nmergeData.forEach((item) => {\n  combinedData.push(item.title, item.output);\n});\n\nreturn { combinedData };\n"},"typeVersion":2},{"id":"a450f61c-2ff7-4ca5-8bb1-01b684d5eecb","name":"Editor","type":"@n8n/n8n-nodes-langchain.agent","position":[4240,280],"parameters":{"text":"=Edit this text into a nice article: {{ $json.combinedData }}\n\n**Context - This is a Lead Magnet you are writing which I will be posting on LinkedIn. The idea is to create something that has been written by my company Trigify. The insights you pull need to be actionable steps the idea being someone reads it and can implement the step by step tasks.**\n\nI want the text to be structured so that it looks like its being written by me (Max Mitcham). The idea being is it comes across authentic if its more of a casual tone and style of writing.","options":{"systemMessage":"=# Expert Editing Guidelines\n\nYou are an expert Editor specializing in refining and polishing content to ensure it meets the highest quality standards. Your role is to review and improve the written material produced by multiple writers while maintaining academic integrity and proper source attribution. Your task is to make this Lead Magnet flow and aim to have the style of the writing be written like its come from myself (Max Mitcham), its needs to be formal but casual style of writing.\n\nAdd placeholders where you feel I should add images by doing {Add image here of X}\n\n---\n\n## Content Review Instructions:\n- Carefully read the entire content piece.\n- Check for grammar, spelling, and punctuation errors.\n- Ensure consistency in tone, style, and voice throughout the piece.\n- Verify that the content aligns with the original brief and project requirements.\n- Improve sentence structure and flow for better readability.\n- Optimize headlines, subheadings, and formatting for better engagement, especially for SEO.\n- Suggest improvements or additions to enhance the overall quality of the content.\n\n---\n"},"promptType":"define","hasOutputParser":true},"typeVersion":1.7},{"id":"9bb23d1e-d081-4f5d-afbd-d8e508edc529","name":"Google Docs","type":"n8n-nodes-base.googleDocs","position":[4560,280],"parameters":{"title":"={{ $node[\"Project Planner\"].json[\"output\"][\"title\"] }}","folderId":"[REDACTED_FOLDER_ID]"},"credentials":{"googleDocsOAuth2Api":{"id":"[REDACTED_GOOGLE_DOCS_CRED_ID]","name":"Google Docs account"}},"typeVersion":2},{"id":"cad19eda-3b87-492b-bac8-aebdc3eed6da","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[2000,340],"webhookId":"[REDACTED_WEBHOOK_ID]","parameters":{"options":{}},"typeVersion":1.1},{"id":"f511b20b-3d6d-4e9a-87af-31e818ca1c66","name":"Trigify knowledge hub","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[3760,520],"parameters":{"url":"https://www.chatbase.co/api/v1/chat","method":"POST","jsonBody":"{\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"{placeholder}\"\n    }\n  ],\n  \"chatbotId\": \"[REDACTED_CHATBOT_ID]\",\n  \"stream\": false,\n  \"temperature\": 0,\n  \"model\": \"claude-3-5-sonnet\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","toolDescription":"Trigify knowledge hub.","parametersHeaders":{"values":[{"name":"Authorization","value":"Bearer [REDACTED_API_TOKEN]","valueProvider":"fieldValue"},{"name":"Content-Type","value":"application/json","valueProvider":"fieldValue"}]}},"typeVersion":1.1},{"id":"f147b256-b05e-4cbc-ba6a-aa95e6f35df8","name":"Anthropic Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[2860,960],"parameters":{"model":"=claude-3-7-sonnet-20250219","options":{}},"credentials":{"anthropicApi":{"id":"[REDACTED_ANTHROPIC_CRED_ID]","name":"Anthropic account 3"}},"typeVersion":1.2},{"id":"376247a1-3cea-45a8-b7d2-8589ca85e710","name":"Share URL","type":"n8n-nodes-base.set","position":[5040,280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"ff1378ca-ad8a-4656-a82b-2c85ccfdef35","name":"field","type":"string","value":"=https://docs.google.com/document/d/{{ $('Google Docs1').item.json.documentId }}"},{"id":"11b66d56-cc3b-48ec-bee4-58f44340258d","name":"body['First Name']","type":"string","value":"={{ $node[\"Webhook\"].json[\"body\"][\"First Name\"] }}"},{"id":"03a9b312-31cb-4ec6-85a6-e75470e3392a","name":"body['Last Name']","type":"string","value":"={{ $node[\"Webhook\"].json[\"body\"][\"Last Name\"] }}"},{"id":"81f75a32-494c-4b4c-90b5-bbb0a903ae45","name":"body.Domain","type":"string","value":"={{ $node[\"Webhook\"].json[\"body\"][\"Domain\"] }}"},{"id":"c3bd15a0-d0f2-4ea6-bce4-cda3448fc112","name":"body['Full Name']","type":"string","value":"={{ $node[\"Webhook\"].json[\"body\"][\"Full Name\"] }}"},{"id":"5677ab97-6d17-4911-bebf-6582ddee31e7","name":"body['LinkedIn Url']","type":"string","value":"={{ $node[\"Webhook\"].json[\"body\"][\"LinkedIn Url\"] }}"}]}},"typeVersion":3.4},{"id":"f704a1c4-04ed-40cf-a9d2-49f60c2fa249","name":"Google Drive","type":"n8n-nodes-base.googleDrive","position":[4880,280],"parameters":{"fileId":{"__rl":true,"mode":"id","value":"={{ $json.documentId }}"},"options":{},"operation":"share","permissionsUi":{"permissionsValues":{"role":"reader","type":"anyone"}}},"credentials":{"googleDriveOAuth2Api":{"id":"[REDACTED_GOOGLE_DRIVE_CRED_ID]","name":"Google Drive account 2"}},"typeVersion":3},{"id":"78e3fb39-f170-4c71-8e69-4661625306a0","name":"Google Docs1","type":"n8n-nodes-base.googleDocs","position":[4720,280],"parameters":{"actionsUi":{"actionFields":[{"text":"={{ $('Editor').item.json.output }}","action":"insert"}]},"operation":"update","documentURL":"={{ $json.id }}"},"credentials":{"googleDocsOAuth2Api":{"id":"[REDACTED_GOOGLE_DOCS_CRED_ID]","name":"Google Docs account"}},"typeVersion":2},{"id":"65fd6aac-d362-47bc-b587-a0cd2879127e","name":"Trigify knowledge hub2","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[3340,960],"parameters":{"url":"https://www.chatbase.co/api/v1/chat","method":"POST","jsonBody":"{\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"{placeholder}\"\n    }\n  ],\n  \"chatbotId\": \"[REDACTED_CHATBOT_ID]\",\n  \"stream\": false,\n  \"temperature\": 0,\n  \"model\": \"claude-3-5-sonnet\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","toolDescription":"Trigify knowledge hub.","parametersHeaders":{"values":[{"name":"Authorization","value":"Bearer [REDACTED_API_TOKEN]","valueProvider":"fieldValue"},{"name":"Content-Type","value":"application/json","valueProvider":"fieldValue"}]}},"typeVersion":1.1},{"id":"9f0f2812-6d07-4dc6-a3aa-51bae2eaa4d8","name":"OpenRouter Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenRouter","position":[3560,940],"parameters":{"model":"anthropic/claude-3.7-sonnet:thinking","options":{}},"credentials":{"openRouterApi":{"id":"[REDACTED_OPENROUTER_CRED_ID]","name":"OpenRouter account"}},"typeVersion":1},{"id":"a6767ecb-c27c-4dc7-8fef-349f89f38bec","name":"Anthropic Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[4180,520],"parameters":{"model":"=claude-3-7-sonnet-20250219","options":{}},"credentials":{"anthropicApi":{"id":"[REDACTED_ANTHROPIC_CRED_ID]","name":"Anthropic account 3"}},"typeVersion":1.2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"4c18541d-66e2-4c4e-a28b-7d66227767fa","connections":{"Code":{"main":[[{"node":"Editor","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Code","type":"main","index":0}]]},"Editor":{"main":[[{"node":"Google Docs","type":"main","index":0}]]},"Share URL":{"main":[[]]},"Split Out":{"main":[[{"node":"Team of Research Assistants","type":"main","index":0},{"node":"Merge","type":"main","index":0}]]},"Google Docs":{"main":[[{"node":"Google Docs1","type":"main","index":0}]]},"Google Docs1":{"main":[[{"node":"Google Drive","type":"main","index":0}]]},"Google Drive":{"main":[[{"node":"Share URL","type":"main","index":0}]]},"Query Builder":{"main":[[{"node":"Research Leader","type":"main","index":0}]]},"Perplexity tool":{"ai_tool":[[{"node":"Query Builder","type":"ai_tool","index":0},{"node":"Research Leader","type":"ai_tool","index":0},{"node":"Project Planner","type":"ai_tool","index":0},{"node":"Team of Research Assistants","type":"ai_tool","index":0}]]},"Project Planner":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"Research Leader":{"main":[[{"node":"Project Planner","type":"main","index":0}]]},"Anthropic Chat Model":{"ai_languageModel":[[{"node":"Editor","type":"ai_languageModel","index":0}]]},"Anthropic Chat Model1":{"ai_languageModel":[[{"node":"Research Leader","type":"ai_languageModel","index":0}]]},"Trigify knowledge hub":{"ai_tool":[[{"node":"Team of Research Assistants","type":"ai_tool","index":0}]]},"OpenRouter Chat Model1":{"ai_languageModel":[[{"node":"Query Builder","type":"ai_languageModel","index":0},{"node":"Project Planner","type":"ai_languageModel","index":0},{"node":"Team of Research Assistants","type":"ai_languageModel","index":0}]]},"Trigify knowledge hub2":{"ai_tool":[[{"node":"Query Builder","type":"ai_tool","index":0},{"node":"Research Leader","type":"ai_tool","index":0},{"node":"Project Planner","type":"ai_tool","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Query Builder","type":"ai_outputParser","index":0}]]},"Structured Output Parser1":{"ai_outputParser":[[{"node":"Project Planner","type":"ai_outputParser","index":0}]]},"When chat message received":{"main":[[{"node":"Query Builder","type":"main","index":0}]]},"Team of Research Assistants":{"main":[[{"node":"Merge","type":"main","index":1}]]}}}


name: Gmail AI Email Manager
author_name: Max Mitcham
author_username: maxmitcham
categories: []
created_at: 2025-06-06T12:20:00.982Z
updated_at: 2025-06-06T12:20:00.982Z
url: https://n8n.io/workflows/4722
scraped_at: 2025-07-06 21:16:30
description:
  Want to check out all my flows, follow me on:

  https://maxmitcham.substack.com/

  https://www.linkedin.com/in/max-mitcham/

  Email Manager - Intelligent Gmail Classification

  This automation flow is designed to automatically monitor incoming Gmail messages, analyze their content and context using AI, and intelligently classify them with appropriate labels for better email organization and prioritization.

  ⚙️ How It Works (Step-by-Step):

  📧 Gmail Monitoring (Trigger)
  Continuously monitors your Gmail inbox:
  Polls for new emails every minute
  Captures all incoming messages automatically
  Triggers workflow for each new email received

  📖 Email Content Extraction
  Retrieves complete email details:
  Full email body and headers
  Sender information and recipient lists
  Subject line and metadata
  Existing Gmail labels and categories
  Email threading information (replies/forwards)

  🔍 Email History Analysis
  AI agent checks relationship context:
  Searches for previous emails from the same sender
  Checks sent folder for prior outbound correspondence
  Determines if this is a first-time contact (cold email)
  Analyzes conversation thread history

  🤖 Intelligent Classification Agent
  Advanced AI categorization using:
  Claude Sonnet 4 for sophisticated email analysis
  Context-aware classification based on email history
  Content analysis for intent and urgency detection
  Header analysis for automated vs. human-sent emails

  🏷️ Smart Label Assignment
  Automatically applies appropriate Gmail labels:
  To Respond: Requires direct action/reply
  FYI: For awareness, no action needed
  Notification: Service updates, policy changes
  Marketing: Promotional content and sales pitches
  Meeting Update: Calendar-related communications
  Comment: Document/task feedback

  📋 Structured Processing
  Ensures consistent labeling:
  Uses structured output parsing for reliability
  Returns specific Label ID for Gmail integration
  Applies label automatically to the email
  Maintains classification accuracy

  🛠️ Tools Used:
  n8n: Workflow automation platform
  Gmail API: Email monitoring and label management
  Anthropic Claude: Advanced email content analysis
  Gmail Tools: Email history checking and search
  Structured Output Parser: Consistent AI responses

  📦 Key Features:
  Real-time email monitoring and classification
  Context-aware analysis using email history
  Intelligent cold vs. warm email detection
  Multiple classification categories for organization
  Automatic Gmail label application
  Header analysis for automated email detection
  Thread-aware conversation tracking

  🚀 Ideal Use Cases:
  Busy executives managing high email volumes
  Sales professionals prioritizing prospect communications
  Support teams organizing customer inquiries
  Marketing teams filtering promotional content
  Anyone wanting automated email organization
  Teams needing consistent email prioritization
  `

nodes_used:
  ["n8n-nodes-base.gmail","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatAnthropic","@n8n/n8n-nodes-langchain.outputParserStructured"]

workflow_json:
  {"id":"uf6t5qhnQMgilteE","meta":{"instanceId":"[REDACTED_INSTANCE_ID]","templateCredsSetupCompleted":true},"name":"Email Manager","tags":[{"id":"[REDACTED_TAG_ID]","name":"Personal Assistant","createdAt":"2025-05-28T13:58:43.876Z","updatedAt":"2025-05-28T13:58:43.876Z"}],"nodes":[{"id":"5e01a927-caf7-41ad-aca7-d7504e313564","name":"Gmail Trigger","type":"n8n-nodes-base.gmailTrigger","position":[-20,-60],"parameters":{"filters":{},"pollTimes":{"item":[{"mode":"everyMinute"}]}},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID]","name":"Gmail account"}},"typeVersion":1.2},{"id":"a8644856-a8bf-49de-84a7-3fd9f93550d3","name":"Gmail","type":"n8n-nodes-base.gmail","position":[200,-20],"webhookId":"[REDACTED_WEBHOOK_ID]","parameters":{"simple":false,"options":{},"messageId":"={{ $json.id }}","operation":"get"},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID]","name":"Gmail account"}},"typeVersion":2.1},{"id":"f6ddae9f-303b-46cd-980d-1d46fc4ecbec","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1000,100],"parameters":{"jsonSchemaExample":"{\n\t\"label\": \"Label name\", \n\"label ID\": \"label ID\" \n}"},"typeVersion":1.2},{"id":"cc6b0990-a778-4199-a0fe-80c83dfb9934","name":"Gmail1","type":"n8n-nodes-base.gmail","position":[1020,-220],"webhookId":"[REDACTED_WEBHOOK_ID]","parameters":{"labelIds":"={{ $json.output['label ID'] }}","messageId":"={{ $('Gmail').item.json.id }}","operation":"addLabels"},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID]","name":"Gmail account"}},"typeVersion":2.1},{"id":"f47e8e55-f634-417f-b62f-60e47af71827","name":"Anthropic Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[380,160],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-sonnet-4-20250514","cachedResultName":"Claude Sonnet 4"},"options":{}},"credentials":{"anthropicApi":{"id":"[REDACTED_ANTHROPIC_CRED_ID]","name":"Anthropic account 3"}},"typeVersion":1.3},{"id":"b0ed86c7-5ddd-48dc-aa93-5c4d5c1cacf7","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[500,-140],"parameters":{"text":"Run the task.","options":{"systemMessage":"=**Objective:** Analyze the provided email data and classify it with the most appropriate label. **Utilize the capability to check for prior email history (emails sent to or received from the sender by `[REDACTED_EMAIL]`)** to determine if this is a first-time interaction (cold email) or part of an existing relationship. This context is crucial for accurate labeling, especially for distinguishing between Marketing, Notifications, and FYI. Respond with *only* the corresponding Label ID.\n\n**Your Email Address (for context):** `[REDACTED_EMAIL]`\n\n**Key Capabilities (to be used by the system executing this prompt):**\n* **Check Prior Email History:** Before full classification, determine if any prior email correspondence exists between `[REDACTED_EMAIL]` and `{{ $json.from.value[0].address }}`. This check should yield \"Yes\" (history exists) or \"No\" (no history found).\n\n**Input Email Data (from n8n JSON item for the *current* email):**\n* **Sender Email:** `{{ $json.from.value[0].address }}`\n* **Sender Name:** `{{ $json.from.value[0].name }}`\n* **Direct Recipient Emails (To):** `{{ $json.to.value.map(r => r.address).join(', ') }}`\n* **CC Recipient Emails:** `{{ $json.cc.value.map(r => r.address).join(', ') }}` *(Added this based on your JSON, use if populated)*\n* **Subject:** `{{ $json.subject }}`\n* **Body (Plain Text):** `{{ $json.text }}`\n* **Existing Gmail Labels (for current email):** `{{ $json.labelIds.join(', ') }}`\n* **Auto-Submitted Header:** `{{ $json.headers['auto-submitted'] }}`\n* **Original Sender Header (if different from From):** `{{ $json.headers.sender }}`\n* **In-Reply-To Header (for current email):** `{{ $json.headers['in-reply-to'] }}`\n* **References Header (for current email):** `{{ $json.headers.references }}`\n* **List-Unsubscribe Header:** `{{ $json.headers['list-unsubscribe'] }}`\n* **Precedence Header:** `{{ $json.headers.precedence }}` (e.g., \"Bulk\")\n\n**Labels, Descriptions, and Prioritization Logic:**\n\n**Guidance on Using Prior Email History & Unsubscribe Links:**\n* **Prior Email History = \"No\":** Strong indicator of a **cold/unsolicited email**.\n    * If promotional/sales pitch: Likely \"Marketing.\"\n    * If exceptionally personalized & high-value for Trigify: Rare \"To Respond.\"\n* **Prior Email History = \"Yes\":** Indicates an **existing relationship/conversation**.\n    * If it's an update on terms, policies, or service changes from this known entity: Likely \"Notification.\"\n    * If it's a newsletter Max subscribed to: Could be \"FYI\" or \"Marketing\" based on content.\n    * If it's a direct message requiring action: Likely \"To Respond.\"\n* **`List-Unsubscribe` Header or Unsubscribe Links in Body:**\n    * Common in \"Marketing\" emails.\n    * Also present in many legitimate \"Notification\" emails (e.g., service updates, policy changes like the DPA example) and some \"FYI\" newsletters for compliance.\n    * **Therefore, an unsubscribe link alone does not define the category. Consider it alongside Prior Email History and email content/purpose.**\n* **`Precedence: Bulk` Header:** Often indicates mass mailings, common for Marketing, Notifications, and some FYIs.\n\n---\n\n* **To Respond (Label ID: `Label_5151750749488724401`):**\n    * **Primary Criteria:** Requires direct, timely action/reply from `[REDACTED_EMAIL]`.\n    * **Key Indicators (especially if Prior Email History = \"Yes\"):** Direct questions to Max, assigned tasks, requests for info for Trigify, deadlines for Max, part of an active conversation (indicated by `In-Reply-To`/`References`).\n    * **Sales Process Prioritization (Warm Leads/Active Processes - typically Prior Email History = \"Yes\"):** Ongoing, active Trigify sales process discussions.\n    * **High-Value Cold Outreach (Exceptional Cases - Prior Email History = \"No\"):** Highly personalized, strategic opportunity for Trigify requiring Max's personal attention. (Default for cold sales is \"Marketing\").\n\n* **FYI (Label ID: `Label_7518716752151077752`):**\n    * **Primary Criteria:** For Max's awareness; no immediate action/reply required.\n    * **Key Indicators:**\n        * Max is CC'd, primary action for others.\n        * General announcements, *non-promotional* newsletters from *known entities/subscriptions* (Prior Email History = \"Yes\" or sender is clearly a subscribed source) that aren't critical service notifications.\n        * Informational updates within ongoing projects where Max isn't the primary actor.\n    * If an email is a mass mailing (`Precedence: Bulk`, `List-Unsubscribe` present) from a *known entity* (Prior Email History = \"Yes\") and is purely informational without a direct call to action or critical service update, it could be \"FYI.\"\n\n* **Comment (Label ID: `Label_1470120230130814788`):**\n    * Comment/feedback on a document, task, system (e.g., subject \"New comment on...\").\n\n* **Notification (Label ID: `Label_9`):**\n    * **Primary Criteria:** Provides important, often non-promotional, updates or alerts regarding an existing service, account, or system that `[REDACTED_EMAIL]` or Trigify uses or is affected by. Action is typically awareness, potential configuration change, or noting a deadline, rather than a conversational reply.\n    * **Key Indicators:**\n        * **Updates from Known Service Providers (Prior Email History = \"Yes\" is common):**\n            * Changes to Terms of Service, Privacy Policies, Data Processing Agreements (DPAs like the \"Plain\" example).\n            * Critical service availability announcements (outages, maintenance).\n            * Security alerts related to an account Max uses.\n            * Important updates about features or functionality of a service Trigify relies on, which are not primarily marketing new features.\n        * System-generated alerts (e.g., `Auto-Submitted Header` = `auto-generated`) like social media notifications, non-meeting calendar reminders, some financial transaction alerts.\n        * Subject lines may contain: \"Important Update,\" \"Service Notification,\" \"Policy Change,\" \"DPA Update,\" \"Security Alert.\"\n        * Even if a `List-Unsubscribe` link is present (for compliance), if the core content is a critical service/account/legal update from a company Max/Trigify does business with, it's a \"Notification.\"\n        * The `Existing Gmail Labels` might include `CATEGORY_UPDATES`.\n\n* **Meeting Update (Label ID: `Label_7958083858424702466`):**\n    * Update specifically regarding a scheduled meeting (e.g., \"Accepted:\", \"Declined:\", \"Updated Invitation:\", \"Cancelled:\").\n\n* **Marketing (Label ID: `Label_5274550748854913384`):**\n    * **Primary Criteria:** Unsolicited promotional sales pitch, advertisement, or general marketing newsletter, especially if **Prior Email History = \"No.\"**\n    * **Key Indicators:**\n        * **No prior email history found with the `Sender Email`,** AND the email is primarily aimed at selling a product/service or promoting a company/event to Max/Trigify.\n        * Content is generic, focused on features/benefits without strong personalization to Max's known, active projects.\n        * Contains a `List-Unsubscribe Header` AND the content is promotional.\n        * `Existing Gmail Labels` may include `CATEGORY_PROMOTIONS`.\n    * If **Prior Email History = \"Yes\"**: Could still be \"Marketing\" if it's a clearly promotional newsletter/offer from a known contact that doesn't fit \"Notification\" or demand a \"To Respond.\"\n\n---\n\n**Email Data for Classification (Summary):**\n* **Prior Email History with Sender (Yes/No) - From the new capability**\n* Sender Email: `{{ $json.from.value[0].address }}`\n* Sender Name: `{{ $json.from.value[0].name }}`\n* Direct Recipient Emails (To): `{{ $json.to.value.map(r => r.address).join(', ') }}`\n* CC Recipient Emails: `{{ $json.cc.value.map(r => r.address).join(', ') }}`\n* Subject: `{{ $json.subject }}`\n* Body (Plain Text): `{{ $json.text }}`\n* Existing Gmail Labels: `{{ $json.labelIds.join(', ') }}`\n* Auto-Submitted Header: `{{ $json.headers['auto-submitted'] }}`\n* Original Sender Header: `{{ $json.headers.sender }}`\n* In-Reply-To Header: `{{ $json.headers['in-reply-to'] }}`\n* References Header: `{{ $json.headers.references }}`\n* List-Unsubscribe Header: `{{ $json.headers['list-unsubscribe'] }}`\n* Precedence Header: `{{ $json.headers.precedence }}`\n\n**Output:** [Provide ONLY the Label ID here]"},"promptType":"define","hasOutputParser":true},"typeVersion":1.9},{"id":"f4bbdda0-dcd8-41a7-a870-69dfcb747a4f","name":"Get Email","type":"n8n-nodes-base.gmailTool","position":[760,140],"webhookId":"[REDACTED_WEBHOOK_ID]","parameters":{"filters":{"q":"=from:{{ $fromAI('email') }}"},"operation":"getAll","returnAll":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID_2]","name":"Gmail account 2"}},"typeVersion":2.1},{"id":"64c3b465-d2be-43cc-ad41-cc1298038640","name":"Check Sent","type":"n8n-nodes-base.gmailTool","position":[560,180],"webhookId":"[REDACTED_WEBHOOK_ID]","parameters":{"filters":{"q":"=to:{{ $fromAI('email') }}","labelIds":["SENT"]},"operation":"getAll"},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID]","name":"Gmail account"}},"typeVersion":2.1}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"644d8154-7912-436a-8c05-e8e2f1092993","connections":{"Gmail":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Gmail1":{"main":[[]]},"AI Agent":{"main":[[{"node":"Gmail1","type":"main","index":0}]]},"Get Email":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Check Sent":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Gmail Trigger":{"main":[[{"node":"Gmail","type":"main","index":0}]]},"Anthropic Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"AI Agent","type":"ai_outputParser","index":0}]]}}}


name: AI Personal Assistant
author_name: Max Mitcham
author_username: maxmitcham
categories: []
created_at: 2025-06-06T12:23:22.572Z
updated_at: 2025-06-06T12:23:22.572Z
url: https://n8n.io/workflows/4723
scraped_at: 2025-07-06 21:16:30
description:
  Email Personal Assistant - Comprehensive Communication Manager

  This automation flow is designed to proactively monitor email, calendar, and Slack communications, analyze priorities across all channels, and generate a comprehensive daily briefing with actionable tasks for executive productivity management.

  ⚙️ How It Works (Step-by-Step):

  ⏰ Automated Daily Trigger
  Runs automatically on weekdays:
  Scheduled execution every weekday at 8:00 AM
  Manual trigger available for on-demand analysis
  Comprehensive daily communication audit

  📧 Email Assistant Agent
  Analyzes inbox priorities and context:
  Scans unread emails across "To Respond" and "FYI" labels
  Checks email history to determine relationship context
  Identifies *company-related opportunities and partnerships
  Categorizes emails by urgency (High, Medium, Low)
  Cross-references with sent emails for follow-up context

  📅 Follow-Up Assistant Agent
  Monitors meeting follow-up requirements:
  Reviews last 3 days of calendar meetings
  Fetches Fireflies transcripts for recorded sessions
  Identifies meetings without post-meeting communication
  Flags meetings requiring action items or follow-ups
  Checks sent emails and Slack for completed follow-ups

  💬 Slack Assistant Agent
  Tracks Slack communication priorities:
  Monitors direct messages and @mentions
  Identifies unreplied Slack conversations
  Cross-references with email and calendar context
  Prioritizes responses based on sender importance
  Checks for threaded conversations requiring attention

  🎯 Master Orchestrator Agent
  Synthesizes all communication data:
  Combines reports from all three assistant agents
  Cross-references with existing Google Sheets to-do list
  Prioritizes tasks by urgency and business impact
  Identifies correlations between different communication channels
  Creates comprehensive daily action plan

  📊 Task Management Integration
  Automated tracking and delivery:
  Appends new tasks to Google Sheets to-do tracker
  Sends personalized daily briefing via Slack DM
  Maintains conversation memory for context continuity
  Tracks outstanding vs. completed items

  🛠️ Tools Used:
  n8n: Workflow orchestration and scheduling
  Claude Sonnet 4 & Opus 4: Multi-agent AI analysis
  Gmail API: Email monitoring and history checking
  Google Calendar: Meeting tracking and scheduling
  Slack API: Message monitoring and user management
  Fireflies API: Meeting transcript analysis
  Google Sheets: Task tracking and persistence

  📦 Key Features:
  Multi-channel communication monitoring (Email, Calendar, Slack)
  AI-powered priority assessment and context analysis
  Cross-platform relationship tracking and history
  Automated daily briefing generation and delivery
  Persistent task tracking with Google Sheets integration
  Meeting follow-up verification and flagging
  Conversation memory for continuity across sessions

  🚀 Ideal Use Cases:
  C-level executives managing multiple communication channels
  Sales leaders tracking prospect interactions and follow-ups
  Business development professionals managing partnerships
  Busy professionals needing communication prioritization
  Teams requiring systematic follow-up management
  Anyone wanting automated daily productivity briefings
  `

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.slack","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatAnthropic","@n8n/n8n-nodes-langchain.memoryBufferWindow"]

workflow_json:
  {"id":"F0DFXdSTdGjIk0V5","meta":{"instanceId":"[REDACTED_INSTANCE_ID]","templateCredsSetupCompleted":true},"name":"Email - PA","tags":[{"id":"xG398zgKum2bPs6D","name":"Personal Assistant","createdAt":"2025-05-28T13:58:43.876Z","updatedAt":"2025-05-28T13:58:43.876Z"}],"nodes":[{"id":"23c641eb-14b4-4ec3-bbb4-525c6ee0630d","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[440,-60],"parameters":{},"typeVersion":1},{"id":"6dcfb448-c7c9-4071-afbc-58416de739c8","name":"Get Email","type":"n8n-nodes-base.gmailTool","position":[840,380],"webhookId":"27137976-d22b-4d15-9c86-b8b8d6a97e7b","parameters":{"messageId":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}","operation":"get"},"credentials":{"gmailOAuth2":{"id":"[REDACTED_GMAIL_CRED_ID]","name":"Gmail account"}},"typeVersion":2.1},{"id":"02822000-04e9-4448-9cab-1846fda5ae9d","name":"Anthropic Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[560,180],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-sonnet-4-20250514","cachedResultName":"Claude Sonnet 4"},"options":{}},"credentials":{"anthropicApi":{"id":"[REDACTED_ANTHROPIC_CRED_ID]","name":"Anthropic account 3"}},"typeVersion":1.3},{"id":"cdd1d793-cde5-4f7c-bdc8-f7d3220ecab2","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[740,120],"parameters":{"sessionKey":"1","sessionIdType":"customKey","contextWindowLength":50},"typeVersion":1.3},{"id":"7d4ce33f-a3e9-4476-8815-13a970847909","name":"Google Calendar","type":"n8n-nodes-base.googleCalendarTool","position":[1360,80],"parameters":{"options":{},"timeMax":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}","timeMin":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}","calendar":{"__rl":true,"mode":"list","value":"[REDACTED_EMAIL]","cachedResultName":"[REDACTED_EMAIL]"},"operation":"getAll","returnAll":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"},"credentials":{"googleCalendarOAuth2Api":{"id":"[REDACTED_GOOGLE_CALENDAR_CRED_ID]","name":"Google Calendar account"}},"typeVersion":1.3},{"id":"eb6d3232-39e4-4459-9d01-5553c76d04af","name":"Check Sent","type":"n8n-nodes-base.gmailTool","position":[1160,80],"webhookId":"0854fad3-622e-44b4-9d61-5aae13c61433","parameters":{"filters":{"q":"=to:{{ $fromAI('email') }}","labelIds":["SENT"]},"operation":"getAll"},"credentials":{"gmailOAuth2":{"id":"Ldq2rjN6Dod5DoKl","name":"Gmail account"}},"typeVersion":2.1},{"id":"90d5d3f3-4a7f-4c0d-8fe5-d36581302b77","name":"Anthropic Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[1260,200],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-opus-4-20250514","cachedResultName":"Claude Opus 4"},"options":{}},"credentials":{"anthropicApi":{"id":"BVgmqTRcPinCIX4S","name":"Anthropic account 3"}},"typeVersion":1.3},{"id":"b2c62e5e-b13b-4823-b241-b0fca8375645","name":"Unread Emails - FYI","type":"n8n-nodes-base.gmailTool","position":[960,260],"webhookId":"44a76d68-61fb-42b5-a7eb-f3ccc7a0d2d1","parameters":{"filters":{"labelIds":["Label_5151750749488724401","Label_7518716752151077752"],"readStatus":"unread"},"operation":"getAll","returnAll":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"},"credentials":{"gmailOAuth2":{"id":"Ldq2rjN6Dod5DoKl","name":"Gmail account"}},"typeVersion":2.1},{"id":"7d277cd9-ca79-437f-bb6e-2004d47afb14","name":"Unread Emails - To Respond","type":"n8n-nodes-base.gmailTool","position":[1140,360],"webhookId":"44a76d68-61fb-42b5-a7eb-f3ccc7a0d2d1","parameters":{"filters":{"labelIds":["Label_5151750749488724401","UNREAD"],"readStatus":"unread"},"operation":"getAll","returnAll":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"},"credentials":{"gmailOAuth2":{"id":"Ldq2rjN6Dod5DoKl","name":"Gmail account"}},"typeVersion":2.1},{"id":"d2a41575-f04f-4a59-ad81-4b90c49035a6","name":"Email Assistant","type":"@n8n/n8n-nodes-langchain.agent","position":[700,-120],"parameters":{"text":"Run the task. ","options":{"systemMessage":"=# Personal Assistant Brief - Max Mitcham\n\nYou are my proactive personal assistant, dedicated to streamlining my communications and ensuring follow-through for Max Mitcham, especially regarding my work with Trigify. You have access to and will manage my Email, Slack, and Calendar.\n\n## Core Daily Objective\nHelp me stay on top of communications and identify opportunities for advancing Trigify sales and partnerships.\n\n## Daily Tasks\n\n### 1. Priority Email Triage\n- Scan my inbox for unreplied emails.\n- Flag emails requiring a response, categorizing them by urgency (e.g., High, Medium, Low).\n- Note emails specifically related to:\n  - Active Trigify sales leads.\n  - Potential or ongoing Trigify partnerships.\n  - Requests from important contacts (define if you have a list, e.g., 'investors,' 'VIP clients').\n- Check any sent emails to see if there is any context you require around the unread emails. \n- When checking to see if I've followed up with someone from a meeting you can use the Check Sent tool with this - to:example@email.com"},"promptType":"define"},"typeVersion":1.9},{"id":"dacebdba-18e8-4a59-9900-804cea6ad9b2","name":"Follow Up Assistant","type":"@n8n/n8n-nodes-langchain.agent","position":[1300,-160],"parameters":{"text":"Run the task.","options":{"maxIterations":50,"systemMessage":"=**Objective:** Proactively manage meeting follow-ups for `[Max Mitcham/max@trigify.io]` by identifying meetings requiring attention from the last 3 days and flagging necessary actions.\n\n**Contextual Information & Variables:**\n* **Current Date/Time:** `{{ $now }}` (Use this to calculate the date range)\n* **Your Email Address:** `[Your Email Address]` (e.g., max@trigify.io)\n* **Date Format for Google Calendar:** `YYYY-MM-DD HH:MM:SS` (e.g., 2024-05-14 11:35:31)\n\n**Workflow & Tool Integration:**\n\n**Step 1: Retrieve Recent Meetings**\n* **Tool:** Google Calendar\n* **Action:** Fetch all meetings from `[Your Name/Email]`'s calendar.\n* **Date Range:**\n    * **Start Date/Time:** `{{ $now }}` minus 3 days (formatted as `YYYY-MM-DD 00:00:00`).\n    * **End Date/Time:** `{{ $now }}` (formatted as `YYYY-MM-DD 23:59:59`).\n* **Output Needed per Meeting:** Meeting Title, Start Time, End Time, Attendees (including their email addresses), Associated Notes/Description.\n\n**Step 2: Process Each Retrieved Meeting**\n\nFor each meeting:\n\n    **A. Identify Meeting Type & Relevance:**\n    * Prioritize meetings with titles explicitly containing \"Sales Call for Trigify\" or \"Trigify Partnership Discussion\".\n    * For other meetings, attempt to infer relevance (sales or partnership context for Trigify) by analyzing:\n        * **Attendees:** Are key prospects, clients, or potential partners present?\n        * **Associated Notes/Description (from Calendar):** Do they mention sales or partnership keywords?\n        * If a meeting is clearly internal or irrelevant to sales/partnerships, it may not require this specific follow-up scrutiny.\n\n    **B. Fetch Meeting Transcript (if applicable & relevant):**\n    * **Tool:** Fetch Fireflies\n    * **Condition:** If the meeting is identified as relevant (sales/partnership).\n    * **Input Parameters:**\n        * Meeting identifier (e.g., title and start time from Google Calendar).\n        * Participant emails (list of all attendee emails from Google Calendar, including `[max@trigify.io]`).\n    * **Output:** Transcript content or an indicator if no transcript is found.\n\n    **C. Determine if Meeting Occurred & Initial Status:**\n    * **Primary Check:** Was a transcript successfully fetched by \"Fetch Fireflies\"?\n    * **Scenario 1: No Transcript Found.**\n        * **Assumption:** The meeting may not have happened, was not recorded, or Fireflies had an issue.\n        * **Action:** Flag this meeting for manual review.\n        * **Suggested Output Message:** \"Potential Issue: For meeting '[Meeting Title]' on [Date] with [Participant Names/Emails], no Fireflies transcript was found. Please verify if the meeting occurred and if any action is needed. Priority: Low.\"\n\n    * **Scenario 2: Transcript Found (Meeting likely occurred).**\n        * Proceed to check for follow-ups (Step D).\n\n    **D. Check for Your Sent Follow-up Communication:**\n    * **Tool 1: Check Sent Emails** (e.g., Gmail \"search sent mail\" node)\n        * **Action:** For each external participant (attendees excluding `[max@trigify.io]` and internal colleagues if identifiable), check if an email was sent by `[max@trigify.io]` to that participant.\n        * **Time Window for Sent Email:** From the meeting's end time until `{{ $now }}`.\n        * **Search Criteria:** `to:[participant_email@example.com] from:[max@trigify.io]` (and potentially keywords related to the meeting title/topic in the subject/body).\n    * **Tool 2: Check Sent Slack Messages, my Slack (Max Mitcham) ID is @U057SEMAP6J ** (if applicable and a tool exists)\n        * **Action:** Similar to email, check if a Slack DM or relevant channel message was sent by `[Your Name/Email]` to the participant(s) or referencing the meeting.\n        * **Time Window:** Same as email.\n    * **Output:** Boolean (Follow-up sent: Yes/No for each relevant participant or overall for the meeting).\n\n    **E. Evaluate Need for Follow-up & Flag Pending Action (if meeting occurred and no follow-up sent):**\n    * **Condition:**\n        * Meeting likely occurred (transcript exists).\n        * No follow-up communication (email/Slack) detected from `[Your Name/Email]` to key external participants.\n    * **Evaluation Criteria (Is a follow-up beneficial?):**\n        * **Meeting Context (from transcript, notes, title):**\n            * Were action items defined for `[Your Name/Email]` or the prospect?\n            * Is it a sales call where sharing resources, summarizing value, or confirming next steps is standard?\n            * Is it a partnership discussion with clear deliverables or next steps?\n        * **Participants:** Who attended? (e.g., high-value prospect, new contact).\n        * **Objective:** What was the goal of the meeting?\n    * **Action:** If a follow-up is deemed beneficial and none was sent, flag as a pending action.\n    * **Suggested Output Message:** \"Action Required: Follow-up pending for meeting '[Meeting Title]' on [Date] with [Participant Names/Emails]. Objective: [Inferred Objective]. Consider sending resources, confirming next steps, or reiterating value.\"\n\n**Summary of Outputs:**\n1.  A list of meetings flagged for \"Potential Issue\" (no transcript).\n2.  A list of meetings flagged for \"Action Required\" (follow-up pending).\n\nDon't give me any recoemdnations other than the above outputs."},"promptType":"define"},"typeVersion":1.9},{"id":"e83b030b-ba2f-43e7-bb3d-113e126403b1","name":"Fetch FireFlies","type":"n8n-nodes-base.httpRequestTool","position":[1580,100],"parameters":{"url":"https://api.fireflies.ai/graphql","method":"POST","options":{},"jsonBody":"={\n  \"query\": \"query Transcripts($participantEmail: String) { transcripts(participant_email: $participantEmail) { id title date duration participants host_email organizer_email transcript_url summary { action_items keywords overview short_summary } } }\",\n  \"variables\": {\n    \"participantEmail\": \"{{ $fromAI('email') }}\"\n  }\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","toolDescription":"Use this to fetch my call recordings and transcripts from my FireFlies account. Add the participant email to fetch the transcript.\n\nWhen using the Fetch FireFlies tool ensure you add the participant email from the meeting you get via the Google Calender tool. ","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer [REDACTED_FIREFLIES_API_TOKEN]"}]}},"typeVersion":4.2},{"id":"c23b7b03-dedc-4733-a7be-91f3473cbd08","name":"Check Sent1","type":"n8n-nodes-base.gmailTool","position":[1480,320],"webhookId":"0854fad3-622e-44b4-9d61-5aae13c61433","parameters":{"filters":{"q":"=to:{{ $fromAI('email') }}","labelIds":["SENT"]},"operation":"getAll"},"credentials":{"gmailOAuth2":{"id":"Ldq2rjN6Dod5DoKl","name":"Gmail account"}},"typeVersion":2.1},{"id":"a00e1df6-3f55-45ca-801c-021206c8a303","name":"Master Orchestrator Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[2360,-240],"parameters":{"text":"Run the task.","options":{"systemMessage":"=**Objective:** You are the Master Orchestrator Personal Assistant for Max Mitcham. Your role is to synthesize the daily reports from the \"Email Triage Agent,\" \"Meeting Follow-up Management Agent,\" and \"Slack Assistant Agent,\" cross-reference these with a list of Max's ongoing tasks from the \"Previous To-Do's\" Google Sheet, and produce a single, prioritized, and actionable daily briefing/to-do list for Max.\n\n**Contextual Information:**\n* **Recipient:** Max Mitcham (max@trigify.io)\n* **Current Date/Time:** `{{ $now }}`\n\n**Inputs (Outputs from Previous Agents & Tools):**\n\n1.  **Email Triage Report (from Email Assistant):**\n    * *Data Location Example (n8n):* `{{ $('Email Assistant').item.json.output }}`\n    * *Contains:* Priority emails, context, and recommended actions related to emails.\n\n2.  **Meeting Follow-up Analysis Report (from Follow Up Assistant):**\n    * *Data Location Example (n8n):* `{{ $('Follow Up Assistant').item.json.output }}` (*Adjust node name if different*)\n    * *Contains:* Meetings flagged for potential issues (no transcript) and meetings requiring follow-up.\n\n3.  **Slack Activity Report (from Slack Assistant):**\n    * *Data Location Example (n8n):* `{{ $('Slack Assistant').item.json.output }}` (*Adjust node name if different*)\n    * *Contains:* A report of unreplied Slack messages/threads for Max, prioritized, with context, and sometimes suggested actions or a \"RECOMMENDATIONS\" section for high-priority Slack responses.\n\n4.  **Previous To-Do's Data (from Google Sheets Tool):**\n    * **Tool:** Google Sheets (\"Previous To-Do's\" sheet)\n    * **Action:** Fetch all tasks, particularly those not marked as \"Done.\"\n    * **Expected Google Sheet Columns (example):**\n        * `Task ID` (Unique identifier for the task)\n        * `Task Description` (e.g., \"Follow up with Ben Thompson re: Trigify Overview\")\n        * `Assigned Date` (Date the task was created/assigned)\n        * `Due Date` (Optional, if applicable)\n        * `Priority` (e.g., High, Medium, Low)\n        * `Source` (e.g., Email Triage, Meeting Follow-up, Slack Assistant, Manual Entry)\n        * `Status` (e.g., \"Pending,\" \"Overdue,\" \"In Progress,\" \"Done,\" \"Blocked\")\n        * `Relevant Link/Reference` (e.g., link to email, meeting invite, Slack message)\n        * `Notes` (Any additional notes)\n\n**Core Task:**\n\nYour primary function is to **extract, consolidate, cross-reference, and prioritize actionable tasks** from all provided reports and the \"Previous To-Do's\" Google Sheet. You are to create a clear and concise daily \"Focus List & Action Plan\" for Max, highlighting new tasks, outstanding previous tasks, and indicating if any newly identified items might address or relate to existing pending tasks.\n\n**Instructions:**\n\n1.  **Fetch & Process Inputs:**\n    * Carefully review the \"Email Triage Report,\" \"Meeting Follow-up Analysis Report,\" and the \"Slack Activity Report\" for *newly identified actions for today*.\n    * Retrieve data from the \"Previous To-Do's\" Google Sheet.\n\n2.  **Extract New Action Items (Today's Tasks):**\n    * From the **Email Triage Report:** Focus on \"Priority Emails Requiring Response\" and especially its \"Recommended Actions\" section.\n    * From the **Meeting Follow-up Analysis Report:** Focus on \"Meetings Flagged for Potential Issues (No Transcript Found)\" and \"Action Required - Follow-up Pending.\"\n    * From the **Slack Activity Report:**\n        * Focus on items categorized under \"HIGH PRIORITY,\" \"MEDIUM PRIORITY,\" etc., that are **not** explicitly marked as \"Status: REPLIED ✓\".\n        * Pay close attention to any \"RECOMMENDATIONS\" section provided by the Slack Assistant.\n\n3.  **Review Previous To-Do's & Identify Outstanding Tasks:**\n    * From the \"Previous To-Do's\" Google Sheet, identify all tasks where the `Status` is **not** \"Done\" (e.g., \"Pending,\" \"Overdue,\" \"In Progress\").\n    * Note their `Task Description`, `Assigned Date`, `Priority`, and `Source`.\n\n4.  **Correlate New Actions with Existing To-Do's (Basic Check):**\n    * For each *new* action item identified in Step 2:\n        * Briefly check if it directly addresses or is an explicit reminder for an *existing outstanding task* from the Google Sheet (e.g., a Slack message from \"Graham - Equals\" about DocuSign might relate to a previous to-do \"Sign Equals Partnership Agreement\").\n        * If a direct correlation is found, this context can be used to either update the existing task's relevance or confirm it's being actively addressed. *Actual updates to the Google Sheet are outside this agent's scope; it only reports.*\n\n5.  **Prioritize and Categorize for Daily Briefing:**\n    * Combine new tasks and outstanding previous tasks.\n    * Use the priority levels (High, Medium, Low) and urgency cues (e.g., \"IMMEDIATE,\" \"URGENT,\" \"TODAY,\" \"Critical,\" \"OVERDUE\") from source agents and the Google Sheet.\n    * Group tasks logically:\n        * **\"🔴 Overdue & High Priority Outstanding Tasks\"** (Previously assigned, not done, and critical)\n        * **\"🚨 Immediate New Critical Actions for Today\"** (Newly identified today, needs immediate attention)\n        * **\"🟡 Other Outstanding Tasks\"** (Previously assigned, not done, regular priority)\n        * **\"📧 New Email Responses Due Today\"**\n        * **\"📞 New Meeting Follow-ups & Verifications for Today\"**\n        * **\"💬 New Slack Responses Needed Today\"**\n        * **\"❓ Meetings to Verify (from today's reports)\"**\n\n6.  **Format the Output:** Present the information as a clear, easy-to-digest daily briefing. For each item, include:\n    * A clear description of the task.\n    * Relevant context (e.g., email subject, meeting participant, Slack sender/channel, original assigned date for outstanding tasks).\n    * The priority/urgency, clearly indicating if it's NEW, OUTSTANDING, or OVERDUE.\n    * The specific action Max needs to take.\n    * If a new item relates to an existing outstanding task, mention this briefly.\n\n7.  **Synthesize, Don't Add New Analysis (Maintain Original Constraint):**\n    * Your role is to combine and present the findings. **Do NOT add new analysis, interpretations, or general recommendations beyond what is explicitly stated or directly implied as an action in the input reports or Google Sheet.**\n    * Task-YOUR_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE_OPENAI_KEY_HERE recommendations from any agent or implied by an outstanding to-do item *should* be included.\n    * **IGNORE any general process improvement recommendations** from the input reports.\n\n*(Assumption: The \"Previous To-Do's\" Google Sheet is the source of truth for past task statuses. This agent reads it but does not directly update it. New tasks identified today will presumably be added to this sheet by a subsequent process or agent for future tracking.)*\n\n**Desired Output Format (Example - Enhanced):**"},"promptType":"define"},"typeVersion":1.9},{"id":"33bdab45-9020-4b5a-8d82-fc431a3c6f81","name":"Anthropic Chat Model2","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[2340,100],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-sonnet-4-20250514","cachedResultName":"Claude Sonnet 4"},"options":{}},"credentials":{"anthropicApi":{"id":"BVgmqTRcPinCIX4S","name":"Anthropic account 3"}},"typeVersion":1.3},{"id":"8318f3e9-2d7a-4d40-aa1f-121190b59d27","name":"Slack","type":"n8n-nodes-base.slackTool","position":[2240,700],"webhookId":"f344be12-d8f9-49f2-9ad1-c5ad4865011a","parameters":{"user":{"__rl":true,"mode":"list","value":""},"resource":"user","authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"K7I3vS9MWSPOgZmk","name":"Slack account 4"}},"typeVersion":2.3},{"id":"b35ba2f5-1941-49ca-b517-876d762ec679","name":"Slack1","type":"n8n-nodes-base.slack","position":[1980,680],"webhookId":"888207b0-5470-4d01-af54-9649a7fb5239","parameters":{"query":"in:<#C08RV147W01> from:me ","options":{},"operation":"search"},"credentials":{"slackApi":{"id":"VAldnV7INnA0hLKx","name":"Max Personal - May 2025"}},"typeVersion":2.3},{"id":"1477da0c-bcf9-4078-8e42-8d4630eed57d","name":"Check Slack Mentions","type":"n8n-nodes-base.slackTool","position":[2080,200],"webhookId":"4178ca31-02cb-443b-857b-a229a726d144","parameters":{"query":"@[REDACTED_SLACK_USER_ID]","options":{},"operation":"search"},"credentials":{"slackApi":{"id":"VAldnV7INnA0hLKx","name":"Max Personal - May 2025"}},"typeVersion":2.3},{"id":"1e9fd5cf-0714-4847-a413-cb1e0857c86e","name":"Check Thread Mentions","type":"n8n-nodes-base.slackTool","position":[1900,280],"webhookId":"a00c94a4-e875-496b-a734-5c8f69d03772","parameters":{"query":"=in:<#{{ $fromAI('channel_id') }}> from:me","options":{},"operation":"search"},"credentials":{"slackApi":{"id":"VAldnV7INnA0hLKx","name":"Max Personal - May 2025"}},"typeVersion":2.3},{"id":"ab54a242-f3f9-4481-8c14-08f89fc1a8a4","name":"Get User","type":"n8n-nodes-base.slackTool","position":[2220,220],"webhookId":"3b709b40-2c4d-4a32-b53c-780dfd855bb7","parameters":{"user":{"__rl":true,"mode":"id","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('User', ``, 'string') }}"},"resource":"user"},"credentials":{"slackApi":{"id":"VAldnV7INnA0hLKx","name":"Max Personal - May 2025"}},"typeVersion":2.3},{"id":"7b37f19a-a7a0-41f9-8f85-6b74c219f438","name":"Slack Assistant","type":"@n8n/n8n-nodes-langchain.agent","position":[1820,-220],"parameters":{"text":"Run the task.","options":{"maxIterations":20,"systemMessage":"**Objective:** You are Max Mitcham's (Slack ID: `@@U057SEMAP6J`) Proactive Slack Assistant. Your primary role is to monitor Slack for direct messages and mentions, identify those that Max has not yet replied to, and provide context to help Max prioritize responses, especially those relevant to Trigify sales and partnerships.\n\n**Your Slack User ID (Max Mitcham):** `@@U057SEMAP6J`\n\n**Key Information Sources & Tools:**\n\n1.  **Slack:**\n    * **Access:** Read direct messages (DMs) to Max, and messages where Max (`@@U057SEMAP6J`) is mentioned in channels.\n    * **Check for Replies:** Determine if Max has sent a message in the same DM conversation or in the same thread (for channel mentions) *after* the incoming message.\n2.  **Email (e.g., Gmail Search Tool):**\n    * **Purpose:** To find relevant email conversations with the Slack message sender or about topics mentioned in the Slack message, to gauge importance or gather background.\n    * **Search Parameters (example):** `from:[Slack message sender's email (if known/inferable)] OR to:[Slack message sender's email] OR subject:(\"[keywords from Slack message]\") OR \"[keywords from Slack message in body]\"`, within a relevant recent timeframe (e.g., last 7 days).\n3.  **Fireflies (Fetch Fireflies Tool):**\n    * **Purpose:** To find meeting transcripts or summaries involving the Slack message sender or discussing topics mentioned in the Slack message, to understand context, action items, or urgency.\n    * **Search Parameters (example):** Meeting participants including `[Slack message sender's name/email (if known/inferable)]`, keywords `\"[keywords from Slack message]\"`.\n\n**Workflow & Logic:**\n\n**1. Fetch Recent Slack Activity:**\n    * Define a timeframe (e.g., \"messages from the last 24 hours,\" or \"since [timestamp of last check]\").\n    * Retrieve:\n        * New direct messages sent to `@@U057SEMAP6J`.\n        * New messages in channels where `@@U057SEMAP6J` is mentioned.\n    * For each retrieved message/thread, identify the primary sender (not Max).\n\n**2. Determine if Max Has Replied:**\n    * For each incoming message/thread identified in Step 1:\n        * **DMs:** Check if `@@U057SEMAP6J` has sent any message in that DM conversation *after* the timestamp of the incoming message.\n        * **Channel Mentions:** Check if `@@U057SEMAP6J` has replied in the *thread* of that mention *after* the timestamp of the mention.\n        * *(Assumption: A textual reply is required. Emoji reactions alone do not count as a reply for this purpose, unless specified otherwise).*\n\n**3. Contextual Analysis for Unreplied Messages:**\n    * If Max (`@@U057SEMAP6J`) has **NOT** replied:\n        * **Initial Assessment:** Briefly analyze the Slack message content. Does it seem to ask a direct question, assign an action, or mention Trigify, sales, partnerships, or known important contacts/keywords?\n        * **If Potentially Important (based on initial assessment):**\n            * **Gather Email Context:**\n                * Attempt to identify the Slack sender's email address (e.g., from their Slack profile if available, or from a known contacts list).\n                * Use the **Email Search Tool** with relevant search parameters (sender's email, keywords from Slack message) to find related communications. Note any ongoing discussions, urgency, or relevant attachments.\n            * **Gather Fireflies Context:**\n                * Use the **Fetch Fireflies Tool** with relevant search parameters (sender's name/email, keywords from Slack message) to find related meeting transcripts or summaries. Note any action items assigned to Max, decisions made, or follow-ups discussed.\n        * **If NOT Potentially Important (e.g., FYI, social chatter):** External context gathering may not be necessary, or can be lower priority.\n\n**4. Prioritize and Summarize Unreplied Messages:**\n    * Based on the Slack message itself and any gathered context from Email/Fireflies, assign a priority for Max to reply (e.g., High, Medium, Low).\n    * **High Priority Examples:**\n        * Direct question from a known client/prospect related to an active Trigify deal.\n        * Urgent request or action item for Max found in the Slack message or related Email/Fireflies context.\n        * Mention of a critical issue or deadline.\n    * **Medium Priority Examples:**\n        * Non-urgent question from a colleague or partner.\n        * Follow-up to a recent Trigify-related meeting where next steps are expected from Max.\n    * **Low Priority Examples:**\n        * General FYI messages, non-critical updates.\n        * Messages where context suggests no immediate action is needed from Max.\n\n**5. Output Report:**\n    * Provide a concise list of Slack messages/threads that Max (`@@U057SEMAP6J`) has not replied to, ordered by priority.\n    * For each item, include:\n        * **Sender Name & Slack Channel/DM.**\n        * **Brief Snippet of the Slack Message.**\n        * **Date/Time of Message.**\n        * **Assigned Priority (High/Medium/Low).**\n        * **Reason for Priority & Key Context:** Concisely summarize findings from Email/Fireflies if they contribute to the importance (e.g., \"Related to Project X email discussion,\" \"Action item for Max from Fireflies transcript of meeting with [Sender] on [Date]\").\n        * **Suggested Action (Implicit):** Reply to the Slack message.\n\n**Example Output Snippet (Conceptual):**"},"promptType":"define"},"typeVersion":1.9},{"id":"20614cdf-f991-4f47-984c-12cc3e9ebfea","name":"Anthropic Chat Model3","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[1780,40],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-sonnet-4-20250514","cachedResultName":"Claude Sonnet 4"},"options":{}},"credentials":{"anthropicApi":{"id":"BVgmqTRcPinCIX4S","name":"Anthropic account 3"}},"typeVersion":1.3},{"id":"d08fe78c-d123-40ac-9ec7-611bebc766c2","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[2760,-220],"parameters":{"columns":{"value":{"Date":"={{ $now }}","To-Do":"={{ $json.output }}"},"schema":[{"id":"Date","type":"string","display":true,"required":false,"displayName":"Date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"To-Do","type":"string","display":true,"required":false,"displayName":"To-Do","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/[REDACTED_GOOGLE_SHEETS_DOC_ID]/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"[REDACTED_GOOGLE_SHEETS_DOC_ID]","cachedResultUrl":"https://docs.google.com/spreadsheets/d/[REDACTED_GOOGLE_SHEETS_DOC_ID]/edit?usp=drivesdk","cachedResultName":"To-Do's"}},"credentials":{"googleSheetsOAuth2Api":{"id":"h6BWkFrOpF4Fixzj","name":"Google Sheets account 4"}},"typeVersion":4.5},{"id":"47f36ebb-d421-46ef-999c-02eb242372a8","name":"Slack2","type":"n8n-nodes-base.slack","position":[3000,-280],"webhookId":"ac3567da-3389-455c-8046-c008deec1a89","parameters":{"text":"=Hi Max,  \n\n{{ $('Master Orchestrator Agent').item.json.output }}","user":{"__rl":true,"mode":"list","value":"[REDACTED_SLACK_USER_ID]","cachedResultName":"max"},"select":"user","otherOptions":{}},"credentials":{"slackApi":{"id":"rMLcAY2NkEYMYzPi","name":"Jarvis Agent - May 2025"}},"typeVersion":2.3},{"id":"07c67d34-e353-4f1b-8684-898b10f90b94","name":"Previous To Do","type":"n8n-nodes-base.googleSheetsTool","position":[2620,-20],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/[REDACTED_GOOGLE_SHEETS_DOC_ID]/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"[REDACTED_GOOGLE_SHEETS_DOC_ID]","cachedResultUrl":"https://docs.google.com/spreadsheets/d/[REDACTED_GOOGLE_SHEETS_DOC_ID]/edit?usp=drivesdk","cachedResultName":"To-Do's"}},"credentials":{"googleSheetsOAuth2Api":{"id":"h6BWkFrOpF4Fixzj","name":"Google Sheets account 4"}},"typeVersion":4.5},{"id":"7c95c16f-f578-45c1-b718-407b81d6ac4f","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[440,-240],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[1,2,3,4,5],"triggerAtHour":8}]}},"typeVersion":1.2}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"54c20437-4c0f-4453-b66c-a92679d682a6","connections":{"Slack":{"ai_tool":[[]]},"Get User":{"ai_tool":[[{"node":"Slack Assistant","type":"ai_tool","index":0}]]},"Get Email":{"ai_tool":[[{"node":"Email Assistant","type":"ai_tool","index":0}]]},"Check Sent":{"ai_tool":[[{"node":"Email Assistant","type":"ai_tool","index":0}]]},"Check Sent1":{"ai_tool":[[{"node":"Follow Up Assistant","type":"ai_tool","index":0}]]},"Google Sheets":{"main":[[{"node":"Slack2","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"Email Assistant","type":"ai_memory","index":0}]]},"Previous To Do":{"ai_tool":[[{"node":"Master Orchestrator Agent","type":"ai_tool","index":0}]]},"Email Assistant":{"main":[[{"node":"Follow Up Assistant","type":"main","index":0}]]},"Fetch FireFlies":{"ai_tool":[[{"node":"Follow Up Assistant","type":"ai_tool","index":0}]]},"Google Calendar":{"ai_tool":[[{"node":"Follow Up Assistant","type":"ai_tool","index":0}]]},"Slack Assistant":{"main":[[{"node":"Master Orchestrator Agent","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Email Assistant","type":"main","index":0}]]},"Follow Up Assistant":{"main":[[{"node":"Slack Assistant","type":"main","index":0}]]},"Unread Emails - FYI":{"ai_tool":[[{"node":"Email Assistant","type":"ai_tool","index":0}]]},"Anthropic Chat Model":{"ai_languageModel":[[{"node":"Email Assistant","type":"ai_languageModel","index":0}]]},"Check Slack Mentions":{"ai_tool":[[{"node":"Slack Assistant","type":"ai_tool","index":0}]]},"Anthropic Chat Model1":{"ai_languageModel":[[{"node":"Follow Up Assistant","type":"ai_languageModel","index":0}]]},"Anthropic Chat Model2":{"ai_languageModel":[[{"node":"Master Orchestrator Agent","type":"ai_languageModel","index":0}]]},"Anthropic Chat Model3":{"ai_languageModel":[[{"node":"Slack Assistant","type":"ai_languageModel","index":0}]]},"Check Thread Mentions":{"ai_tool":[[{"node":"Slack Assistant","type":"ai_tool","index":0}]]},"Master Orchestrator Agent":{"main":[[{"node":"Google Sheets","type":"main","index":0}]]},"Unread Emails - To Respond":{"ai_tool":[[{"node":"Email Assistant","type":"ai_tool","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Email Assistant","type":"main","index":0}]]}}}


