Task: Linkedin scraping to Hubspot CRM with Dropcontact + Hunter waterfall enrichment

n8n workflow JSON:
{"id":"36","meta":{"instanceId":"64f2868fee12499266ce34a646d88854e4ff90fe0171de9a519ffe6a65a20229"},"name":"#1162 Growth & Data Automation__Projects__Automatiser les étapes de scraping Linkedin_v9_bouncer","tags":[],"nodes":[{"id":"47e9e229-65dd-4610-85ca-e93a328c384f","name":"Phantombuster1","type":"n8n-nodes-base.phantombuster","position":[800,420],"parameters":{"agentId":"407779365504112","operation":"getOutput","additionalFields":{}},"credentials":{"phantombusterApi":{"id":"13","name":"Phantombuster account"}},"typeVersion":1},{"id":"80fbfcd1-232a-47f3-959f-4469464ed0a7","name":"Dropcontact","type":"n8n-nodes-base.dropcontact","position":[1280,400],"parameters":{"options":{},"additionalFields":{"company":"={{ $json[\"additionalInfo\"].split(\"chez \")[1].split(\" \")[0]}}","linkedin":"={{ $json[\"profileUrl\"] }}","full_name":"={{ $json[\"fullName\"] }}","last_name":"={{ $json[\"lastName\"] }}","first_name":"={{ $json[\"firstName\"] }}"}},"credentials":{"dropcontactApi":{"id":"15","name":"Dropcontact account"}},"typeVersion":1},{"id":"d82e8369-a19f-430a-8d29-d901222cc62d","name":"HubSpot","type":"n8n-nodes-base.hubspot","position":[5060,360],"parameters":{"email":"={{ $json[\"Email\"] }}","resource":"contact","authentication":"appToken","additionalFields":{"lastName":"={{ $json[\"Last_name\"] }}","firstName":"={{ $json[\"First_Name\"] }}","websiteUrl":"={{ $json[\"URL_du_site_web\"] }}","companyName":"={{ $json[\"Nom_de_l_entreprise\"] }}","phoneNumber":"={{ $json[\"Numero_de_telephone\"] }}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{ $json[\"LinkedIn_URL\"] }}","property":"lemlistlinkedinurl"}]}}},"credentials":{"hubspotAppToken":{"id":"9","name":"Hubspot_n8n_Private-App_API"}},"typeVersion":1},{"id":"8eed9d7c-7f22-4caf-a00d-3631e23f3404","name":"Note3","type":"n8n-nodes-base.stickyNote","position":[100,148.83720930232585],"parameters":{"width":260.33860465116294,"height":884.7392114335846,"content":"## Bloc 1 : Webhook Phantombuster \n\nDéclenchement (\"Launch\") manuel dans PhantomBuster qui appelle un webhook personnalisé à la fin de l'éxecution.\nCe webhook contient un payload qui contient le résultat de l'éxecution et constitue le trigger du workflow."},"typeVersion":1},{"id":"8493cb51-bbab-464c-91ed-7bc861e914e8","name":"IF","type":"n8n-nodes-base.if","position":[540,440],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"body\"][\"exitMessage\"] }}","value2":"finished"}]}},"typeVersion":1},{"id":"f8ace71c-11eb-4ac9-a580-50e1802368bb","name":"Hunter","type":"n8n-nodes-base.hunter","position":[2660,600],"parameters":{"domain":"={{ $json[\"URL_du_site_web\"] }}","lastname":"={{ $json[\"Last_Name\"] }}","firstname":"={{ $json[\"First_Name\"] }}","operation":"emailFinder"},"credentials":{"hunterApi":{"id":"16","name":"Hunter account"}},"typeVersion":1},{"id":"edb1d969-e946-4668-aed0-9a87f380a7fd","name":"Merge1","type":"n8n-nodes-base.merge","position":[3000,400],"parameters":{},"typeVersion":2,"alwaysOutputData":true},{"id":"24b6d0d8-772e-4792-ae94-2628efc86b91","name":"IF3","type":"n8n-nodes-base.if","position":[1040,420],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"error\"] }}","value2":"No result found","operation":"notEqual"}]}},"typeVersion":1},{"id":"7aff48f8-546c-417f-aa8c-e5d581d076e0","name":"Slack","type":"n8n-nodes-base.slack","position":[780,700],"parameters":{"text":"Phantom Error (not finished)","channel":"n8n","attachments":[],"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"18","name":"Slack account"}},"typeVersion":1},{"id":"34d8d4f5-716b-4005-b018-56f44e6debdf","name":"Slack1","type":"n8n-nodes-base.slack","position":[1240,600],"parameters":{"text":"Phantom Error (not results found)","channel":"n8n","attachments":[],"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"18","name":"Slack account"}},"typeVersion":1},{"id":"d8d5aaea-1d65-45ab-b19e-195d1443e82b","name":"Webhook1","type":"n8n-nodes-base.webhook","position":[160,440],"webhookId":"76b2d388-e897-4bcb-a838-68fe758297d1","parameters":{"path":"6b9606d1-7c4d-4ad3-b8d0-0edb68fd9a95","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":1},{"id":"27d22afa-0e3a-45f4-8404-bd350a1f77c7","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[3660,620],"parameters":{},"typeVersion":1},{"id":"d2e074a6-20fc-4b6c-88b3-4a234d8ee037","name":"Remove empty and personal emails","type":"n8n-nodes-base.if","position":[3240,400],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"Email\"] }}","operation":"isNotEmpty"},{"value1":"={{ $json[\"Email\"] }}","value2":"@gmail","operation":"notContains"},{"value1":"={{ $json[\"Email\"] }}","value2":"@hotmail","operation":"notContains"}]}},"typeVersion":1},{"id":"c71f3ea8-eda6-4a2b-a159-c38914a6593e","name":"Remove duplicates email from merge node","type":"n8n-nodes-base.itemLists","position":[3640,380],"parameters":{"compare":"selectedFields","options":{},"operation":"removeDuplicates","fieldsToCompare":{"fields":[{"fieldName":"Email"}]}},"typeVersion":1,"alwaysOutputData":true},{"id":"b58e1323-3444-4065-8375-70900e0b3c7b","name":"Timestamp format for Hubspot","type":"n8n-nodes-base.dateTime","position":[4840,360],"parameters":{"value":"={{ $node[\"Set clean input for Hubspot\"].json[\"timestamp\"] }}","options":{},"toFormat":"x","dataPropertyName":"timestamp"},"typeVersion":1},{"id":"e35354dd-6e86-4373-abfd-8485e2c8031d","name":"Verify mails in Bouncer","type":"n8n-nodes-base.httpRequest","position":[4180,500],"parameters":{"url":"https://api.usebouncer.com/v1/email/verify","method":"=GET","options":{},"sendQuery":true,"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","queryParameters":{"parameters":[{"name":"email","value":"={{ $json[\"Email\"] }}"}]}},"credentials":{"httpHeaderAuth":{"id":"22","name":"Bouncer_OPUS-Développement"}},"typeVersion":3},{"id":"4a34905a-a76e-40bd-a820-0559cd866797","name":"No Operation, do nothing1","type":"n8n-nodes-base.noOp","position":[2460,860],"parameters":{},"typeVersion":1},{"id":"d20f081c-e0c0-4f52-829b-03b6b5c7ce02","name":"Clean undeliverable emails","type":"n8n-nodes-base.if","position":[4420,500],"parameters":{"conditions":{"string":[{"value1":"={{$json[\"status\"]}}","value2":"undeliverable","operation":"notEqual"}]}},"typeVersion":1},{"id":"7d5508b1-faf0-430a-9e58-a1c062989753","name":"No Operation, do nothing2","type":"n8n-nodes-base.noOp","position":[4600,680],"parameters":{},"typeVersion":1},{"id":"dc8fe4fc-bb96-40e5-9cbf-56fd2b1eac75","name":"Simu drop","type":"n8n-nodes-base.code","position":[240,1420],"parameters":{"jsCode":"var item = [\n  {\n    \"civility\": \"Mrs\",\n    \"company\": \"Gecina\",\n    \"company_linkedin\": \"www.linkedin.com/company/gecina\",\n    \"email\": [\n      {\n        \"email\": \"maryllhenderycksen@gecina.fr\",\n        \"qualification\": \"catch-all@pro\"\n      }\n    ],\n    \"first_name\": \"Maryll\",\n    \"full_name\": \"Maryll Henderycksen\",\n    \"job\": \"Responsable Marketing\",\n    \"last_name\": \"Henderycksen\",\n    \"linkedin\": \"www.linkedin.com/in/maryll-henderycksen-05097b46\",\n    \"phone\": \"+33 1 40 40 50 50\",\n    \"website\": \"www.gecina.fr\"\n  },\n  {\n    \"civility\": \"Mrs\",\n    \"company\": \"Alila\",\n    \"company_linkedin\": \"www.linkedin.com/company/alila-promoteur\",\n    \"email\": [\n      {\n        \"email\": \"a.lusetti@alila.fr\",\n        \"qualification\": \"catch-all@pro\"\n      }\n    ],\n    \"first_name\": \"Ariane\",\n    \"full_name\": \"Ariane Lusetti\",\n    \"last_name\": \"Lusetti\",\n    \"linkedin\": \"www.linkedin.com/in/ariane-lusetti\",\n    \"phone\": \"+33 4 72 18 95 95\",\n    \"website\": \"www.alila.fr\"\n  },\n  {\n    \"civility\": \"Mrs\",\n    \"company\": \"Dattak\",\n    \"company_linkedin\": \"www.linkedin.com/company/cyberlinefr\",\n    \"email\": [\n      {\n        \"email\": \"paula.jacquemain@dattak.fr\",\n        \"qualification\": \"nominative@pro\"\n      }\n    ],\n    \"first_name\": \"Paula\",\n    \"full_name\": \"Paula Jacquemain\",\n    \"job\": \"Responsable Marketing\",\n    \"last_name\": \"Jacquemain\",\n    \"linkedin\": \"www.linkedin.com/in/paula-jacquemain-31268350\",\n    \"phone\": \"+33 6 20 76 20 67\"\n  }\n];\n\nreturn item;"},"typeVersion":1},{"id":"da43e7bd-552f-460f-9b94-b1095b8898c8","name":"Verify if last_name contains at least 2 letters","type":"n8n-nodes-base.code","position":[2480,600],"parameters":{"jsCode":"var item = $node[\"If first_name, last_name, website\"];\n\n// console.log(item);\n// console.log($node[\"If first_name, last_name, website\"].json.Last_Name);\n\n\nvar item_last_name = $node[\"If first_name, last_name, website\"].json.Last_Name ;\n\nfunction contientDeuxLettres(chaine) {\n  // initialisation du compteur de lettres\n  let compteur = 0;\n  \n  // boucle sur chaque caractère de la chaîne\n  for (let i = 0; i < chaine.length; i++) {\n    // vérifie si le caractère est une lettre\n    if (/[a-zA-Z]/.test(chaine[i])) {\n      compteur++; // incrémente le compteur de lettres\n    }\n    \n    // si on a trouvé 2 lettres, on peut sortir de la boucle\n    if (compteur >= 2) {\n      break;\n    }\n  }\n  \n  // renvoie true si on a trouvé au moins 2 lettres, false sinon\n  return compteur >= 2;\n}\n\n// contientDeuxLettres(item_last_name);\n\nconsole.log(contientDeuxLettres(item_last_name));\n\nif (contientDeuxLettres(item_last_name))\n{\n  return item;\n}"},"typeVersion":1},{"id":"877db82e-620a-4617-9a8b-81234ee10f38","name":"If first_name, last_name, website","type":"n8n-nodes-base.if","position":[2280,620],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"First_Name\"] }}","operation":"isNotEmpty"},{"value1":"={{ $json[\"Last_Name\"] }}","operation":"isNotEmpty"},{"value1":"={{ $json[\"URL_du_site_web\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1,"alwaysOutputData":false},{"id":"4f8d9a5e-a4bb-4e99-a21a-f696b99fa7bf","name":"Set clean input for Hubspot","type":"n8n-nodes-base.set","position":[3940,380],"parameters":{"values":{"number":[{"name":"timestamp","value":"={{ Math.floor(new Date().getTime()/1000) }}"}],"string":[{"name":"First_Name","value":"={{ $node[\"Remove empty and personal emails\"].json[\"First_Name\"].charAt(0).toUpperCase() + $node[\"Remove empty and personal emails\"].json[\"First_Name\"].slice(1).toLowerCase() }}"},{"name":"Last_name","value":"={{ $node[\"Remove empty and personal emails\"].json[\"Last_Name\"].charAt(0).toUpperCase() + $node[\"Remove empty and personal emails\"].json[\"Last_Name\"].slice(1).toLowerCase() }}"},{"name":"Email","value":"={{ $node[\"Remove empty and personal emails\"].json[\"Email\"] }}"},{"name":"URL_du_site_web","value":"={{ $node[\"Dropcontact\"].json[\"website\"] }}"},{"name":"LinkedIn_URL","value":"={{ $node[\"Dropcontact\"].json[\"linkedin\"] }}"},{"name":"Nom_de_l_entreprise","value":"={{ $node[\"Remove empty and personal emails\"].json[\"Nom_de_l_entreprise\"] }}"},{"name":"Numero_de_telephone","value":"={{ $json[\"Numero_de_telephone\"] }}"}]},"options":{},"keepOnlySet":true},"typeVersion":1},{"id":"089d1e66-ad3a-4a1d-a020-c1a83410ed8d","name":"Set clean output from Hunter","type":"n8n-nodes-base.set","position":[2820,600],"parameters":{"values":{"string":[{"name":"First_Name","value":"={{ $node[\"Verify if last_name contains at least 2 letters\"].json[\"First_Name\"] }}"},{"name":"Last_Name","value":"={{ $node[\"Verify if last_name contains at least 2 letters\"].json[\"Last_Name\"] }}"},{"name":"Email","value":"={{ $json[\"email\"] }}"},{"name":"URL du site web","value":"={{ $node[\"If first_name, last_name, website\"].json[\"URL_du_site_web\"] }}"},{"name":"LinkedIn_URL","value":"={{ $node[\"Verify if last_name contains at least 2 letters\"].json[\"LinkedIn_URL\"] }}"},{"name":"Nom_de_l_entreprise","value":"={{ $node[\"Verify if last_name contains at least 2 letters\"].json[\"Nom_de_l_entreprise\"] }}"}]},"options":{},"keepOnlySet":true},"typeVersion":1},{"id":"444964cd-fb51-47db-939d-6241e7be5ddf","name":"If email ok continue if not go to Hunter","type":"n8n-nodes-base.if","position":[1880,400],"parameters":{"conditions":{"string":[{"value1":"={{ $json[\"Email\"] }}","operation":"isNotEmpty"}]}},"typeVersion":1,"alwaysOutputData":false},{"id":"ba012416-69ab-4f77-9db1-8baf4b208925","name":"If website key does not exist, create it","type":"n8n-nodes-base.code","position":[2080,620],"parameters":{"jsCode":"var items = $input.all()\n\nfor (let i = 0; i < items.length; i++) {\n  let item = items[i];\n    \n  if (!(item.json.hasOwnProperty('URL_du_site_web'))) {\n    item.json.URL_du_site_web = \"\";\n  }\n     \n  console.log(item);\n  \n  console.log(item.json.hasOwnProperty('URL_du_site_web'));\n  \n}\n\n// console.log(items[0].json.URL_du_site_web);\n\nreturn items;"},"typeVersion":1},{"id":"3358eaa7-a6de-48f3-8442-e854b0e7c65f","name":"Set clean output from Dropcontact","type":"n8n-nodes-base.set","position":[1540,400],"parameters":{"values":{"string":[{"name":"First_Name","value":"={{ $json[\"first_name\"] }}"},{"name":"Last_Name","value":"={{ $json[\"last_name\"] }}"},{"name":"Email","value":"={{ $json[\"email\"][\"0\"][\"email\"] }}"},{"name":"URL_du_site_web","value":"={{ $json[\"website\"] }}"},{"name":"LinkedIn_URL","value":"={{ $json[\"linkedin\"] }}"},{"name":"Nom_de_l_entreprise","value":"={{ $json[\"company\"] }}"},{"name":"Numero_de_telephone","value":"={{ $json[\"phone\"] }}"}]},"options":{},"keepOnlySet":true},"typeVersion":1,"alwaysOutputData":true},{"id":"c15477e8-048a-4cc4-8756-28594fb12aea","name":"Set clean input for Hubspot1","type":"n8n-nodes-base.set","position":[4620,360],"parameters":{"values":{"number":[{"name":"timestamp","value":"={{ Math.floor(new Date().getTime()/1000) }}"}],"string":[{"name":"First_Name","value":"={{ $node[\"Remove empty and personal emails\"].json[\"First_Name\"].charAt(0).toUpperCase() + $node[\"Remove empty and personal emails\"].json[\"First_Name\"].slice(1).toLowerCase() }}"},{"name":"Last_name","value":"={{ $node[\"Remove empty and personal emails\"].json[\"Last_Name\"].charAt(0).toUpperCase() + $node[\"Remove empty and personal emails\"].json[\"Last_Name\"].slice(1).toLowerCase() }}"},{"name":"Email","value":"={{ $json[\"email\"] }}"},{"name":"URL_du_site_web","value":"={{ $node[\"Dropcontact\"].json[\"website\"] }}"},{"name":"LinkedIn_URL","value":"={{ $node[\"Dropcontact\"].json[\"linkedin\"] }}"},{"name":"Nom_de_l_entreprise","value":"={{ $node[\"Remove empty and personal emails\"].json[\"Nom_de_l_entreprise\"] }}"},{"name":"Numero_de_telephone","value":"={{ $node[\"Dropcontact\"].json[\"phone\"] }}"}]},"options":{},"keepOnlySet":true},"typeVersion":1},{"id":"a49bf544-0108-4aef-89a3-2d7c970aac1d","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1780,140],"parameters":{"width":1394.4692093023261,"height":899.7298604651166,"content":"## Bloc 3 : Séquence d'enrichissement en cascade avec Hunter si pas d'email avec DropContact\n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)"},"typeVersion":1},{"id":"62982462-b938-46da-8621-a8a292da6267","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[480,140],"parameters":{"width":1232.4226976744171,"height":893.4886995348841,"content":"## Bloc 2 : Séquence d'enrichissement avec DropContact à partir de l'output Phantombuster\n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)"},"typeVersion":1},{"id":"6cba4772-eccf-4bbf-ba1c-f8bd62895d71","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3205.953100775285,140],"parameters":{"width":897.4347131782026,"height":899.7298604651166,"content":"## Bloc 4 : Déduplication des contacts et reformatage des données pour Hubspot\n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)"},"typeVersion":1},{"id":"36cf3fd5-62fa-4fab-9e27-0493b01b4ccb","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[4133.2440014767335,140],"parameters":{"width":633.9693938721038,"height":899.7298604651166,"content":"## Bloc 5 : Validation des emails avec Bouncer\n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)"},"typeVersion":1},{"id":"374da2f4-f2cd-49cd-acf1-0cc86d1c0423","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[4820,140],"parameters":{"width":497.7145336938873,"height":899.7298604651166,"content":"## Bloc 6 : Import des données dans Hubspot\n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"callerPolicy":"workflowsFromSameOwner","saveManualExecutions":false,"saveExecutionProgress":"DEFAULT","saveDataErrorExecution":"all","saveDataSuccessExecution":"all"},"versionId":"24b9ca51-1c1d-4475-a546-4cc7014e5505","connections":{"IF":{"main":[[{"node":"Phantombuster1","type":"main","index":0}],[{"node":"Slack","type":"main","index":0}]]},"IF3":{"main":[[{"node":"Dropcontact","type":"main","index":0}],[{"node":"Slack1","type":"main","index":0}]]},"Hunter":{"main":[[{"node":"Set clean output from Hunter","type":"main","index":0}]]},"Merge1":{"main":[[{"node":"Remove empty and personal emails","type":"main","index":0}]]},"Webhook1":{"main":[[{"node":"IF","type":"main","index":0}]]},"Dropcontact":{"main":[[{"node":"Set clean output from Dropcontact","type":"main","index":0}]]},"Phantombuster1":{"main":[[{"node":"IF3","type":"main","index":0}]]},"Verify mails in Bouncer":{"main":[[{"node":"Clean undeliverable emails","type":"main","index":0}]]},"Clean undeliverable emails":{"main":[[{"node":"Set clean input for Hubspot1","type":"main","index":0}],[{"node":"No Operation, do nothing2","type":"main","index":0}]]},"Set clean input for Hubspot":{"main":[[{"node":"Verify mails in Bouncer","type":"main","index":0}]]},"Set clean input for Hubspot1":{"main":[[{"node":"Timestamp format for Hubspot","type":"main","index":0}]]},"Set clean output from Hunter":{"main":[[{"node":"Merge1","type":"main","index":1},{"node":"Merge1","type":"main","index":0}]]},"Timestamp format for Hubspot":{"main":[[{"node":"HubSpot","type":"main","index":0}]]},"Remove empty and personal emails":{"main":[[{"node":"Remove duplicates email from merge node","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"If first_name, last_name, website":{"main":[[{"node":"Verify if last_name contains at least 2 letters","type":"main","index":0}],[{"node":"No Operation, do nothing1","type":"main","index":0}]]},"Set clean output from Dropcontact":{"main":[[{"node":"If email ok continue if not go to Hunter","type":"main","index":0}]]},"Remove duplicates email from merge node":{"main":[[{"node":"Set clean input for Hubspot","type":"main","index":0}]]},"If email ok continue if not go to Hunter":{"main":[[{"node":"Merge1","type":"main","index":0},{"node":"Merge1","type":"main","index":1}],[{"node":"If website key does not exist, create it","type":"main","index":0}]]},"If website key does not exist, create it":{"main":[[{"node":"If first_name, last_name, website","type":"main","index":0}]]},"Verify if last_name contains at least 2 letters":{"main":[[{"node":"Hunter","type":"main","index":0}]]}}}