Task: LoneScale - Tracking contacts' job changes to Hubspot

n8n workflow:
{"id":"23","meta":{"instanceId":"81b0d0f4ebb052991cb352e76cb8b2803ed521afd57aeef066e0ecfe83fd76cc"},"name":"LoneScale - Tracking contacts' job changes to HubSpot","tags":[{"id":"1","name":"Example","createdAt":"2022-12-30T09:13:52.086Z","updatedAt":"2022-12-30T09:13:52.086Z"}],"nodes":[{"id":"69511b5c-2f68-4740-98fa-8d4d2fe01458","name":"Note","type":"n8n-nodes-base.stickyNote","position":[1700,260],"parameters":{"height":220.68599524879056,"content":"Choose your process between:\n- Create a Task in Sales reps ToDoList \n- Add an item to your Intent Custom Object\n\nIf you choose Custom Object, replace all the createTask nodes with it.\nDelete the node you don't need."},"typeVersion":1},{"id":"f639c829-94fb-471a-bfb0-d8fc8f646698","name":"postNotifSlack","type":"n8n-nodes-base.slack","position":[2520,880],"parameters":{"text":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_full_name\"]}} has a job changes:\nStatut: {{$node[\"routeJobChangeType\"].parameter[\"fallbackOutput\"] === 2 ? \"position\" : $node[\"routeJobChangeType\"].parameter[\"fallbackOutput\"] === 1 ? \"company\"  : $node[\"routeJobChangeType\"].parameter[\"fallbackOutput\"] === 0 ? \"company + position\" : \"\" }}\n<br>Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>New company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}","attachments":[],"otherOptions":{},"authentication":"oAuth2"},"typeVersion":1},{"id":"a3c66788-81c5-458a-9603-5ceabc0aaf5b","name":"Note1","type":"n8n-nodes-base.stickyNote","position":[2460,740],"parameters":{"height":80,"content":"Final step can be a slack post to your sales reps notification channel"},"typeVersion":1},{"id":"db8697c0-6af7-4851-b4bd-652ceba10ee4","name":"LoneScale - GetJobChanges","type":"n8n-nodes-base.webhook","position":[-600,760],"webhookId":"53432bfa-74f5-4567-baa9-2b17056e6894","parameters":{"path":"lonescalecontacttracking","options":{},"httpMethod":"POST"},"typeVersion":1},{"id":"014b3bca-f421-4332-bb1a-8f3953307aa6","name":"Note4","type":"n8n-nodes-base.stickyNote","position":[1460,520],"parameters":{"width":176.47059323452353,"height":125.2763927405135,"content":"Check if contact:\n1. Position Changed\n2. Account changed\n3. Account & Position changed"},"typeVersion":1},{"id":"0f0fe5ae-2a58-43d6-b218-84aad7a754a7","name":"checkAccountExist","type":"n8n-nodes-base.if","position":[200,740],"parameters":{"conditions":{"string":[{"value1":"={{$node[\"searchCompany\"].json[\"item\"][\"id\"]}}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"fc933cfd-4c2a-40b0-8053-f2a571e240a6","name":"IFPersonCRMId","type":"n8n-nodes-base.if","position":[-440,760],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"idcrm\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"2ef55367-9bc8-4722-b54d-708eadd4b890","name":"Note5","type":"n8n-nodes-base.stickyNote","position":[-720,640],"parameters":{"width":183.5294162084655,"height":105.33732442570476,"content":"Change \"idcrm\" based the field name of your CRMId in your file imported on LoneScale"},"typeVersion":1},{"id":"f9cbacfb-7a80-4553-ada5-4ac52665e381","name":"searchContact","type":"n8n-nodes-base.hubspot","disabled":true,"position":[-260,920],"parameters":{"resource":"contact","operation":"search","additionalFields":{}},"typeVersion":1},{"id":"f30a49eb-1bad-48e5-9703-873d8d8bc4b8","name":"searchCompany","type":"n8n-nodes-base.hubspot","position":[-20,740],"parameters":{"options":{},"resource":"company","operation":"searchByDomain"},"typeVersion":1},{"id":"225a3c94-093c-4281-a77c-74a525817e1e","name":"createCompany","type":"n8n-nodes-base.hubspot","position":[540,820],"parameters":{"name":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}}","resource":"company","additionalFields":{"linkedInCompanyPage":"= {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}"}},"typeVersion":1},{"id":"dc008f7d-d39e-4d01-8e6a-3bcdeafeb63f","name":"updateContact","type":"n8n-nodes-base.hubspot","position":[1160,680],"parameters":{"email":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_email\"] }}","resource":"contact","resolveData":false,"additionalFields":{"jobTitle":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_linkedin_url\"] }}","property":"linkedinurl"},{"value":"={{new Date()}}","property":"datelastupdate"},{"value":"=enriched_by_lonescale_{{new Date().toLocaleDateString()}}_{{new Date().toLocaleTimeString()}}","property":"LS - job change"}]},"associatedCompanyId":"={{ $json[\"id\" }}"}},"typeVersion":1},{"id":"b59125c5-b8f4-4bb4-91b4-4e63dba62520","name":"createTask","type":"n8n-nodes-base.hubspot","position":[1920,540],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: company + position"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"searchCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1},{"id":"c9271f2e-1a49-46d1-9dc6-12de375873e6","name":"createCustomObjectHubspot","type":"n8n-nodes-base.httpRequest","position":[2020,340],"parameters":{"method":"POST","options":{}},"typeVersion":3},{"id":"281461a8-01b5-401f-9468-c5da1cff3378","name":"check_company","type":"n8n-nodes-base.if","position":[380,940],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"] }}","operation":"isNotEmpty"},{"value1":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"] }}","value2":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_company_name\"] }}","operation":"notContains"}]}},"typeVersion":1},{"id":"0595916c-5602-48d3-8397-8a0e0227dff8","name":"routeJobChangeType","type":"n8n-nodes-base.switch","position":[1500,680],"parameters":{"rules":{"rules":[{"value2":"true true"},{"output":1,"value2":"true false"},{"output":2,"value2":"false true"}]},"value1":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_company\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_job_title\"]}}","dataType":"string","fallbackOutput":3},"typeVersion":1},{"id":"b1a187e7-6082-434a-b2a2-b242ab30db78","name":"updateContact1","type":"n8n-nodes-base.hubspot","position":[1160,860],"parameters":{"email":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_email\"] }}","resource":"contact","resolveData":false,"additionalFields":{"jobTitle":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{new Date()}}","property":"datelastupdate"},{"value":"=enriched_by_lonescale_{{new Date().toLocaleDateString()}}_{{new Date().toLocaleTimeString()}}","property":"LS - job change"}]},"associatedCompanyId":"={{ $json[\"id\" }}"}},"typeVersion":1},{"id":"9ccf809f-0dcb-440d-8077-dd8a927fdbfa","name":"routeJobChangeType1","type":"n8n-nodes-base.switch","position":[1500,860],"parameters":{"rules":{"rules":[{"value2":"true true"},{"output":1,"value2":"true false"},{"output":2,"value2":"false true"}]},"value1":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_company\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_job_title\"]}}","dataType":"string","fallbackOutput":3},"typeVersion":1},{"id":"4ede1308-af47-4f84-a0c3-7b296bc8accb","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[660,540],"parameters":{"height":110.54838709677419,"content":"With this IF, you choose to not replace LinkedIn Url in your CRM even if it's outdated and  LoneScale detects a new one."},"typeVersion":1},{"id":"1ec882c4-6613-4332-94ea-2aabb8d8aa73","name":"IF_LinkedIn_url_contact","type":"n8n-nodes-base.if","position":[720,700],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_linkedin_url\"] }}","operation":"isEmpty"}]}},"typeVersion":1},{"id":"29f21fad-40eb-499d-89ff-03f162a07b5f","name":"IF_LinkedIn_url_contact1","type":"n8n-nodes-base.if","position":[720,1140],"parameters":{"conditions":{"string":[{"value1":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_linkedin_url\"] }}","operation":"isEmpty"}]}},"typeVersion":1},{"id":"29d9a867-9673-40d2-a6d1-17b30d4d70e4","name":"updateContact2","type":"n8n-nodes-base.hubspot","position":[1160,1140],"parameters":{"email":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_email\"] }}","resource":"contact","resolveData":false,"additionalFields":{"jobTitle":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_linkedin_url\"] }}","property":"linkedinurl"},{"value":"={{new Date()}}","property":"datelastupdate"},{"value":"=enriched_by_lonescale_{{new Date().toLocaleDateString()}}_{{new Date().toLocaleTimeString()}}","property":"LS - job change"}]},"associatedCompanyId":"={{ $json[\"id\" }}"}},"typeVersion":1},{"id":"4eadc0ab-67e7-4c05-a8df-913ce26a72b4","name":"routeJobChangeType2","type":"n8n-nodes-base.switch","position":[1500,1140],"parameters":{"rules":{"rules":[{"value2":"true true"},{"output":1,"value2":"true false"},{"output":2,"value2":"false true"}]},"value1":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_company\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_job_title\"]}}","dataType":"string","fallbackOutput":3},"typeVersion":1},{"id":"e7b3d049-7e8a-4bb6-ae95-7ff762d90823","name":"updateContact3","type":"n8n-nodes-base.hubspot","position":[1160,1320],"parameters":{"email":"={{ $node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"client_email\"] }}","resource":"contact","resolveData":false,"additionalFields":{"jobTitle":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{new Date()}}","property":"datelastupdate"},{"value":"=enriched_by_lonescale_{{new Date().toLocaleDateString()}}_{{new Date().toLocaleTimeString()}}","property":"LS - job change"}]},"associatedCompanyId":"={{ $json[\"id\" }}"}},"typeVersion":1},{"id":"a2a32377-8dfb-4dc5-9a0f-21da4829ac13","name":"routeJobChangeType3","type":"n8n-nodes-base.switch","position":[1500,1320],"parameters":{"rules":{"rules":[{"value2":"true true"},{"output":1,"value2":"true false"},{"output":2,"value2":"false true"}]},"value1":"={{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_company\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_change_job_title\"]}}","dataType":"string","fallbackOutput":3},"typeVersion":1},{"id":"bc75c762-aba7-413b-a2cc-60edf29d35ac","name":"createTask1","type":"n8n-nodes-base.hubspot","position":[1920,680],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: company"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"searchCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1},{"id":"f50a27d8-c996-473b-a6ac-a317bb756012","name":"createTask2","type":"n8n-nodes-base.hubspot","position":[1920,820],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: position"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"searchCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1},{"id":"1feb25bb-53e1-4bb9-a71c-928be5c1bf1c","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[2520,1120],"parameters":{},"typeVersion":1},{"id":"440c120d-2714-491d-9cfc-e4a4dc76c96b","name":"createTask3","type":"n8n-nodes-base.hubspot","position":[1940,1120],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: company + position"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"createCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1},{"id":"f218c586-2181-488f-8916-b1e37b97ea42","name":"createTask4","type":"n8n-nodes-base.hubspot","position":[1940,1260],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: company"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"searchCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1},{"id":"745d068d-8108-41de-b2f2-4367806b2be0","name":"createTask5","type":"n8n-nodes-base.hubspot","position":[1940,1400],"parameters":{"type":"task","metadata":{"body":"=Job title: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_job_title\"]}}\n<br>\nNew company: {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_name\"]}} {{$node[\"LoneScale - GetJobChanges\"].json[\"body\"][\"lonescale_company_linkedin_url\"]}}\n<br>\nStatut: position"},"resource":"engagement","additionalFields":{"associations":{"companyIds":"={{$node[\"createCompany\"].json[\"id\"]}}","contactIds":"={{ $json[\"contactId\" } }}"}}},"typeVersion":1}],"active":false,"pinData":{},"settings":{},"versionId":"1516c882-9324-4423-aa74-388e132e528b","connections":{"createTask":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"createTask1":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"createTask2":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"createTask3":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"createTask4":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"createTask5":{"main":[[{"node":"postNotifSlack","type":"main","index":0}]]},"IFPersonCRMId":{"main":[[{"node":"searchCompany","type":"main","index":0}],[{"node":"searchContact","type":"main","index":0}]]},"check_company":{"main":[[{"node":"createCompany","type":"main","index":0}],[{"node":"IF_LinkedIn_url_contact1","type":"main","index":0}]]},"createCompany":{"main":[[{"node":"IF_LinkedIn_url_contact1","type":"main","index":0}]]},"searchCompany":{"main":[[{"node":"checkAccountExist","type":"main","index":0}]]},"searchContact":{"main":[[{"node":"searchCompany","type":"main","index":0}]]},"updateContact":{"main":[[{"node":"routeJobChangeType","type":"main","index":0}]]},"updateContact1":{"main":[[{"node":"routeJobChangeType1","type":"main","index":0}]]},"updateContact2":{"main":[[{"node":"routeJobChangeType2","type":"main","index":0}]]},"updateContact3":{"main":[[{"node":"routeJobChangeType3","type":"main","index":0}]]},"checkAccountExist":{"main":[[{"node":"IF_LinkedIn_url_contact","type":"main","index":0}],[{"node":"check_company","type":"main","index":0}]]},"routeJobChangeType":{"main":[[{"node":"createTask","type":"main","index":0}],[{"node":"createTask1","type":"main","index":0}],[{"node":"createTask2","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"routeJobChangeType1":{"main":[[{"node":"createTask","type":"main","index":0}],[{"node":"createTask1","type":"main","index":0}],[{"node":"createTask2","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"routeJobChangeType2":{"main":[[{"node":"createTask3","type":"main","index":0}],[{"node":"createTask4","type":"main","index":0}],[{"node":"createTask5","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"routeJobChangeType3":{"main":[[{"node":"createTask3","type":"main","index":0}],[{"node":"createTask4","type":"main","index":0}],[{"node":"createTask5","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"IF_LinkedIn_url_contact":{"main":[[{"node":"updateContact","type":"main","index":0}],[{"node":"updateContact1","type":"main","index":0}]]},"IF_LinkedIn_url_contact1":{"main":[[{"node":"updateContact2","type":"main","index":0}],[{"node":"updateContact3","type":"main","index":0}]]},"LoneScale - GetJobChanges":{"main":[[{"node":"IFPersonCRMId","type":"main","index":0}]]}}}