Crear empresas y tareas en HubSpot a partir de envíos de JotForm, con registro en Google Sheets
Este es unautomatización que contiene 13 nodos.Utiliza principalmente nodos como Code, Wait, Hubspot, HttpRequest, GoogleSheets. Crear empresas y tareas en HubSpot a partir de envíos de JotForm, con registros en Google Sheets
- •Clave de API de HubSpot
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
Nodos utilizados (13)
Categoría
{
"meta": {
"instanceId": "67dd1445921862780ac74448aef33eb969db12b9a6ce95248c7ae86a887cb653",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "0293a49f-3721-456a-9951-3c0c0fc8ba5d",
"name": "Activador de JotForm",
"type": "n8n-nodes-base.jotFormTrigger",
"position": [
640,
416
],
"webhookId": "4376713f-865d-4009-abeb-12ebedde63f5",
"parameters": {
"form": "252808415357461"
},
"credentials": {
"jotFormApi": {
"id": "anmQIw1moNILel4d",
"name": "JotForm account"
}
},
"typeVersion": 1
},
{
"id": "b85baa2e-77ed-4939-8158-be4da9c49b30",
"name": "Espera",
"type": "n8n-nodes-base.wait",
"position": [
1360,
416
],
"webhookId": "60d74e72-8895-4f22-a546-34f92db6c0cf",
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "f4ac75b3-4578-4134-a3da-0d5420d3f578",
"name": "Crear tarea HubSpot",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
1584,
416
],
"parameters": {
"url": "https://api.hubapi.com/crm/v3/objects/tasks",
"method": "POST",
"options": {
"response": {
"response": {
"neverError": true,
"responseFormat": "json"
}
}
},
"jsonBody": "={\n \"properties\": {\n \"hs_task_subject\": \"{{ $('Format Jotform Data').item.json.hubspot_task_title || 'Jotform Marketing Query' }}\",\n \"hs_task_body\": \"{{ \n 'Company: ' + ($('Format Jotform Data').item.json.company_name || 'Unknown Company') + '\\\\n' + \n 'Person: ' + ($('Format Jotform Data').item.json.full_name || 'Unknown') + '\\\\n' + \n 'Email: ' + ($('Format Jotform Data').item.json.email || 'N/A') + '\\\\n' + \n 'LinkedIn: ' + ($('Format Jotform Data').item.json.linkedin_profile || 'N/A') + '\\\\n' + \n 'Domain: ' + ($('Format Jotform Data').item.json.domain || 'N/A') + '\\\\n' + \n 'Marketing Budget (USD): ' + ($('Format Jotform Data').item.json.marketing_budget_usd || 'N/A') + '\\\\n' + \n 'Specific Query: ' + ($('Format Jotform Data').item.json.specific_query || 'No query provided.')\n }}\",\n \"hs_task_status\": \"NOT_STARTED\",\n \"hs_task_priority\": \"HIGH\",\n \"hs_task_type\": \"CALL\",\n \"hs_timestamp\": \"{{ $('Format Jotform Data').item.json.task_timestamp || (new Date().toISOString()) }}\",\n \"hubspot_owner_id\": \"{{ $('Format Jotform Data').item.json.assigned_owner_id || '82654288' }}\"\n },\n \"associations\": [\n {\n \"to\": {\n \"id\": \"{{ $('Format Jotform Data').item.json.company_id || '' }}\"\n },\n \"types\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 192\n }\n ]\n }\n ]\n}\n",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer <your pat token>"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "2b7fc36d-c4ca-485a-88ca-cfa47a5da226",
"name": "Crear empresa1",
"type": "n8n-nodes-base.hubspot",
"position": [
912,
416
],
"parameters": {
"name": "={{ $json.CompanyName }}",
"resource": "company",
"additionalFields": {}
},
"credentials": {
"hubspotApi": {
"id": "0JXgoSMegjZJIEeR",
"name": "HubSpot dummy"
}
},
"typeVersion": 2.2,
"alwaysOutputData": true
},
{
"id": "c17f50ae-ee93-4687-bb76-f9448775e7a0",
"name": "Formatear datos",
"type": "n8n-nodes-base.code",
"position": [
1184,
416
],
"parameters": {
"jsCode": "const inputData = $input.all();\nconst formattedData = [];\n\nconst ownerAssignments = {\n owner1: \"82654288\",\n owner2: \"944860204\", // Replace with actual ID\n};\n\n// helper: safely unescape quotes if Jotform encodes them\nconst unescapeQuotes = (v) =>\n typeof v === 'string'\n ? v.replace(/\\\\'/g, \"'\").replace(/\\\\\"/g, '\"')\n : v;\n\nfor (const { json: item } of inputData) {\n // Extract and sanitize fields\n const firstName = unescapeQuotes(item[\"First Name\"] || item.first_name || '');\n const lastName = unescapeQuotes(item[\"Last Name\"] || item.last_name || '');\n const fullName = `${firstName} ${lastName}`.trim() || 'Unknown';\n const email = unescapeQuotes(item.Email || item.email || '');\n const linkedinProfile = unescapeQuotes(item[\"Linkedin Profile\"] || item.linkedin || '');\n const companyName = unescapeQuotes(item[\"Company Name\"] || item.company_name || 'Unknown Company');\n const marketingBudget = unescapeQuotes(item[\"Marketing Budget ( in USD )\"] || item.marketing_budget || '');\n const domain = unescapeQuotes(item.Domain || item.domain || '');\n const specificQuery = unescapeQuotes(item[\"Any Specific querry ?\"] || item.query || '');\n\n // Task title\n const taskTitle = `(Jotform) Marketing Query from ${fullName} (${companyName})`;\n\n // Owner assignment (basic hash)\n const companyHash = (companyName || '').length % 2;\n const assignedOwnerId = companyHash === 0 ? ownerAssignments.owner1 : ownerAssignments.owner2;\n\n // Timestamp (24 hrs from now)\n const futureDate = new Date();\n futureDate.setHours(futureDate.getHours() + 24);\n const taskTimestamp = futureDate.toISOString();\n\n // Final formatted structure\n const formattedItem = {\n first_name: firstName,\n last_name: lastName,\n full_name: fullName,\n email: email,\n linkedin_profile: linkedinProfile,\n company_name: companyName,\n marketing_budget_usd: marketingBudget,\n domain: domain,\n specific_query: specificQuery,\n hubspot_task_title: taskTitle,\n task_timestamp: taskTimestamp,\n assigned_owner_id: assignedOwnerId,\n };\n\n formattedData.push({ json: formattedItem });\n}\n\nreturn formattedData;\n"
},
"typeVersion": 2
},
{
"id": "da057d1b-4a6e-4e28-8aee-b3636c16831c",
"name": "Registrar logs",
"type": "n8n-nodes-base.googleSheets",
"position": [
2240,
416
],
"parameters": {
"columns": {
"value": {
"Notes": "=This was created at {{ $json.createdAt }} & was updated at {{ $json.updatedAt }}",
"domain": "={{ $json.properties.domain }}",
"company": "={{ $json.properties.name }}",
"HubspotCompanyID": "={{ $json.id }}"
},
"schema": [
{
"id": "company",
"type": "string",
"display": true,
"required": false,
"displayName": "company",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "No. of Stores",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "No. of Stores",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "domain",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "domain",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Notes",
"type": "string",
"display": true,
"required": false,
"displayName": "Notes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "HubspotCompanyID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "HubspotCompanyID",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"domain"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1117410898,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ETTxIAb6Kj69V7xInvYEdYqvKcV8mjE3BoT1a7ER5tE/edit#gid=1117410898",
"cachedResultName": "AlreadyExistingHC"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1ETTxIAb6Kj69V7xInvYEdYqvKcV8mjE3BoT1a7ER5tE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ETTxIAb6Kj69V7xInvYEdYqvKcV8mjE3BoT1a7ER5tE/edit?usp=drivesdk",
"cachedResultName": "Linkedin2Hubspot"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "78jRH4x5Oj2STz8x",
"name": "Google Sheets dummy"
}
},
"typeVersion": 4.7
},
{
"id": "a479a00e-a33e-4123-9887-ef98144d0ec3",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
16
],
"parameters": {
"width": 416,
"height": 624,
"content": "## 🧾 JOTFORM TRIGGER\n\nThis workflow begins with a JotForm submission trigger. \nIt captures the following fields submitted through the form:\n\n- **Name**\n- **First Name**\n- **Last Name**\n- **Email**\n- **LinkedIn Profile**\n- **Company Name**\n- **Marketing Budget (in USD)**\n- **Domain**\n- **Any Specific Query**\n\nEach submission is automatically passed to the next step for HubSpot company creation and task generation.\n"
},
"typeVersion": 1
},
{
"id": "ce5c50c0-18f6-45d8-a74b-13c500fb3777",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
896,
16
],
"parameters": {
"color": 6,
"width": 416,
"height": 624,
"content": "## 🏢 HUBSPOT COMPANY CREATION & FORMATTER\n\nThis section uses the submitted **Company Name** to create a new company record in HubSpot (if it doesn’t already exist). \nThe **Formatter** node then processes all JotForm inputs into a structured, standardized format — ready for task creation in HubSpot.\n\nKey functions performed here:\n- Sanitizes all JotForm fields (name, email, domain, etc.)\n- Generates a follow-up task title automatically\n- Assigns a HubSpot owner based on company data\n- Prepares timestamps for scheduling tasks\n"
},
"typeVersion": 1
},
{
"id": "3231a6ce-d8f8-434b-af2b-fcb08d4a00ba",
"name": "Establecer dominio de empresa",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
2016,
416
],
"parameters": {
"url": "=https://api.hubapi.com/crm/v3/objects/companies/{{ $('Loop Over Items3').item.json.company_id }}",
"method": "PATCH",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"jsonBody": "={\n \"properties\": {\n \"domain\": \"{{ $('Loop Over Items3').item.json.domain}}\"\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer < PAT >"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "968e7fc6-65fa-4385-aba8-2933bac8ed02",
"name": "Espera10",
"type": "n8n-nodes-base.wait",
"position": [
1808,
416
],
"webhookId": "97ecc78e-a2af-485e-883e-48559fe4477b",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "565fce0c-493d-4171-a095-b16d9993b3a3",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1328,
0
],
"parameters": {
"color": 7,
"width": 400,
"height": 640,
"content": "## 🔁 HUBSPOT TASK CREATION\n\nThis section loops through the formatted data and sends HTTP requests to HubSpot to create tasks. \nEach task includes all relevant submission details, such as company, contact, LinkedIn profile, and marketing query.\n\nCore logic:\n- Wait node prevents rate limit collisions\n- HubSpot API is called using a structured payload\n- Tasks are linked with their associated company records\n- Task priority, status, and owner are assigned automatically\n"
},
"typeVersion": 1
},
{
"id": "a332ddf0-e435-4371-b213-8699c3cf066f",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1744,
0
],
"parameters": {
"color": 3,
"width": 400,
"height": 640,
"content": "## 🌐 LOOP OVER & DOMAIN SETTING\n\nAfter the tasks are created, this section updates each HubSpot company with its corresponding **Domain** value using the id generating while creating company. \nIt ensures that all newly created companies in HubSpot have their website field populated correctly.\n\nDetails:\n- Wait node ensures proper sequencing\n- The “Set Company Domain” HTTP request updates the HubSpot company record\n- Prevents duplicate or unlinked company entries\n"
},
"typeVersion": 1
},
{
"id": "62fd01c6-f579-4fb3-9807-f414c2312bed",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2160,
0
],
"parameters": {
"color": 2,
"width": 256,
"height": 624,
"content": "## 📊 STORING LOGS\n\nLogging is critical for transparency and debugging. \nThis section safely records all processed submissions and API responses in a connected **Google Sheet**.\n\nBenefits:\n- Provides a full audit trail of workflow executions\n- Helps monitor form activity and HubSpot sync status\n- Simplifies debugging in case of failed API calls\n"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"b85baa2e-77ed-4939-8158-be4da9c49b30": {
"main": [
[
{
"node": "f4ac75b3-4578-4134-a3da-0d5420d3f578",
"type": "main",
"index": 0
}
]
]
},
"968e7fc6-65fa-4385-aba8-2933bac8ed02": {
"main": [
[
{
"node": "3231a6ce-d8f8-434b-af2b-fcb08d4a00ba",
"type": "main",
"index": 0
}
]
]
},
"c17f50ae-ee93-4687-bb76-f9448775e7a0": {
"main": [
[
{
"node": "b85baa2e-77ed-4939-8158-be4da9c49b30",
"type": "main",
"index": 0
}
]
]
},
"0293a49f-3721-456a-9951-3c0c0fc8ba5d": {
"main": [
[
{
"node": "2b7fc36d-c4ca-485a-88ca-cfa47a5da226",
"type": "main",
"index": 0
}
]
]
},
"2b7fc36d-c4ca-485a-88ca-cfa47a5da226": {
"main": [
[
{
"node": "c17f50ae-ee93-4687-bb76-f9448775e7a0",
"type": "main",
"index": 0
}
]
]
},
"3231a6ce-d8f8-434b-af2b-fcb08d4a00ba": {
"main": [
[
{
"node": "da057d1b-4a6e-4e28-8aee-b3636c16831c",
"type": "main",
"index": 0
}
]
]
},
"f4ac75b3-4578-4134-a3da-0d5420d3f578": {
"main": [
[
{
"node": "968e7fc6-65fa-4385-aba8-2933bac8ed02",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Rahi Uppal
@rahiuppalAI and Automation Consultant with over 1000 hours of experience building, deploying, and solving marketing and sales automation problems. I ship AI products faster by combining business acumen with AI & automation expertise and an engineering mindset. Connect with me on LinkedIn to chat.
Compartir este flujo de trabajo