{ "id": "xM8Z5vZVNTNjCySL", "meta": { "instanceId": "workflow-de12a5d6", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:43.477507", "updatedAt": "2025-09-29T07:07:43.477522", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "News Extraction", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "97711d12-20de-40aa-b994-d2b10f20a5e5", "name": "Extract the HTML with the right css class", "type": "n8n-nodes-base.html", "position": [ -500, 0 ], "parameters": { "options": { "trimValues": true }, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "YOUR_CREDENTIAL_HERE", "attribute": "href", "cssSelector": "=div:nth-child(9) > div:nth-child(3) > a:nth-child(2)", "returnArray": true, "returnValue": "attribute" } ] } }, "typeVersion": 1, "notes": "This html node performs automated tasks as part of the workflow." }, { "id": "b874b570-daae-4878-b525-07ac30756eb1", "name": "Summary", "type": "n8n-nodes-base.openAi", "position": [ -880, 440 ], "parameters": { "model": "gpt-4-1106-preview", "prompt": { "messages": [ { "content": "=Create a summary in less than 70 words {{ $json[\"content\"] }}" } ] }, "options": {}, "resource": "chat" }, "credentials": { "openAiApi": { "id": "0Vdk5RlVe7AoUdAM", "name": "OpenAi account" } }, "typeVersion": 1, "notes": "This openAi node performs automated tasks as part of the workflow." }, { "id": "72696278-2d44-4073-936a-6fe9df1bc7d8", "name": "Keywords", "type": "n8n-nodes-base.openAi", "position": [ -880, 620 ], "parameters": { "model": "gpt-4-1106-preview", "prompt": { "messages": [ { "content": "=name the 3 most important technical keywords in {{ $json[\"content\"] }} ? just name them without any explanations or other sentences" } ] }, "options": {}, "resource": "chat" }, "credentials": { "openAiApi": { "id": "0Vdk5RlVe7AoUdAM", "name": "OpenAi account" } }, "typeVersion": 1, "notes": "This openAi node performs automated tasks as part of the workflow." }, { "id": "0bfdb3be-76ef-4bb3-902f-f0869342b83c", "name": "Rename keywords", "type": "n8n-nodes-base.set", "position": [ -700, 620 ], "parameters": { "fields": { "values": [ { "name": "keywords", "stringValue": "={{ $json[\"message\"][\"content\"] }}" } ] }, "include": "none", "options": {} }, "typeVersion": 3.1, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "0387cf34-41c9-4729-8570-1db7b17c42f4", "name": "Rename Summary", "type": "n8n-nodes-base.set", "position": [ -700, 440 ], "parameters": { "fields": { "values": [ { "name": "=summary", "stringValue": "={{ $json[\"message\"][\"content\"] }}" } ] }, "include": "none", "options": {} }, "typeVersion": 3.1, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "5fa1702c-f0bf-4524-bc8f-6f550dd83f1e", "name": "Merge", "type": "n8n-nodes-base.merge", "position": [ -480, 560 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2.1, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "25128a71-b0d5-49a4-adb8-c3fbe03c0a85", "name": "Extract date", "type": "n8n-nodes-base.html", "position": [ -500, -160 ], "parameters": { "options": {}, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "YOUR_CREDENTIAL_HERE", "cssSelector": "div:nth-child(9) > div:nth-child(2) > span:nth-child(1)", "returnArray": true } ] } }, "typeVersion": 1, "notes": "This html node performs automated tasks as part of the workflow." }, { "id": "138b3bd6-494a-49b9-b5b8-c9febcfef9fb", "name": "Select posts of last 7 days", "type": "n8n-nodes-base.code", "position": [ 120, 0 ], "parameters": { "jsCode": "const currentDate = new Date();\nconst sevenDaysAgo = new Date(currentDate.setDate(currentDate.getDate() - 70)); // Change the number of days going back to your liking (e.g. from -7 to -1) -> BUT sync with the cron job (first node)\n\nconst filteredItems = items.filter(item => {\n const postDate = new Date(item.json[\"Date\"]); // Assuming \"Date\" is the field name in the extracted html\n return postDate >= sevenDaysAgo;\n});\n\nreturn filteredItems;\n" }, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow." }, { "id": "1ace953b-e298-4fc2-8970-327f736889ec", "name": "Merge date & links", "type": "n8n-nodes-base.merge", "position": [ -100, 0 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2.1, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "bba692fc-c225-41be-a969-179d8b99c071", "name": "HTTP Request1", "type": "n8n-nodes-base.httpRequest", "position": [ 320, 0 ], "parameters": { "url": "{{ $env.BASE_URL }}", "options": {} }, "typeVersion": 4.1, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "26671065-631f-4684-9ee1-15f26b4cf1e4", "name": "Merge Content with Date & Link", "type": "n8n-nodes-base.merge", "position": [ 500, 260 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2.1, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "79beb744-97b8-4072-824a-6736b0a080ef", "name": "Extract individual posts", "type": "n8n-nodes-base.html", "position": [ 500, 0 ], "parameters": { "options": {}, "operation": "extractHtmlContent", "extractionValues": { "values": [ { "key": "YOUR_CREDENTIAL_HERE", "cssSelector": "h1.fl-heading > span:nth-child(1)" }, { "key": "YOUR_CREDENTIAL_HERE", "cssSelector": ".fl-node-5c7574ae7d5c6 > div:nth-child(1)" } ] } }, "typeVersion": 1, "notes": "This html node performs automated tasks as part of the workflow." }, { "id": "e89d9de5-875b-453e-825a-26f2bebcc8df", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 80, -107 ], "parameters": { "width": 180.9747474601832, "height": 276.31054308676767, "content": "Select only the newest news: todays date going back xy days" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "8a603f2f-4208-48c7-b169-e5613f13fa7d", "name": "Merge ChatGPT output with Date & Link", "type": "n8n-nodes-base.merge", "position": [ -180, 560 ], "parameters": { "mode": "combine", "options": {}, "combinationMode": "mergeByPosition" }, "typeVersion": 2.1, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "e1036421-9ce1-4121-a692-602410ec7c95", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "disabled": true, "position": [ -539.7802584556148, -4.722020203185366 ], "parameters": { "width": 182.2748213508401, "height": 304.2550759710132, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nExtracting the individual links of the press release page in order to retrieve the individual posts on their respective **url**" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "3655ab22-6a17-429a-9d9b-d96bbcc78fee", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -538.404803912782, -304 ], "parameters": { "width": 178.75185894039254, "height": 289.463147786618, "content": "Extracting the dates of the posts of the press release page.\nThe right CSS selector has to be chosen.\n[More info on datagrab.io]({{ $env.API_BASE_URL }}" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "2e27fb4c-426a-41e1-b5fb-9b2d78acd2a7", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -1300, -299.82161760751774 ], "parameters": { "width": 334.4404040637068, "height": 1127.2017245821128, "content": "# Scraping posts of a news site without RSS feed\n\n\nThe [News Site]({{ $env.WEBHOOK_URL }} from Colt, a telecom company, does not offer an RSS feed, therefore web scraping is the \nchoice to extract and process the news.\n\nThe goal is to get only the newest posts, a summary of each post and their respective (technical) keywords.\n\nNote that the news site offers the links to each news post, but not the individual news. We collect first the links and dates of each post before extracting the newest ones.\n\nThe result is sent to a SQL database, in this case a NocoDB database.\n\nThis process happens each week thru a cron job.\n\n**Requirements**:\n- Basic understanding of CSS selectors and how to get them via browser (usually: right click → inspect)\n- ChatGPT API account - normal account is not sufficient\n- A NocoDB database - of course you may choose any type of output target\n\n**Assumptions**:\n- CSS selectors work on the news site\n- The post has a date with own CSS selector - meaning date is not part of the news content\n\n**\"Warnings\"**\n- Not every site likes to be scraped, especially not in high frequency\n- Each website is structured in different ways, the workflow may then need several adaptations.\n\n\nHappy about any suggestion to improve. You may contact me on **Mastodon**: {{ $env.WEBHOOK_URL }}" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "d43bd5b7-2aff-4a07-8aca-ca4747ec6c4d", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -927.8447474890202, -80 ], "parameters": { "width": 153.90180146729315, "height": 237.91333335255808, "content": "Weekly cron job" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "e732d136-fcf1-4fc3-8bb6-bdcea3c78d9e", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ -760, -80 ], "parameters": { "width": 185.41515152389002, "height": 241.454848504947, "content": "The html of the news site is being retrieved: {{ $env.WEBHOOK_URL }}" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "d5e29ec3-5ef2-42f3-b316-9350644dbba4", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -340, -306 ], "parameters": { "width": 187.3613302133812, "height": 469.2923233086395, "content": "As the extraction are returned as arrays, they transformed into individual JSON items to enable looping with other nodes" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "1af15c45-32c0-4abf-a35d-be7206823569", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ -120, -103.54151515238902 ], "parameters": { "width": 150, "height": 274.50898992724416, "content": "The links of the individual posts and the dates of the posts " }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "f7c42748-f227-42d0-a9e2-fcb16dbd0f75", "name": "Retrieve the web page for further processsing", "type": "n8n-nodes-base.httpRequest", "position": [ -720, 0 ], "parameters": { "url": "{{ $env.WEBHOOK_URL }}", "options": { "response": { "response": { "responseFormat": "text" } } } }, "typeVersion": 4.1, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "b2c36f26-8221-478f-a4b0-22758b1e5e58", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ 292, -100 ], "parameters": { "width": 155.0036363426638, "height": 272.1479798256519, "content": "Get the html of each individual **newest** post" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "6ae05c31-c09a-4b4e-a013-41571937bc39", "name": "Sticky Note10", "type": "n8n-nodes-base.stickyNote", "position": [ 460, -100 ], "parameters": { "width": 184.07417896879767, "height": 269.2504410842093, "content": "Extracting the title & content (text) of each individual news post with the right CSS selector" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "e2da76d4-0c8c-4c61-924f-50aa9387e9ab", "name": "Sticky Note11", "type": "n8n-nodes-base.stickyNote", "position": [ 460, 180 ], "parameters": { "width": 191.87778190338406, "height": 234.13422787857044, "content": "Merge link to url, date with content (text) and title of each news psot" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "c124aaac-dce6-4658-9027-bdfe5c0c81e6", "name": "Sticky Note12", "type": "n8n-nodes-base.stickyNote", "position": [ -907.2264215202996, 331.0681740778203 ], "parameters": { "width": 150, "height": 256.2444361932317, "content": "Create a summary of each news post with ChatGPT. You need a ChatGPT API account for this" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "c9037e74-007b-4e44-b7f9-90e78b853eb5", "name": "Sticky Note13", "type": "n8n-nodes-base.stickyNote", "position": [ -909.595196087218, 610.7495589157902 ], "parameters": { "width": 152.85976723045226, "height": 218.52702200939785, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\nGet the 3 keywords of each news post" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "756397d9-de80-4114-9dee-b4f4b9593333", "name": "Sticky Note14", "type": "n8n-nodes-base.stickyNote", "position": [ -740, 340 ], "parameters": { "width": 182.7735784797001, "height": 489.05192374172555, "content": "Just a renaming of data fields and eliminating unnecessary ones" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "a0dcb254-f064-45ed-8e22-30a6d079085b", "name": "Sticky Note15", "type": "n8n-nodes-base.stickyNote", "position": [ -520, 480 ], "parameters": { "width": 169.7675735887227, "height": 254.94383570413422, "content": "Merge summary and keywords of each news post" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "82993166-b273-4b82-a954-554c6892f825", "name": "Schedule Trigger each week", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -900, 0 ], "parameters": { "rule": { "interval": [ { "field": "weeks", "triggerAtDay": [ 3 ], "triggerAtHour": 4, "triggerAtMinute": 32 } ] } }, "typeVersion": 1.1, "notes": "This scheduleTrigger node performs automated tasks as part of the workflow." }, { "id": "3d670eb9-5a36-4cd9-8d2c-40adf848485e", "name": "Sticky Note16", "type": "n8n-nodes-base.stickyNote", "position": [ -220, 477.5081090810816 ], "parameters": { "width": 180.1723775015045, "height": 260.5279202647822, "content": "Add title, link and date to summary and keywords of each news post" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "62021393-e988-4834-9fa2-75a957b42890", "name": "NocoDB news database", "type": "n8n-nodes-base.nocoDb", "position": [ 60, 560 ], "parameters": { "table": "mhbalmu9aaqcun6", "fieldsUi": { "fieldValues": [ { "fieldName": "=News_Source", "fieldValue": "=Colt" }, { "fieldName": "Title", "fieldValue": "={{ $json[\"title\"] }}" }, { "fieldName": "Date", "fieldValue": "={{ $json[\"Date\"] }}" }, { "fieldName": "Link", "fieldValue": "={{ $json[\"Link\"] }}" }, { "fieldName": "Summary", "fieldValue": "={{ $json[\"summary\"] }}" }, { "fieldName": "Keywords", "fieldValue": "={{ $json[\"keywords\"] }}" } ] }, "operation": "create", "projectId": "prqu4e8bjj4bv1j", "authentication": "{{ $credentials.nocoDbApiToken }}" }, "credentials": { "nocoDbApiToken": { "id": "gjNns0VJMS3P2RQ3", "name": "NocoDB Token account" } }, "typeVersion": 2, "notes": "This nocoDb node performs automated tasks as part of the workflow." }, { "id": "e59e9fab-10a7-470b-afa6-e1d4b4e57723", "name": "Sticky Note17", "type": "n8n-nodes-base.stickyNote", "position": [ 280, 480 ], "parameters": { "width": 483.95825869942666, "height": 268.5678114630957, "content": "## News summaries and keywords → database\n\n[NocoDB]({{ $env.WEBHOOK_URL }} is an SQL database, here we store the news summaries and keywords for further processing. Any other output target can be chosen here, e.g. e-mail, Excel etc.\n\nYou need first have that database structured before appending the news summaries and additional fields. The you can shape this node.\n\nSome fields may be edited in the database itself (e.g. relevance of the news to you) and may be filled therefore with a default value or not at all" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "253b414b-9a5b-4a25-892b-9aa011d55d28", "name": "Sticky Note18", "type": "n8n-nodes-base.stickyNote", "position": [ 20, 480 ], "parameters": { "width": 262.99083066277313, "height": 268.56781146309544, "content": "" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "438e8dde-ce0a-4e5e-8d62-d735d19ec189", "name": "Create single link items", "type": "n8n-nodes-base.itemLists", "position": [ -300, 0 ], "parameters": { "options": { "destinationFieldName": "Link" }, "fieldToSplitOut": "data" }, "typeVersion": 3, "notes": "This itemLists node performs automated tasks as part of the workflow." }, { "id": "d721776b-fefc-4e72-91ef-6710f10b0393", "name": "Create single date items", "type": "n8n-nodes-base.itemLists", "position": [ -300, -160 ], "parameters": { "options": { "destinationFieldName": "Date" }, "fieldToSplitOut": "data" }, "typeVersion": 3, "notes": "This itemLists node performs automated tasks as part of the workflow." } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "ff89d802-3bcf-4b34-9cd9-776b1f3b5eab", "connections": { "bba692fc-c225-41be-a969-179d8b99c071": { "main": [ [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-b1d74898", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-dbf56fcb", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-a7b0f1a6", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-ffd75133", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-c5007e06", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-c676aad6", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-a702cd6b", "type": "main", "index": 0 } ], [ { "node": "error-handler-bba692fc-c225-41be-a969-179d8b99c071-a4ae304d", "type": "main", "index": 0 } ] ] }, "f7c42748-f227-42d0-a9e2-fcb16dbd0f75": { "main": [ [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-254b5fb8", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-87109ab0", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-54f66d2b", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-469510ce", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-2fb30a32", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-2ddb1737", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-9a3f7c02", "type": "main", "index": 0 } ], [ { "node": "error-handler-f7c42748-f227-42d0-a9e2-fcb16dbd0f75-6199ecc5", "type": "main", "index": 0 } ] ] }, "b874b570-daae-4878-b525-07ac30756eb1": { "main": [ [ { "node": "error-handler-b874b570-daae-4878-b525-07ac30756eb1-f10dffb1", "type": "main", "index": 0 } ] ] }, "72696278-2d44-4073-936a-6fe9df1bc7d8": { "main": [ [ { "node": "error-handler-72696278-2d44-4073-936a-6fe9df1bc7d8-f0ed74e8", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: News Extraction. This workflow integrates 11 different services: stickyNote, httpRequest, itemLists, code, scheduleTrigger. It contains 42 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: News Extraction. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }