Task: Reach out to companies hiring with lemlist and Lonescale

n8n workflow JSON:
{"meta":{"instanceId":"f0a68da631efd4ed052a324b63ff90f7a844426af0398a68338f44245d1dd9e5"},"nodes":[{"id":"d2b5460a-b943-4803-85cb-6c6b5126d651","name":"Lemlist - Add lead to campaign","type":"n8n-nodes-base.lemlist","position":[720,440],"parameters":{"email":"={{ $json[\"email\"][0][\"email\"] }}","resource":"lead","campaignId":"Hiring Signal Lonescale","additionalFields":{"lastName":"={{ $json[\"last_name\"] }}","firstName":"={{ $json[\"first_name\"] }}","companyName":"={{ $json[\"company\"] }}","linkedinUrl":"={{ $json[\"linkedin\"] }}"}},"credentials":{"lemlistApi":{"id":"32","name":"lemlist.net"}},"typeVersion":1},{"id":"bc457c64-890b-4c82-999e-be61fad831df","name":"HubSpot - Follow up task","type":"n8n-nodes-base.hubspot","position":[220,760],"parameters":{"type":"task","metadata":{"body":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_name\"] }} is hiring a {{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"job_offers\"][0][\"job_name\"] }}\n\nlink:{{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"job_offers\"][0][\"job_link\"] }}\ncontext: {{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"job_offers\"][0][\"workflow_all_keywords\"] }}"},"resource":"engagement","authentication":"oAuth2","additionalFields":{"associations":{"companyIds":"={{ $node[\"HubSpot Update Account\"].json[\"companyId\"] || $node[\"HubSpot Create Account\"].json[\"companyId\"] }}"}}},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1},{"id":"3c28635f-85e0-402a-ae9c-167bea409f58","name":"Attempted to contact?","type":"n8n-nodes-base.if","position":[-20,780],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"properties\"][\"hs_lead_status\"][\"value\"] }}","value2":"ATTEMPTED_TO_CONTACT"}]}},"typeVersion":1},{"id":"5aaab2a3-5e46-4045-a98d-2c2ff972fe5d","name":"Lonescale - New  Job Intent","type":"n8n-nodes-base.webhook","position":[-1520,420],"webhookId":"fe426a62-eee5-4fed-bc74-45d4ac09b338","parameters":{"path":"fe426a62-eee5-4fed-bc74-45d4ac09b338-lonescale","options":{},"httpMethod":"POST"},"typeVersion":1},{"id":"a6cc9db4-dfc2-4347-bd06-70e52ccd72e1","name":"Dropcontact","type":"n8n-nodes-base.dropcontact","position":[-860,340],"parameters":{"options":{},"additionalFields":{"company":"={{ $json[\"body\"][\"company_name\"] }}","website":"={{ $json[\"body\"][\"company_domain\"] }}","linkedin":"={{ $json[\"body.decision_makers\"][\"people_linkedin_url\"] }}","last_name":"={{ $json[\"body.decision_makers\"][\"people_last_name\"] }}","first_name":"={{ $json[\"body.decision_makers\"][\"people_first_name\"] }}"}},"credentials":{"dropcontactApi":{"id":"1","name":"Dropcontact account"}},"retryOnFail":true,"typeVersion":1,"alwaysOutputData":true,"waitBetweenTries":2000},{"id":"3081104a-4725-4ea5-89ab-558a51f688de","name":"HubSpot - Search company","type":"n8n-nodes-base.hubspot","position":[-1080,680],"parameters":{"limit":1,"domain":"={{ $json[\"body\"][\"company_domain\"] }}","options":{"properties":["hs_lead_status","numberofemployees","description","linkedin_company_page"]},"resource":"company","operation":"searchByDomain","authentication":"oAuth2"},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1,"continueOnFail":true,"alwaysOutputData":true},{"id":"15dacc3f-934d-46ba-b42a-263ff81773a4","name":"New Company?","type":"n8n-nodes-base.if","position":[-20,480],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"companyId\"] }}","operation":"isEmpty"},{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"properties\"][\"hs_lead_status\"][\"value\"] }}","value2":"NEW"},{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"properties\"][\"hs_lead_status\"][\"value\"] }}","value2":"OPEN"}]},"combineOperation":"any"},"typeVersion":1},{"id":"e731c904-6ff2-4644-9502-4729514b6610","name":"Is Customer?","type":"n8n-nodes-base.if","position":[-20,1320],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"properties\"][\"hs_lead_status\"][\"value\"] }}","value2":"CUSTOMER"}]}},"typeVersion":1},{"id":"dd2974c7-34f2-4994-b4ac-abc882e6f7e8","name":"Slack - Notify CS team on Slack1","type":"n8n-nodes-base.slack","position":[220,1300],"parameters":{"text":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_name\"] }} Sales Team is hiring a [job offer title]\n\nMight be the right team to upsell our product. 🚀","channel":"Customer Success - Customer News","attachments":[],"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"5","name":"Slack account"}},"typeVersion":1},{"id":"fb38287c-9ff1-48d0-96d8-959764b417c7","name":"HubSpot Update Account","type":"n8n-nodes-base.hubspot","position":[-600,560],"parameters":{"resource":"company","companyId":"={{ $json[\"companyId\"] }}","operation":"update","updateFields":{"description":"={{ $json[\"properties\"][\"description\"][\"value\"] || $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_description\"] }}","numberOfEmployees":"={{ $json[\"properties\"][\"numberofemployees\"][\"value\"] || $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_staff_count\"] }}","linkedInCompanyPage":"={{ $json[\"properties\"][\"linkedin_company_page\"][\"value\"] || $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_linkedin_url\"] }} "},"authentication":"oAuth2"},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1},{"id":"67ea9aa3-1910-4fac-a414-97982f3ac8a0","name":"HubSpot","type":"n8n-nodes-base.hubspot","position":[-440,120],"parameters":{"resource":"contact","operation":"search","returnAll":true,"authentication":"oAuth2","filterGroupsUi":{"filterGroupsValues":[{"filtersUi":{"filterValues":[{"value":"={{ $node[\"Dropcontact\"].json[\"email\"][0][\"email\"] }}","propertyName":"email"}]}}]},"additionalFields":{"properties":["firstname","lastname","email","jobtitle","lemlistlinkedinurl","company"]}},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1,"alwaysOutputData":true},{"id":"b31f171c-7ee7-40d0-a567-72e73e30f2c1","name":"HubSpot Create Account","type":"n8n-nodes-base.hubspot","position":[-600,800],"parameters":{"name":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_name\"] }}","resource":"company","authentication":"oAuth2","additionalFields":{"websiteUrl":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_domain\"] }}","description":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_description\"] }}","yearFounded":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_founded_year\"] }}","linkedInCompanyPage":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_linkedin_url\"] }}"}},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1},{"id":"9d863162-e424-4ae6-86e8-59a02aee1a9a","name":"Is Account in Hubspot","type":"n8n-nodes-base.if","position":[-860,680],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"companyId\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"8b4ac583-59f1-42fa-b6c3-4337bb7f0b0f","name":"HubSpot - Create/Update Contact","type":"n8n-nodes-base.hubspot","position":[-260,120],"parameters":{"email":"={{ $json[\"properties\"][\"email\"] }}","resource":"contact","authentication":"oAuth2","additionalFields":{"jobTitle":"={{ $json[\"properties\"][\"jobtitle\"] || $node[\"Return decision makers\"].json[\"body.decision_makers\"][\"people_current_position\"] }}","lastName":"={{ $json[\"properties\"][\"lastname\"] || $node[\"Return decision makers\"].json[\"body.decision_makers\"][\"people_last_name\"] }}","firstName":"={{ $json[\"properties\"][\"firstname\"] || $node[\"Return decision makers\"].json[\"body.decision_makers\"][\"people_first_name\"] }}","companyName":"={{ $json[\"properties\"][\"company\"] || $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"people_company_name\"] }} ","customPropertiesUi":{"customPropertiesValues":[{"value":"={{ $json[\"properties\"][\"lemlistlinkedinurl\"] || $node[\"Return decision makers\"].json[\"body.decision_makers\"][\"people_linkedin_url\"] }}","property":"linkedin_url"}]}}},"credentials":{"hubspotOAuth2Api":{"id":"68","name":"HubSpot - Sales & CS"}},"typeVersion":1,"continueOnFail":true,"alwaysOutputData":true},{"id":"4c5a2ebe-1032-4a73-8983-b9470ded9228","name":"Slack - Notify sales team on Slack","type":"n8n-nodes-base.slack","position":[220,1040],"parameters":{"text":"={{ $node[\"Lonescale - New  Job Intent\"].json[\"body\"][\"company_name\"] }} Sales Team is hiring a [job offer title]\n\nHubspot Record URL:  https://app-eu1.hubspot.com/contacts/{{ $node[\"HubSpot - Search company\"].json[\"portalId\"] }}/company/{{ $node[\"HubSpot - Search company\"].json[\"companyId\"] }} ","channel":"Customer Success - Customer News","attachments":[],"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"5","name":"Slack account"}},"typeVersion":1},{"id":"a3956aa9-5c76-481c-9005-01f7feef6281","name":"Open Deal?","type":"n8n-nodes-base.if","position":[-20,1060],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"HubSpot - Search company\"].json[\"properties\"][\"hs_lead_status\"][\"value\"] }}","value2":"OPEN_DEAL"}]}},"typeVersion":1},{"id":"a5a84d04-19d0-4adb-b811-0b796289e38c","name":"email found","type":"n8n-nodes-base.if","position":[480,460],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"email\"][0][\"email\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"2c8fd6cf-3ed1-44ed-b625-abb1cbf98c9d","name":"Return decision makers","type":"n8n-nodes-base.itemLists","position":[-1060,340],"parameters":{"include":"allOtherFields","options":{},"fieldToSplitOut":"body.decision_makers"},"typeVersion":1},{"id":"31fbb6de-2d03-4e37-9e73-897cee58169a","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1124.6996197718645,259.29429657794606],"parameters":{"width":374.3269961977189,"height":238.9171102661595,"content":"## Find decision makers emails"},"typeVersion":1},{"id":"0de230e6-2c67-4c5d-882f-87e9e07677b8","name":"Set","type":"n8n-nodes-base.set","position":[-360,680],"parameters":{"values":{"string":[{"name":"HS_updated","value":"true"}]},"options":{}},"typeVersion":1},{"id":"df7fcf7c-ccd9-464a-a3ff-622cd0e427f8","name":"email found1","type":"n8n-nodes-base.if","position":[-660,140],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"email\"][0][\"email\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"f02a9d2c-ccc7-4a8f-b54a-a932e0038849","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-720,40],"parameters":{"width":588.4106463878331,"height":268.30114068441054,"content":"## Update Hubspot with contact info"},"typeVersion":1},{"id":"cfbbf365-0595-40d9-8010-0c5dae90a28a","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[-80,120],"parameters":{},"typeVersion":1},{"id":"854fb3b6-6d04-4fae-a167-e37daa13c441","name":"Return Dropcontact data","type":"n8n-nodes-base.code","position":[240,460],"parameters":{"jsCode":"// Loop over input items and add a new field\n// called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  item.json.myNewField = 1;\n}\n\nreturn $('Dropcontact').all();"},"typeVersion":1},{"id":"4de3de84-fab8-4a4b-ba76-e51e691f3966","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-1140,520],"parameters":{"width":907.741444866921,"height":499.3733840304178,"content":"## Check Hubspot and update company records with Lonescale data"},"typeVersion":1},{"id":"cfc6e87c-5eb1-46b0-b29d-5a71e6598488","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-60,400],"parameters":{"width":955.6653992395447,"height":222.24790874524672,"content":"## Add new leads to lemlist campaign"},"typeVersion":1},{"id":"32da049e-88a6-453e-9cea-37eec0bdc60a","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","disabled":true,"position":[-60,680],"parameters":{"width":955.6653992395447,"height":255.58631178707185,"content":"## Create follow up tasks if connected"},"typeVersion":1},{"id":"30580825-0958-4f0d-a137-321c8a2cb8b9","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","disabled":true,"position":[-60,960],"parameters":{"width":955.6653992395447,"height":255.58631178707185,"content":"## Notify sales team"},"typeVersion":1},{"id":"63b6efe5-4148-42f9-8e23-51ac43faa054","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","disabled":true,"position":[-60,1240],"parameters":{"width":955.6653992395447,"height":255.58631178707185,"content":"## Notify CS team"},"typeVersion":1}],"connections":{"Set":{"main":[[{"node":"New Company?","type":"main","index":0},{"node":"Attempted to contact?","type":"main","index":0},{"node":"Open Deal?","type":"main","index":0},{"node":"Is Customer?","type":"main","index":0}]]},"HubSpot":{"main":[[{"node":"HubSpot - Create/Update Contact","type":"main","index":0}]]},"Open Deal?":{"main":[[{"node":"Slack - Notify sales team on Slack","type":"main","index":0}]]},"Dropcontact":{"main":[[{"node":"email found1","type":"main","index":0}]]},"email found":{"main":[[{"node":"Lemlist - Add lead to campaign","type":"main","index":0}]]},"Is Customer?":{"main":[[{"node":"Slack - Notify CS team on Slack1","type":"main","index":0}]]},"New Company?":{"main":[[{"node":"Return Dropcontact data","type":"main","index":0}]]},"email found1":{"main":[[{"node":"HubSpot","type":"main","index":0}]]},"Attempted to contact?":{"main":[[{"node":"HubSpot - Follow up task","type":"main","index":0}]]},"Is Account in Hubspot":{"main":[[{"node":"HubSpot Update Account","type":"main","index":0}],[{"node":"HubSpot Create Account","type":"main","index":0}]]},"HubSpot Create Account":{"main":[[{"node":"Set","type":"main","index":0}]]},"HubSpot Update Account":{"main":[[{"node":"Set","type":"main","index":0}]]},"Return decision makers":{"main":[[{"node":"Dropcontact","type":"main","index":0}]]},"Return Dropcontact data":{"main":[[{"node":"email found","type":"main","index":0}]]},"HubSpot - Search company":{"main":[[{"node":"Is Account in Hubspot","type":"main","index":0}]]},"Lonescale - New  Job Intent":{"main":[[{"node":"Return decision makers","type":"main","index":0},{"node":"HubSpot - Search company","type":"main","index":0}]]},"HubSpot - Create/Update Contact":{"main":[[{"node":"No Operation, do nothing","type":"main","index":0}]]}}}