This workflow corresponds to n8n.io template #5647 — we link there as the canonical source.
This workflow follows the Chainllm → Form Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "fce88a0b-ba03-4657-8d7c-62a96bb12d50",
"name": "Get Leads",
"type": "n8n-nodes-base.googleSheets",
"position": [
260,
-35
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "id",
"value": "0"
},
"documentId": {
"__rl": true,
"mode": "url",
"value": "={{ $('On Form Submit').item.json['Lead Spreadsheet Url'] }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "73e028cc-a9e0-4bf1-ac13-5fb9a5e937da",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
480,
60
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "1b43f3d4-d9d6-4929-8fad-dc9f884feff9",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
660,
60
],
"parameters": {
"jsonSchemaExample": "{\n\t\"cleanCompanyName\": \"Techwave\"\n}"
},
"typeVersion": 1.3
},
{
"id": "15fe57a0-4cd5-4907-b9cf-103d5be6cdc7",
"name": "Clean Company Name",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
480,
-160
],
"parameters": {
"text": "=Company Name: {{ $json.Company }}",
"batching": {
"batchSize": 5
},
"messages": {
"messageValues": [
{
"message": "**Situation** \nYou are processing a lead list for a cold email campaign where company names will be used as personalization variables. The raw company names in the dataset contain various formatting inconsistencies, unnecessary suffixes, taglines, and casing issues that make them unsuitable for professional, natural, personalized outreach. \n\n**Task** \nClean and standardize company names from a lead list to create professional, polished variables suitable for cold email personalization. For each company name provided, you must: \n1. Remove common business suffixes (LLC, Inc., Corp., Corporation, Ltd., Limited, Co., Company, etc.) \n2. Remove common words that are in the formal company name but that a human likely wouldn't include when identifying the company in an email (Systems, Solutions, Communications, Agency, Group, Partners, etc.)\n3. Remove taglines, slogans, or descriptive phrases (typically found after dashes, pipes, or \"the\" statements) \n4. Apply proper title case formatting \n5. Shorten names to their most recognizable form when possible while maintaining professionalism \n6. Ensure the result maintains the company's professional identity and recognizability \n\n**Objective** \nTransform formal, cluttered company names into clean, professional versions that will make cold emails feel more natural, personal and polished, ultimately improving engagement rates and response likelihood in the outreach campaign.\n\n**Knowledge** \n- Business suffixes to remove include: LLC, Inc., Corp., Corporation, Ltd., Limited, Co., Company, LP, LLP, PC, PLLC, and their variations with different punctuation \n- Taglines often appear after symbols like: dash (-), pipe (|), colon (:), or phrases starting with \"the,\" \"your,\" \"we,\" etc. \n- Proper title case means capitalizing the first letter of each major word, but keeping articles, prepositions, and conjunctions lowercase unless they start the name. Acronyms should remain in all caps.\n- Maintain professional tone \n- Keep established business names recognizable (e.g., \"Microsoft Corporation\" becomes \"Microsoft\") \n- Avoid over-shortening if it makes the company unrecognizable or unprofessional \n- Service descriptions and taglines should be completely removed (e.g., \"ExtraSlice, LLC - Workspace as a Service\" becomes \"ExtraSlice\") \n\n<examples> \nInput: \"ExtraSlice, LLC - Workspace as a Service\" \nOutput: \"ExtraSlice\" \n\nInput: \"ACRE Solutions\" \nOutput: \"ACRE\" \n\nInput: \"MRP Capital Group\" \nOutput: \"MRP\" \n\nInput: \"Paul & Associates Real Estate Services\" \nOutput: \"Paul & Associates\" \n\nInput: \"Global Valuation & Consulting, LLC.\" \nOutput: \"Global Valuation & Consulting\" \n\nInput: \"Agent Career Education | Ace\" \nOutput: \"Agent Career Education\" \n\nInput: \"PROPERTY AGENTS\" \nOutput: \"Property Agents\" \n\nInput: \"Agently - Agent Success Platform for Brokerages\" \nOutput: \"Agently\" \n\nInput: \"Monserrate Premium Home Agents\" \nOutput: \"Monserrate\" \n\nInput: \"Belmont Howard Group, LLC.\"\nOutput: \"Belmont Howard\" \n\nInput: \"BruZiv Partners, LLC\" \nOutput: \"BruZiv\" \n\nInput: \"Van Vlissingen and Co.\" \nOutput: \"Van Vlissingen\" \n</examples>\n\nIt's critical that the company's professional recognizability while removing all unnecessary suffixes and taglines - the cleaned name must sound natural and professional when used in a business email context."
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "5d61e2e3-f881-4919-87ae-5af5a62e12a1",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
856,
-35
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3.2
},
{
"id": "11b87495-d6a1-4e72-a019-efbb44a7c8dc",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
1076,
-35
],
"parameters": {
"include": "except",
"options": {},
"assignments": {
"assignments": [
{
"id": "4195d1e4-0d85-43e9-be6e-085944f197df",
"name": "Clean Company Name",
"type": "string",
"value": "={{ $json.output.cleanCompanyName }}"
}
]
},
"excludeFields": "output,row_number",
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "1883c284-9adf-43e5-8461-d419f112379a",
"name": "Save Output",
"type": "n8n-nodes-base.googleSheets",
"position": [
1300,
-40
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "First Name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "First Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Last Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Company",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Company",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LinkedIn Url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "LinkedIn Url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Clean Company Name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Clean Company Name",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true
},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "id",
"value": "={{ $('Create Destination Sheet').item.json.sheetId }}"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Create Destination Sheet').item.json.spreadsheetId }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "602d2068-9694-4722-ac83-909a37bc0c4c",
"name": "Create Destination Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
40,
-35
],
"parameters": {
"title": "Cleaned Companies",
"options": {
"tabColor": "0aa55c"
},
"operation": "create",
"documentId": {
"__rl": true,
"mode": "url",
"value": "={{ $('On Form Submit').item.json['Lead Spreadsheet Url'] }}"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "dd66b31e-aaa1-4e23-95e7-da2e62e9dc99",
"name": "On Form Submit",
"type": "n8n-nodes-base.formTrigger",
"position": [
-180,
-35
],
"parameters": {
"options": {},
"formTitle": "Clean Up Company Names",
"formFields": {
"values": [
{
"fieldLabel": "Lead Spreadsheet Url",
"requiredField": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ecb26e43-a1fb-4d08-b871-444c7f0d4b75",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
820,
-340
],
"parameters": {
"color": 7,
"width": 660,
"height": 560,
"content": "## Prep and save output\nHere we merge in the LLM's output with the original lead data and save everything back to the new sheet we created earlier in the workflow."
},
"typeVersion": 1
},
{
"id": "ae44d84f-f177-4b01-ab27-29dda23f53d8",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-340
],
"parameters": {
"color": 7,
"width": 620,
"height": 560,
"content": "## Fetch the lead data\nWhen a form is submitted with the url to a Google Sheet with the lead data, we create a new sheet in the document that we will use to store the results and fetch all the lead data from the first sheet.\n\nNote that the account associated with the Google Sheet credentials you use must have edit access to the sheet submitted in the form."
},
"typeVersion": 1
},
{
"id": "3beae3d0-d242-4430-8d3d-bd0e24cad78f",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
420,
-340
],
"parameters": {
"color": 7,
"width": 380,
"height": 560,
"content": "## Clean up the company name with AI\n**Important**: For better results, update the system prompt with more specific examples based on the company industry / patterns in your lead data."
},
"typeVersion": 1
}
],
"connections": {
"Merge": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Get Leads": {
"main": [
[
{
"node": "Clean Company Name",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Save Output",
"type": "main",
"index": 0
}
]
]
},
"On Form Submit": {
"main": [
[
{
"node": "Create Destination Sheet",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Clean Company Name",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Clean Company Name": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Create Destination Sheet": {
"main": [
[
{
"node": "Get Leads",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Clean Company Name",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
In cold email campaigns, the lead's company name is the 2nd most frequently inserted variable after their first name. They're critical for effective cold email personalization. However, company names are often messy and can contain taglines, legal suffixes (e.g. LLC, Inc.), and…
Source: https://n8n.io/workflows/5647/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This end-to-end AI-powered recruitment automation workflow helps HR and talent acquisition teams automate the complete hiring pipeline—from resume intake and parsing to GPT-4-based evaluation, TA appr
> *Trend-style celebrity selfie videos
The workflow runs every hour with a randomized delay of 5–20 minutes to help distribute load. It records the exact date and time a lead is emailed so you can track outreach. Follow-ups are automatical
This workflow is perfect for graphic designers, creative agencies, marketing teams, or freelancers who regularly use AI-generated images in their projects. It's specifically beneficial for teams that
This workflow is designed for professionals and teams seeking to scale their B2B research with comprehensive company intelligence. It automates the full prospect analysis process — from extracting con