Task: Clean Names, Job Titles, and Company Names

n8n workflow JSON:
{"id":"89","meta":{"instanceId":"81b0d0f4ebb052991cb352e76cb8b2803ed521afd57aeef066e0ecfe83fd76cc"},"name":"Clean Names, Job Titles, and Company Names","tags":[{"id":"1","name":"Example","createdAt":"2022-12-30T09:13:52.086Z","updatedAt":"2022-12-30T09:13:52.086Z"}],"nodes":[{"id":"cbc63aa4-3f31-4258-a250-a5a2192abd79","name":"Execute Workflow Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","position":[360,320],"parameters":{},"typeVersion":1},{"id":"00b2ab0c-8e15-474e-b192-407b47bd4e8a","name":"split_in_batches","type":"n8n-nodes-base.splitInBatches","position":[560,320],"parameters":{"options":{},"batchSize":1},"typeVersion":1},{"id":"d9f460cf-bdce-4e13-b566-ce99b12ef4d0","name":"Code","type":"n8n-nodes-base.code","position":[740,320],"parameters":{"mode":"runOnceForEachItem","jsCode":"const formatCompanyName = (name) => {\n        if (name.match(/-|–/)) {\n            return name.split(/-|–/)?.[1].length > 5? name.split(/-|–/)?.[0]?.trim() : name?.trim()\n        }\n        return name\n    }\n\nconst capitalizeFirst = (word) => {\n    if(!word) return \"\"\n    if (word.match(/\\s/)) {\n       return word.split(/\\s/).map(w => w.toLowerCase().replace(/^\\w/, (c) => c.toUpperCase())).join(' ')\n    }\n    return word.toLowerCase().replace(/^\\w/, (c) => c.toUpperCase());\n}\n\n    const full_name_clean = $input.item.json.fields.full_name?.replace(/[^A-zÀ-ú|\\-|\\.|\\s]/g, '')?.replace(/\\s\\s+/g, ' ')?.trim(); \n    const first_name_clean = capitalizeFirst(full_name_clean.split(/\\s/)?.[0]?.trim());\n    const last_name_clean = capitalizeFirst(full_name_clean.split(/\\s/)?.[1]?.trim());\n    const job_title_clean = capitalizeFirst($input.item.json.fields.job_title?.replace(/[^A-zÀ-ú|\\-|\\.|\\s]/g, '')?.replace(/\\s\\s+/g, ' ')?.trim());\n    const company_name_clean = formatCompanyName($input.item.json.fields.company_name?.split('(')?.[0])?.replace(/[^A-zÀ-ú|\\-|\\.|\\s]/g, '')?.replace(/\\s\\s+/g, ' ')?.trim();\n    const current_company_clean = formatCompanyName($input.item.json.fields.current_company?.split('(')?.[0])?.replace(/[^A-zÀ-ú|\\-|\\.|\\s]/g, '')?.replace(/\\s\\s+/g, ' ')?.trim();\n    \n    return ({json:{...$input.item.json,full_name_clean, first_name_clean, last_name_clean, job_title_clean,company_name_clean, current_company_clean   }})"},"typeVersion":1},{"id":"ed85b340-f90c-428e-86ed-acd41516c564","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[920,320],"parameters":{"sheetName":{"__rl":true,"mode":"list","value":""},"documentId":{"__rl":true,"mode":"list","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"4","name":"Google Sheets account"}},"typeVersion":3}],"active":false,"pinData":{},"settings":{},"versionId":"f544fc89-124d-446d-824a-197553a85c8b","connections":{"Code":{"main":[[{"node":"Google Sheets","type":"main","index":0}]]},"Google Sheets":{"main":[[{"node":"split_in_batches","type":"main","index":0}]]},"split_in_batches":{"main":[[{"node":"Code","type":"main","index":0}]]},"Execute Workflow Trigger":{"main":[[{"node":"split_in_batches","type":"main","index":0}]]}}}