Skip to content

Add episode 6: the return of LinkedIn

David1acf5b922379
diff --git a/README.md b/README.md
index e304ccb..3298b2b 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,4 @@ In this repo, you can find the n8n templates we created for the episodes of [AI
- [Episode 3: Making LinkedIn posts using Human in the Loop approval process](episode_3)
- [Episode 4: Deep Research Agent using Google](episode_4)
- [Episode 5: Creating a blog writing system using deep research](episode_5)
+- [Episode 6: Lead generation with X-Ray search and LinkedIn](episode_6)
diff --git a/episode_6/README.md b/episode_6/README.md
new file mode 100644
index 0000000..f38969b
--- /dev/null
+++ b/episode_6/README.md
@@ -0,0 +1,9 @@
+# Episode 6: Lead generation with X-Ray search and LinkedIn
+
+## Get the resources
+
+- [Template: Find leads using X-Ray search and Linkedin](template_job_board_linkedin_leadgen.json)
+
+## Watch the video
+
+[![LinkedIn leads with n8n without paying for APIs (downloadable template)](https://img.youtube.com/vi/5ylW4wtsZGE/0.jpg)](https://www.youtube.com/watch?v=5ylW4wtsZGE)
diff --git a/episode_6/template_job_board_linkedin_leadgen.json b/episode_6/template_job_board_linkedin_leadgen.json
new file mode 100644
index 0000000..77ead0a
--- /dev/null
+++ b/episode_6/template_job_board_linkedin_leadgen.json
@@ -0,0 +1,1616 @@
+{
+ "name": "Template: Job board + LinkedIn leadgen",
+ "nodes": [
+ {
+ "parameters": {},
+ "type": "n8n-nodes-base.manualTrigger",
+ "typeVersion": 1,
+ "position": [-360, -20],
+ "id": "75936d24-d058-461a-b355-ea742fa9a311",
+ "name": "When clicking ‘Test workflow’"
+ },
+ {
+ "parameters": {
+ "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n if (item.json.area_html) {\n const parts = item.json.area_html.split('<span class=\"before:middot\"></span>');\n item.json.area = parts?.[0]?.trim()\n item.json.followers = parts?.[1]?.trim()\n }\n}\n\nreturn $input.all();"
+ },
+ "type": "n8n-nodes-base.code",
+ "typeVersion": 2,
+ "position": [3340, 60],
+ "id": "a00fb760-ee18-4192-b8ab-9e829ea68007",
+ "name": "Code1"
+ },
+ {
+ "parameters": {
+ "fieldToSplitOut": "definitions",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitOut",
+ "typeVersion": 1,
+ "position": [3340, 460],
+ "id": "e70b11e2-76ab-40c9-97ec-b8faf57b8a99",
+ "name": "Split Out"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "definitions",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "key",
+ "cssSelector": "dt"
+ },
+ {
+ "key": "value",
+ "cssSelector": "dd"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3560, 460],
+ "id": "0519d9c2-1bd8-48fd-a523-e5a852311ae6",
+ "name": "HTML5"
+ },
+ {
+ "parameters": {
+ "jsCode": "const data = {};\n// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n let value = item.json.value;\n const key = item.json.key;\n if (key === 'Website') {\n value = value.split('\\n')[0]\n }\n data[item.json.key] = value;\n}\n\nreturn {\n ...data,\n description: $('Extract about us').first().json.description\n}"
+ },
+ "type": "n8n-nodes-base.code",
+ "typeVersion": 2,
+ "position": [3780, 460],
+ "id": "1fd7e856-1782-465a-a0ed-b86a47394ab8",
+ "name": "Code2"
+ },
+ {
+ "parameters": {
+ "fieldToSplitOut": "employee",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitOut",
+ "typeVersion": 1,
+ "position": [3320, 660],
+ "id": "fee9ab43-7998-4dfc-a0d1-6513bbef0aae",
+ "name": "Split Out1"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "employee",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "name",
+ "cssSelector": "h3"
+ },
+ {
+ "key": "title",
+ "cssSelector": "h4"
+ },
+ {
+ "key": "linkedin_url",
+ "cssSelector": "a",
+ "returnValue": "attribute",
+ "attribute": "href"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3540, 660],
+ "id": "52fb7c68-434c-4efc-a671-7f84b2c79c4e",
+ "name": "HTML7"
+ },
+ {
+ "parameters": {
+ "aggregate": "aggregateAllItemData",
+ "destinationFieldName": "employees",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.aggregate",
+ "typeVersion": 1,
+ "position": [3760, 660],
+ "id": "f8d59b3b-ff80-4dfc-96b3-be4781481746",
+ "name": "Aggregate"
+ },
+ {
+ "parameters": {
+ "fieldToSplitOut": "article",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitOut",
+ "typeVersion": 1,
+ "position": [3300, 880],
+ "id": "f89f08c4-0a1b-4cba-8219-d5d4800d67f3",
+ "name": "Split Out2"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "article",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "link",
+ "cssSelector": ".main-feed-card__overlay-link",
+ "returnValue": "attribute",
+ "attribute": "href"
+ },
+ {
+ "key": "content",
+ "cssSelector": "[data-test-id=\"main-feed-activity-card__commentary\"]"
+ },
+ {
+ "key": "reshared_content",
+ "cssSelector": "[data-test-id=\"feed-reshare-content__commentary\"]"
+ },
+ {
+ "key": "time",
+ "cssSelector": "time",
+ "skipSelectors": "span"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3520, 880],
+ "id": "0a28de0a-eaa1-41ce-a271-3e8e155035e6",
+ "name": "HTML9"
+ },
+ {
+ "parameters": {
+ "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n Object.keys(item.json).forEach(key => {\n if (!item.json[key]) {\n delete item.json[key]\n }\n })\n \n let time;\n if (item.json.time.endsWith('h')) {\n time = { hours: parseInt(item.json.time) }\n }\n else if (item.json.time.endsWith('d')) {\n time = { days: parseInt(item.json.time) }\n } else if (item.json.time.endsWith('w')) {\n time = { weeks: parseInt(item.json.time) }\n } else if (item.json.time.endsWith('mo')) {\n time = { months: parseInt(item.json.time) }\n }\n\n if (time) {\n item.json.posted_at = $now.minus(time).toFormat('yyyy-MM-dd')\n }\n\n delete item.json.time\n}\n\nreturn $input.all();"
+ },
+ "type": "n8n-nodes-base.code",
+ "typeVersion": 2,
+ "position": [3740, 880],
+ "id": "7041f6bd-ff5b-465b-88bb-a88bafc9d976",
+ "name": "Code3"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "db889fcb-eb49-4c25-aed7-19d00c63c23c",
+ "leftValue": "={{ DateTime.fromISO($json.posted_at).toSeconds() }}",
+ "rightValue": "={{ $now.minus(3, 'months').toSeconds() }}",
+ "operator": {
+ "type": "number",
+ "operation": "gt"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.filter",
+ "typeVersion": 2.2,
+ "position": [3960, 880],
+ "id": "ba6385f9-b136-4439-8106-904484a13235",
+ "name": "Filter1"
+ },
+ {
+ "parameters": {
+ "aggregate": "aggregateAllItemData",
+ "destinationFieldName": "updates",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.aggregate",
+ "typeVersion": 1,
+ "position": [4180, 880],
+ "id": "cb936423-3206-468c-a9b9-7e837b773fc7",
+ "name": "Aggregate1"
+ },
+ {
+ "parameters": {
+ "aggregate": "aggregateAllItemData",
+ "destinationFieldName": "products",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.aggregate",
+ "typeVersion": 1,
+ "position": [3760, 1100],
+ "id": "94276571-4e9a-44c5-b9d7-9781a67729e6",
+ "name": "Aggregate2"
+ },
+ {
+ "parameters": {
+ "fieldToSplitOut": "products",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitOut",
+ "typeVersion": 1,
+ "position": [3320, 1100],
+ "id": "52d74478-0b0a-4999-85a1-1e24e78576a0",
+ "name": "Split Out3"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "50bff6d4-3e6f-4104-b345-62b84a818ae7",
+ "name": "products",
+ "value": "={{ $json.products }}",
+ "type": "array"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [4180, 1160],
+ "id": "cd026b52-214c-4abc-8ce1-6a907c55570f",
+ "name": "Edit Fields3"
+ },
+ {
+ "parameters": {
+ "fieldToSplitOut": "affiliate_pages",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitOut",
+ "typeVersion": 1,
+ "position": [3320, 1500],
+ "id": "c135cc5d-7e08-4ea1-b2ba-689e46296653",
+ "name": "Split Out4"
+ },
+ {
+ "parameters": {
+ "aggregate": "aggregateAllItemData",
+ "destinationFieldName": "affiliate_pages",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.aggregate",
+ "typeVersion": 1,
+ "position": [3760, 1500],
+ "id": "ad9aa117-74cb-441c-9c98-4c35a1dfce90",
+ "name": "Aggregate4"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "c2149253-32cd-43ce-82e3-815832fd3042",
+ "name": "affiliate_pages",
+ "value": "={{ $json.affiliate_pages }}",
+ "type": "array"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [4180, 1500],
+ "id": "bf76022d-e1ab-4494-8e8b-7c6a66af875b",
+ "name": "Edit Fields6"
+ },
+ {
+ "parameters": {
+ "mode": "combine",
+ "combineBy": "combineByPosition",
+ "numberInputs": 7,
+ "options": {}
+ },
+ "type": "n8n-nodes-base.merge",
+ "typeVersion": 3.1,
+ "position": [4820, 480],
+ "id": "7302c508-591a-4387-a0e6-e141d62d29bc",
+ "name": "Merge"
+ },
+ {
+ "parameters": {
+ "aggregate": "aggregateAllItemData",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.aggregate",
+ "typeVersion": 1,
+ "position": [5160, 560],
+ "id": "20ad6cdc-2f56-4db9-b9e0-cfdb77a899da",
+ "name": "Aggregate3"
+ },
+ {
+ "parameters": {
+ "model": {
+ "__rl": true,
+ "mode": "list",
+ "value": "gpt-4o-mini"
+ },
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
+ "typeVersion": 1.2,
+ "position": [5920, 1080],
+ "id": "c443eb58-0cb7-4d88-b66c-a4c9bee9cda4",
+ "name": "OpenAI Chat Model",
+ "credentials": {
+ "openAiApi": {
+ "id": "tGvJRP2th9CbI2oq",
+ "name": "OpenAi account 2"
+ }
+ }
+ },
+ {
+ "parameters": {
+ "schemaType": "manual",
+ "inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"company_summary\": {\n \"type\": \"string\",\n \"description\": \"The summary of the company information\"\n },\n \"why_good_prospect\": {\n \"type\": \"string\",\n \"description\": \"Explanation why this company is a good prospect\"\n }\n },\n \"required\": [\n \"company_summary\",\n \"why_good_prospect\"\n ]\n}"
+ },
+ "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
+ "typeVersion": 1.2,
+ "position": [6100, 1080],
+ "id": "d3c706de-2ab5-4ec5-8403-769c9eab6d81",
+ "name": "Structured Output Parser"
+ },
+ {
+ "parameters": {
+ "batchSize": 2,
+ "options": {}
+ },
+ "type": "n8n-nodes-base.splitInBatches",
+ "typeVersion": 3,
+ "position": [960, -20],
+ "id": "835d779a-b6c7-4421-9a41-cbc660793e2d",
+ "name": "Loop Over Items"
+ },
+ {
+ "parameters": {
+ "maxItems": 2
+ },
+ "type": "n8n-nodes-base.limit",
+ "typeVersion": 1,
+ "position": [620, -20],
+ "id": "c00cbc8a-247c-491a-824b-2940ff523b33",
+ "name": "Limit"
+ },
+ {
+ "parameters": {
+ "content": "# Configure",
+ "height": 360,
+ "color": 3
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [-40, -140],
+ "id": "52981cfa-ea8a-4ff4-9b6e-d5ceea7a62b6",
+ "name": "Sticky Note"
+ },
+ {
+ "parameters": {
+ "content": "# Change or remove the limit",
+ "height": 440,
+ "color": 3
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [560, -220],
+ "id": "a3f1174e-d1cc-4f87-b1ea-74f3b90f21b4",
+ "name": "Sticky Note1"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "baa6e64d-4305-421a-be0a-60cc6d2b06bf",
+ "name": "GOOGLE_API_KEY",
+ "value": "{YOUR_GOOGLE_API_KEY}",
+ "type": "string"
+ },
+ {
+ "id": "d8e33d4c-b790-488f-a57c-58b80bb5824d",
+ "name": "GOOGLE_CUSTOM_SEARCH",
+ "value": "{YOUR_GOOGLE_CUSTOM_SEARCH_ID}",
+ "type": "string"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [20, -20],
+ "id": "a6287afe-4a35-419e-b81c-469448e4e5ed",
+ "name": "Configure"
+ },
+ {
+ "parameters": {
+ "url": "https://remotive.com/remote-jobs/feed/marketing",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.rssFeedRead",
+ "typeVersion": 1.1,
+ "position": [320, -20],
+ "id": "30c86e8b-64bb-4061-b635-77aa1a0f6f3a",
+ "name": "Get job board RSS feed"
+ },
+ {
+ "parameters": {
+ "url": "={{ $json.link }}",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.2,
+ "position": [1320, 0],
+ "id": "f43e9074-6d23-4fa9-8e80-e92dec65777a",
+ "name": "Scrape the job ad"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "info",
+ "cssSelector": ".tw-mt-4.tw-text-sm"
+ },
+ {
+ "key": "job_ad",
+ "cssSelector": ".tw-flex > section > .tw-mt-8 > .left > div:nth-child(1)"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [1760, 0],
+ "id": "755c78d3-f71c-4ff4-bf74-071eb0a9c3c4",
+ "name": "Extract job ad"
+ },
+ {
+ "parameters": {
+ "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n const location = item.json.info.split('Location: ')[1]\n item.json.location = location.slice(0, location.length - 1)\n}\n\nreturn $input.all();"
+ },
+ "type": "n8n-nodes-base.code",
+ "typeVersion": 2,
+ "position": [1980, 0],
+ "id": "a4bab2bf-10a3-463d-bcd8-62838f914bca",
+ "name": "Extract location data"
+ },
+ {
+ "parameters": {
+ "url": "https://www.googleapis.com/customsearch/v1",
+ "sendQuery": true,
+ "queryParameters": {
+ "parameters": [
+ {
+ "name": "key",
+ "value": "={{ $('Configure').item.json.GOOGLE_API_KEY }}"
+ },
+ {
+ "name": "cx",
+ "value": "={{ $('Configure').item.json.GOOGLE_CUSTOM_SEARCH }}"
+ },
+ {
+ "name": "q",
+ "value": "={{ `site:linkedin.com/company ${$('Extract location data').item.json.creator} ${$json.location}` }}"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.2,
+ "position": [1380, 500],
+ "id": "ef1249f4-60ed-42c1-a481-5983cc67885f",
+ "name": "Google X-Ray Search"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "6a5c5157-a1de-46c9-b6fa-c3f999a76d1e",
+ "leftValue": "={{ $json.searchInformation.totalResults.toNumber() }}",
+ "rightValue": 0,
+ "operator": {
+ "type": "number",
+ "operation": "gt"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [1600, 500],
+ "id": "6362da74-8e3e-4c8a-9f7d-b7f3eb3ff379",
+ "name": "Results?"
+ },
+ {
+ "parameters": {
+ "url": "={{ $json.linkedin_url }}",
+ "sendHeaders": true,
+ "headerParameters": {
+ "parameters": [
+ {
+ "name": "user-agent",
+ "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
+ },
+ {
+ "name": "referer",
+ "value": "https://www.google.com/"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.2,
+ "position": [2180, 480],
+ "id": "fde13240-b6a7-4c25-b2a4-cddb3a77cbb5",
+ "name": "Scrape LinkedIn"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "about_us",
+ "cssSelector": ".core-section-container[data-test-id=\"about-us\"]",
+ "returnValue": "html"
+ },
+ {
+ "key": "locations",
+ "cssSelector": ".core-section-container.locations",
+ "returnValue": "html"
+ },
+ {
+ "key": "employees",
+ "cssSelector": ".core-section-container[data-test-id=\"employees-at\"]",
+ "returnValue": "html"
+ },
+ {
+ "key": "updates",
+ "cssSelector": ".core-section-container[data-test-id=\"updates\"]",
+ "returnValue": "html"
+ },
+ {
+ "key": "info",
+ "cssSelector": ".top-card-layout__card .top-card-layout__entity-info:nth-child(1)",
+ "returnValue": "html"
+ },
+ {
+ "key": "products",
+ "cssSelector": ".core-section-container > .core-section-container__content > .base-card",
+ "returnValue": "html",
+ "returnArray": true
+ },
+ {
+ "key": "crunchbase",
+ "cssSelector": "a[data-tracking-control-name=\"funding_crunchbase\"]",
+ "returnValue": "attribute",
+ "attribute": "href"
+ },
+ {
+ "key": "affiliate_pages",
+ "cssSelector": "section[data-test-id=\"affiliated-pages\"] > div > ul > li",
+ "returnValue": "html",
+ "returnArray": true
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [2520, 480],
+ "id": "5a3edba8-5aef-4e55-b16f-010320ed5d30",
+ "name": "Extract main blocks"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "info",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "name",
+ "cssSelector": "h1"
+ },
+ {
+ "key": "category",
+ "cssSelector": "h2"
+ },
+ {
+ "key": "area_html",
+ "cssSelector": "h3",
+ "returnValue": "html"
+ },
+ {
+ "key": "summary",
+ "cssSelector": "h4"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3120, 60],
+ "id": "c5c1cc8e-62b2-47fb-8214-9136f0a93d02",
+ "name": "Extract info"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "about_us",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "description",
+ "cssSelector": "p"
+ },
+ {
+ "key": "definitions",
+ "cssSelector": "dl > div",
+ "returnValue": "html",
+ "returnArray": true
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3120, 460],
+ "id": "11abc9ee-1989-474b-b3c5-c51e0d1e108a",
+ "name": "Extract about us"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "employees",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "employee",
+ "cssSelector": "ul li",
+ "returnValue": "html",
+ "returnArray": true
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3100, 660],
+ "id": "9761d0bd-0525-4897-a217-20b95acba1c4",
+ "name": "Extract employees"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "locations",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "locations",
+ "cssSelector": "div[id^=\"address-\"]",
+ "returnArray": true
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3480, 240],
+ "id": "65a1d070-fdb4-4ed2-8364-f9a7a0a308e1",
+ "name": "Extract locations"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "updates",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "article",
+ "cssSelector": "div[data-id=\"entire-feed-card-link\"]",
+ "returnValue": "html",
+ "returnArray": true
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3080, 880],
+ "id": "79dd423a-294e-43b1-b1a8-87a7cd2f59c5",
+ "name": "Extract updates"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "4a990f72-dc16-464c-b35c-1573c38b2d18",
+ "leftValue": "={{ $json.products }}",
+ "rightValue": "",
+ "operator": {
+ "type": "array",
+ "operation": "notEmpty",
+ "singleValue": true
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [3080, 1120],
+ "id": "e9b72a69-5c29-4490-a3c0-6d94eb9fea29",
+ "name": "Are there products?"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "4b4a37dd-46e9-46f3-8dc6-1767a75375c2",
+ "leftValue": "={{ $json.affiliate_pages }}",
+ "rightValue": "",
+ "operator": {
+ "type": "array",
+ "operation": "notEmpty",
+ "singleValue": true
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [3080, 1520],
+ "id": "5ac34b71-37f3-48b2-9b5d-18e5aef13ef5",
+ "name": "Are there affiliated pages?"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "2fa0ab4a-ca7c-47ab-90cc-75f8fe83b372",
+ "name": "affiliate_pages",
+ "value": "[]",
+ "type": "array"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [3320, 1720],
+ "id": "4e3a74a8-a29f-453c-975e-6a0d232c18b4",
+ "name": "No affiliated pages"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "6d5b89ba-9161-4999-bf63-8b0dad2d0f86",
+ "name": "products",
+ "value": "=[]",
+ "type": "array"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [3320, 1280],
+ "id": "de21f912-2ff1-412f-aeb7-e8b93d2f4d2a",
+ "name": "No products"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "products",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "name",
+ "cssSelector": "h3",
+ "skipSelectors": "img"
+ },
+ {
+ "key": "category",
+ "cssSelector": "h4 a"
+ },
+ {
+ "key": "description",
+ "cssSelector": "p"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3540, 1100],
+ "id": "55f1f71b-918a-4854-9ff9-7c7726903c17",
+ "name": "Extract products"
+ },
+ {
+ "parameters": {
+ "operation": "extractHtmlContent",
+ "dataPropertyName": "affiliate_pages",
+ "extractionValues": {
+ "values": [
+ {
+ "key": "title",
+ "cssSelector": "h3"
+ },
+ {
+ "key": "link",
+ "cssSelector": "a",
+ "returnValue": "attribute",
+ "attribute": "href"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.html",
+ "typeVersion": 1.2,
+ "position": [3540, 1500],
+ "id": "fcae2015-c82c-489e-a9e1-3add7557bbf0",
+ "name": "Extract affiliated pages"
+ },
+ {
+ "parameters": {
+ "promptType": "define",
+ "text": "=<Instruction>\nOur company sells marketing services. We scraped a list of marketing jobs, and found the linkedin profile and other data points of the advertiser.\n\nCreate a summary about this prospect that can be shared in the company Slack for the sales team.\n\nThe important signals are\n1. The company is looking for a hire, use information from the job ad\n2. The company does have a team that we target\n\nAlso make sure information from their new updates are also extracted.\n\nThe structure of the message should have\n1. Name of the company\n2. Quick summary of the company\n3. Why it's a good prospect\n</Instruction>\n\n<JobAd>\n{{ $('Extract job ad').item.json.job_ad }}\n</JobAd>\n\n<Data>\n{{ JSON.stringify($json.data, null, 2) }}\n</Data>",
+ "hasOutputParser": true
+ },
+ "type": "@n8n/n8n-nodes-langchain.chainLlm",
+ "typeVersion": 1.6,
+ "position": [5920, 860],
+ "id": "a062f98b-5fec-437c-a6ab-10fa4d52ed3b",
+ "name": "Summarize available data"
+ },
+ {
+ "parameters": {
+ "sendTo": "{YOUR_EMAIL_ADDRESS}",
+ "subject": "=New prospect: {{ $('Aggregate3').item.json.data[0].name }}",
+ "message": "=<h1>Company name: {{ $('Aggregate3').item.json.data[0].name }}</h1>\n<p>Category: {{ $('Aggregate3').item.json.data[0].category }}</p>\n<p>Linkedin Page: {{ $('Set Linkedin URL from the first result').item.json.linkedin_url }}</p>\n<p>Website: {{ $('Aggregate3').item.json.data[0].Website }}</p>\n{{ $('Extract main blocks').item.json.crunchbase ? `<p>Crunchbase: ${$('Main content').item.json.crunchbase.split('?')[0]}</p>` : `` }}\n\n<h2>Summary</h2>\n<p>{{ $json.output.company_summary }}</p>\n<h2>Why is it a good prospect</h2>\n<p>{{ $json.output.why_good_prospect }}</p>",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.gmail",
+ "typeVersion": 2.1,
+ "position": [6280, 860],
+ "id": "dad2eba2-5994-4c19-8cc4-aef177988065",
+ "name": "Send email",
+ "webhookId": "5239298c-8f8b-408b-bc7e-cc36cd3a59e8",
+ "credentials": {
+ "gmailOAuth2": {
+ "id": "E1ofNfqugb4UykcT",
+ "name": "Gmail 2rum2room2"
+ }
+ }
+ },
+ {
+ "parameters": {
+ "content": "# Use the data\n\nPush the collected data into\n\n- your CRM\n- Airtable\n- Google Sheets\n- Notion\n- postgres\n- ...",
+ "height": 760,
+ "width": 660
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [5820, 500],
+ "id": "9d23305b-a4a2-4143-a0eb-5252209197b5",
+ "name": "Sticky Note2"
+ },
+ {
+ "parameters": {
+ "content": "# Extracting the data from LinkedIn\n\n## The CSS selectors could occasionally change - don't panic, very easy to fix, just replace them in the workflow. As of 25/4/10 these selectors are working",
+ "height": 2160,
+ "width": 2920
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [2440, -220],
+ "id": "19d4f56f-562f-4677-acf6-d1e5b16ae847",
+ "name": "Sticky Note3"
+ },
+ {
+ "parameters": {
+ "content": "# Wait\n\n## To avoid being flagged or detected, wait some seconds before doing another scraping",
+ "height": 380,
+ "width": 440
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [6300, 1840],
+ "id": "d99561f4-f73f-4f34-993b-a130b1912d86",
+ "name": "Sticky Note4"
+ },
+ {
+ "parameters": {},
+ "type": "n8n-nodes-base.wait",
+ "typeVersion": 1.1,
+ "position": [6460, 2060],
+ "id": "bc8ed2e4-1ec8-4bb0-859d-2f59cd48a175",
+ "name": "Wait 5s",
+ "webhookId": "0c941134-e324-4857-8e36-2ded681a4b38"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "11f75f95-038e-49c4-b7b3-2eb765ad2d1b",
+ "name": "linkedin_url",
+ "value": "={{ $json.items[0].link }}",
+ "type": "string"
+ },
+ {
+ "id": "dd80b252-cd03-42f4-be70-069f565d046a",
+ "name": "description",
+ "value": "={{ $json.items[0].pagemap.metatags[0]['og:description'] }}",
+ "type": "string"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [1960, 480],
+ "id": "137ce2cb-4461-4c9f-8e0d-3941045be4c2",
+ "name": "Set Linkedin URL from the first result"
+ }
+ ],
+ "pinData": {},
+ "connections": {
+ "When clicking ‘Test workflow’": {
+ "main": [
+ [
+ {
+ "node": "Configure",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Split Out": {
+ "main": [
+ [
+ {
+ "node": "HTML5",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "HTML5": {
+ "main": [
+ [
+ {
+ "node": "Code2",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Split Out1": {
+ "main": [
+ [
+ {
+ "node": "HTML7",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "HTML7": {
+ "main": [
+ [
+ {
+ "node": "Aggregate",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Split Out2": {
+ "main": [
+ [
+ {
+ "node": "HTML9",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "HTML9": {
+ "main": [
+ [
+ {
+ "node": "Code3",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Code3": {
+ "main": [
+ [
+ {
+ "node": "Filter1",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Filter1": {
+ "main": [
+ [
+ {
+ "node": "Aggregate1",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Code1": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Code2": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 2
+ }
+ ]
+ ]
+ },
+ "Aggregate": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 3
+ }
+ ]
+ ]
+ },
+ "Aggregate1": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 4
+ }
+ ]
+ ]
+ },
+ "Split Out3": {
+ "main": [
+ [
+ {
+ "node": "Extract products",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Aggregate2": {
+ "main": [
+ [
+ {
+ "node": "Edit Fields3",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Split Out4": {
+ "main": [
+ [
+ {
+ "node": "Extract affiliated pages",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Aggregate4": {
+ "main": [
+ [
+ {
+ "node": "Edit Fields6",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Edit Fields3": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 5
+ }
+ ]
+ ]
+ },
+ "Edit Fields6": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 6
+ }
+ ]
+ ]
+ },
+ "Merge": {
+ "main": [
+ [
+ {
+ "node": "Aggregate3",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Aggregate3": {
+ "main": [
+ [
+ {
+ "node": "Summarize available data",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "OpenAI Chat Model": {
+ "ai_languageModel": [
+ [
+ {
+ "node": "Summarize available data",
+ "type": "ai_languageModel",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Structured Output Parser": {
+ "ai_outputParser": [
+ [
+ {
+ "node": "Summarize available data",
+ "type": "ai_outputParser",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Loop Over Items": {
+ "main": [
+ [],
+ [
+ {
+ "node": "Scrape the job ad",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Limit": {
+ "main": [
+ [
+ {
+ "node": "Loop Over Items",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Configure": {
+ "main": [
+ [
+ {
+ "node": "Get job board RSS feed",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Get job board RSS feed": {
+ "main": [
+ [
+ {
+ "node": "Limit",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Scrape the job ad": {
+ "main": [
+ [
+ {
+ "node": "Extract job ad",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract job ad": {
+ "main": [
+ [
+ {
+ "node": "Extract location data",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract location data": {
+ "main": [
+ [
+ {
+ "node": "Google X-Ray Search",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Google X-Ray Search": {
+ "main": [
+ [
+ {
+ "node": "Results?",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Results?": {
+ "main": [
+ [
+ {
+ "node": "Set Linkedin URL from the first result",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Loop Over Items",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Scrape LinkedIn": {
+ "main": [
+ [
+ {
+ "node": "Extract main blocks",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract main blocks": {
+ "main": [
+ [
+ {
+ "node": "Extract info",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Extract locations",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Extract about us",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Extract employees",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Extract updates",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Are there products?",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Are there affiliated pages?",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract info": {
+ "main": [
+ [
+ {
+ "node": "Code1",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract about us": {
+ "main": [
+ [
+ {
+ "node": "Split Out",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract employees": {
+ "main": [
+ [
+ {
+ "node": "Split Out1",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract locations": {
+ "main": [
+ [
+ {
+ "node": "Merge",
+ "type": "main",
+ "index": 1
+ }
+ ]
+ ]
+ },
+ "Extract updates": {
+ "main": [
+ [
+ {
+ "node": "Split Out2",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Are there products?": {
+ "main": [
+ [
+ {
+ "node": "Split Out3",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "No products",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Are there affiliated pages?": {
+ "main": [
+ [
+ {
+ "node": "Split Out4",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "No affiliated pages",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "No affiliated pages": {
+ "main": [
+ [
+ {
+ "node": "Edit Fields6",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "No products": {
+ "main": [
+ [
+ {
+ "node": "Edit Fields3",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract products": {
+ "main": [
+ [
+ {
+ "node": "Aggregate2",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Extract affiliated pages": {
+ "main": [
+ [
+ {
+ "node": "Aggregate4",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Summarize available data": {
+ "main": [
+ [
+ {
+ "node": "Send email",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Send email": {
+ "main": [
+ [
+ {
+ "node": "Wait 5s",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Wait 5s": {
+ "main": [
+ [
+ {
+ "node": "Loop Over Items",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Set Linkedin URL from the first result": {
+ "main": [
+ [
+ {
+ "node": "Scrape LinkedIn",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ }
+ },
+ "active": false,
+ "settings": {
+ "executionOrder": "v1"
+ },
+ "versionId": "1f00732a-a0b2-40b3-908a-1706dbb32c06",
+ "meta": {
+ "templateCredsSetupCompleted": true,
+ "instanceId": "636db6b6ab21a21c6458e2137f340e33dc3e49f5a1c560c8d1e2372c227cf40e"
+ },
+ "id": "giQWXEEBqglvTXZi",
+ "tags": []
+}