Task: LoneScale - Jobs intent data to Kaspr & Lemlist Webinar

n8n workflow JSON:
{"id":"113","meta":{"instanceId":"81b0d0f4ebb052991cb352e76cb8b2803ed521afd57aeef066e0ecfe83fd76cc"},"name":"LoneScale - Jobs intent data to Kaspr & Lemlist Webinar","tags":[{"id":"1","name":"Example","createdAt":"2022-12-30T09:13:52.086Z","updatedAt":"2022-12-30T09:13:52.086Z"}],"nodes":[{"id":"bb42868f-7f54-44d2-bcae-a819f60fcef8","name":"LoneScale - New Job Intent","type":"n8n-nodes-base.webhook","position":[-860,180],"webhookId":"34684173-843b-4e25-ba80-5f51cb584a31","parameters":{"path":"lonescalefrsdr","options":{},"httpMethod":"POST"},"typeVersion":1},{"id":"fd72572d-f4f5-4fa7-81d1-254decaf92ff","name":"Detect Tools","type":"n8n-nodes-base.code","position":[0,180],"parameters":{"jsCode":"const crm= ['Salesforce', 'HubSpot', 'Pipedrive']\nconst marketing= ['Hubspot', 'Sendinblue', 'Marketo', 'Pardot']\n\n\nreturn ({json:{crm: crm.find(j =>$node[\"LoneScale - New Hob Intent\"].json[\"body\"][\"company_tools\"].toLowerCase().match(j.toLowerCase()) ), marketing: marketing.find(j =>$node[\"LoneScale - New Hob Intent\"].json[\"body\"][\"company_tools\"].toLowerCase().match(j.toLowerCase()) )}})"},"typeVersion":1},{"id":"999c1c82-e0e4-4841-a1f9-d96d2075e3cc","name":"Split Jobs","type":"n8n-nodes-base.itemLists","position":[-180,180],"parameters":{"options":{},"fieldToSplitOut":"=body.job_offers"},"typeVersion":1},{"id":"c1123f53-9fd8-4631-88b8-0ce77c1cf267","name":"Kaspr - Email Enrichment","type":"n8n-nodes-base.httpRequest","position":[-480,180],"parameters":{"url":"https://api.developers.kaspr.io/profile/linkedin","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"id","value":"elliot-alderson"},{"name":"name","value":"Elliot Alderson"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer xxxxx"}]}},"typeVersion":3},{"id":"66aeab07-062c-4a98-a830-9134a80e371b","name":"Split","type":"n8n-nodes-base.splitInBatches","position":[120,280],"parameters":{"options":{},"batchSize":1},"typeVersion":1},{"id":"59bdccaa-0f17-4b63-b271-dd8d8f3568e2","name":"Clean Job Name","type":"n8n-nodes-base.code","position":[280,280],"parameters":{"mode":"runOnceForEachItem","jsCode":"const jobname = ['Account Manager','SDR','BDR','Growth','Marketing', 'Outbound','Business Developer','Sales Development', 'Sales Executive', 'Business Development', 'Account Executive']\n\n\nreturn ({json:{...$input.item.json, jobnamenorm: jobname.find(j =>$input.item.json.job_name.toLowerCase().match(j.toLowerCase()) )}})"},"typeVersion":1},{"id":"4218c75d-aca9-42fd-b96c-068dce39fb8f","name":"Clean Job Description","type":"n8n-nodes-base.code","position":[280,480],"parameters":{"mode":"runOnceForEachItem","jsCode":"if ($input.item.json.body.job_description){\n\n$input.item.json.content = $input.item.json.body.job_description.replaceAll('/^\\s+|\\s+$/g', '').replace('/(\\r\\n|\\n|\\r)/gm', \"\").replace(/\\s+/g, ' ')\n\n\n  $input.item.json.contentShort = $input.item.json.content.slice(0, 2000)\n}\n\n\nreturn $input.item"},"executeOnce":false,"typeVersion":1,"continueOnFail":true,"alwaysOutputData":true},{"id":"a2ce7cb2-9907-4ce0-ab23-e0125f7604de","name":"Parse ChatGPT4","type":"n8n-nodes-base.code","position":[560,480],"parameters":{"mode":"runOnceForEachItem","jsCode":"// Add a new field called 'myNewField' to the\n// JSON of the item\n$input.item.json.value_proposition=JSON.parse($input.item.json.text).value_proposition\n\n$input.item.json.departments=JSON.parse($input.item.json.text).departments\n\n$input.item.json.job_titles=JSON.parse($input.item.json.text).job_titles\n\n$input.item.json.keywords=JSON.parse($input.item.json.text).keywords\n\n$input.item.json.market=JSON.parse($input.item.json.text).market\n\n$input.item.json.target_audience=JSON.parse($input.item.json.text).target_audience\n\nreturn $input.item;"},"typeVersion":1},{"id":"bbcdfb85-e7b0-43c4-a7e4-b54d5c85eb9c","name":"OpenAI - write Icebreaker","type":"n8n-nodes-base.openAi","position":[560,280],"parameters":{"model":"gpt-4","prompt":{"messages":[{"content":"=This is a job posting description of the company {{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_name\"] }}:\"{{ $json[\"contentShort\"] }}\"\nThis is the tagline of the company {{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_name\"] }}:\"{{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_tagline\"] }}\"\nThose are the specialities of the company {{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_name\"] }}:\"{{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_specialities\"] }}\"\n\nIn a JSON format:\n\n- Give me the value proposition of the company. In less than 25 words. In English. Casual Tone. Format is: \"{{ $node[\"JobIntentLoneScale\"].json[\"body\"][\"company_name\"] }} helps [target audience] [achieve desired outcome] and [additional benefit]\"\n\n- Give me a 1 sentence summary of the problems their product or services help solve. In English. Casual Tone.\n\n- Which company department or departments would they likely sell their product or services to considering these departments only: C-Suite, Executive, Engineering & Technical, Design, Finance, Human Resources, Information Technology, Legal, Marketing, Operations, Sales, Consulting\n\n- Give me the most comprehensive list you can think of job titles across those departments, sorted by the most likely to be the decision maker, that would most likely buy this product or service, making sure to also include job titles of the people that would use or interact with the product or service in their daily tasks.\n\n- Thinking about all of the information generated and the company description, provide a comprehensive comma separated list of keywords and jargon that you might find in the job descriptions of roles listed in the titles column that relate specifically to the problems the company is trying to solve. In English. Max 25 keywords.\n\n- Guess the target audience of each company. Classify and choose 1 from this list only: sales teams, marketing teams, HR teams, customer Service teams, consumers, C-levels. Write it in lowercase\n\n- Tell me if they are B2B or B2C\n\n- Now double check your work\n\nformat should be:\n{\"value_proposition\": value_proposition,\n\"departments\": departments,\n\"job_titles\": job_titles,\n\"keywords\": keywords,\n\"target_audience\": target_audience, \n\"market\": market }\n\nJSON:"}]},"options":{"topP":1,"maxTokens":120,"temperature":0},"resource":"chat"},"credentials":{"openAiApi":{"id":"14","name":"OpenAi account"}},"typeVersion":1},{"id":"2c668ee5-a378-476b-8105-093a58805d4b","name":"Merge","type":"n8n-nodes-base.merge","position":[760,200],"parameters":{"mode":"combine","options":{},"combinationMode":"mergeByPosition"},"typeVersion":2},{"id":"d0797096-601f-4881-b69f-1d8e6ddc67b9","name":"Lemlist - Send Emails","type":"n8n-nodes-base.lemlist","position":[1060,200],"parameters":{"resource":"lead","campaignId":"cam_WLL92wjkSn9vXcDcw","additionalFields":{}},"credentials":{"lemlistApi":{"id":"24","name":"Lemlist webinar"}},"typeVersion":1},{"id":"9e3e14fe-ee7a-4e33-b22d-360146b07003","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-940,100],"parameters":{"width":265.7419354838709,"height":561.1451612903223,"content":"Get Job Intent Data"},"typeVersion":1},{"id":"f10e9093-d653-4d4a-8f79-6e8c7d53eefd","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-580,100],"parameters":{"width":265.7419354838709,"height":559.0000000000002,"content":"Enrich Contacts Emails"},"typeVersion":1},{"id":"3cfd2a09-9e76-4f13-9d41-4d711938650c","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-240,100],"parameters":{"width":1138.8225806451617,"height":559.0000000000005,"content":"Write Icebreaker with ChatGPT4 & Get Unique Points"},"typeVersion":1},{"id":"717ab5ff-1864-401c-8b51-6228629da65c","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1000,100],"parameters":{"width":261.4516129032272,"height":554.7096774193544,"content":"Send Email to Book Meetings"},"typeVersion":1}],"active":false,"pinData":{},"settings":{},"versionId":"6cb846a4-5740-49cc-8c70-4d644c0fd2cb","connections":{"Merge":{"main":[[{"node":"Lemlist - Send Emails","type":"main","index":0}]]},"Split":{"main":[[{"node":"Clean Job Name","type":"main","index":0}]]},"Split Jobs":{"main":[[{"node":"Detect Tools","type":"main","index":0}]]},"Detect Tools":{"main":[[{"node":"Split","type":"main","index":0},{"node":"Merge","type":"main","index":0}]]},"Clean Job Name":{"main":[[{"node":"Clean Job Description","type":"main","index":0}]]},"Parse ChatGPT4":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Clean Job Description":{"main":[[{"node":"OpenAI - write Icebreaker","type":"main","index":0}]]},"Kaspr - Email Enrichment":{"main":[[{"node":"Split Jobs","type":"main","index":0}]]},"OpenAI - write Icebreaker":{"main":[[{"node":"Parse ChatGPT4","type":"main","index":0}]]},"LoneScale - New Job Intent":{"main":[[{"node":"Kaspr - Email Enrichment","type":"main","index":0}]]}}}