Crear automáticamente una región en Geotab para un nuevo ticket de Salesforce
Este es unSales, IT Opsflujo de automatización del dominio deautomatización que contiene 22 nodos.Utiliza principalmente nodos como If, Set, Code, Wait, Webhook. Crear automáticamente una zona Geotab para nuevos tickets de Salesforce
- •Punto final de HTTP Webhook (n8n generará automáticamente)
- •Credenciales OAuth de Salesforce
- •Pueden requerirse credenciales de autenticación para la API de destino
Nodos utilizados (22)
Categoría
{
"id": "c4MGMFdD3nrhySMt",
"meta": {
"instanceId": "3ac92fef3584b8cf9f500ec865cb5dd3ab2a3285c90c76fd93c4c042de9ba832",
"templateCredsSetupCompleted": true
},
"name": "Auto-Create Geotab Zone for New Salesforce Work Order",
"tags": [],
"nodes": [
{
"id": "ccd1329c-71ad-48ac-b5cd-a09e3ee7cc22",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-500
],
"parameters": {
"color": 5,
"width": 1020,
"height": 260,
"content": "## Create zone via GeoTab API"
},
"typeVersion": 1
},
{
"id": "6284e435-3929-42c7-9712-275d9dbf9941",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-1080
],
"parameters": {
"color": 4,
"width": 1020,
"height": 280,
"content": "## Prepare Data"
},
"typeVersion": 1
},
{
"id": "bcd0e739-c12d-4713-8151-08bc4ed58ff9",
"name": "Salesforce Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-2240,
-1000
],
"webhookId": "5e194736-f8d7-4eef-9c71-85d264168f3a",
"parameters": {
"path": "5e194736-f8d7-4eef-9c71-85d264168f3a",
"options": {
"rawBody": false
},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "d1769685-53ba-4817-8acb-a7ff5c62cb7d",
"name": "Responder a Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
-2400,
-1000
],
"parameters": {
"options": {
"responseHeaders": {
"entries": [
{
"name": "Content-Type",
"value": "application/xml"
}
]
}
},
"respondWith": "text",
"responseBody": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soapenv:Body>\n <notificationsResponse xmlns=\"http://soap.sforce.com/2005/09/outbound\">\n <Ack>true</Ack>\n </notificationsResponse>\n </soapenv:Body>\n</soapenv:Envelope>"
},
"typeVersion": 1.1
},
{
"id": "565627d5-ccf9-4e74-a4be-7c7054bc0359",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"disabled": true,
"position": [
-2480,
-1080
],
"parameters": {
"color": 6,
"width": 780,
"height": 280,
"content": "## Salesforce Trigger"
},
"typeVersion": 1
},
{
"id": "92d0377b-9566-47c7-ba7b-59d11af13ee7",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2480,
-780
],
"parameters": {
"color": 7,
"width": 780,
"height": 540,
"content": "## 🛰️ Auto-Create Geotab Zone for New Salesforce Work Order\n\n### 📌 What this workflow does\n\nThis automation listens for new **Work Order (Job)** records created in **Salesforce**, and—if the record meets certain conditions—creates a **geofence zone** in **Geotab** at the Work Order’s location.\n\nIt only triggers when:\n\n* The Work Order has a `New` status\n* There is **no existing Geotab Zone ID**\n* The record contains **valid latitude and longitude**\n\nAfter creating the zone, the workflow updates Salesforce with the Geotab Zone ID and sends a confirmation email. If no geo data is available, it notifies the Operations team.\n\n**You can customise this workflow to your needs; for example change Salesforce Object (Opportunity, Account etc).**\n\n### ⚙️ Required Integrations\n* ✅ Salesforce (OAuth2)\n* ✅ Microsoft Outlook (for email notifications)\n* ✅ Geotab API access\n"
},
"typeVersion": 1
},
{
"id": "a277490a-b777-4502-b3b1-efeb4889a31d",
"name": "Extraer campos requeridos",
"type": "n8n-nodes-base.set",
"position": [
-1620,
-1000
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "74d77b73-9e08-4ce7-b5e2-89fff556a6c2",
"name": "Id",
"type": "string",
"value": "={{ $json.Id }}"
},
{
"id": "ca06a724-d57d-4717-9495-08132fb96a8c",
"name": "WorkOrderNumber",
"type": "string",
"value": "={{ $json.WorkOrderNumber }}"
},
{
"id": "b381c523-da76-43c0-a43d-4f6c0e724d20",
"name": "Job_Type__c",
"type": "string",
"value": "={{ $json.Job_Type__c }}"
},
{
"id": "bdc4c9f0-e6ce-4408-82b5-cf79f1e37fc2",
"name": "Job_Sub_Type__c",
"type": "string",
"value": "={{ $json.Job_Sub_Type__c }}"
},
{
"id": "e0fcdb6d-c0af-490c-ac81-c6515c873a6d",
"name": "Address.latitude",
"type": "string",
"value": "={{ $json.Address.latitude }}"
},
{
"id": "92571b99-e82e-4c35-8707-baeb1d80e7b0",
"name": "Address.longitude",
"type": "string",
"value": "={{ $json.Address.longitude }}"
},
{
"id": "d32277a0-4e4e-48a3-9123-543b3509f177",
"name": "CreatedDate",
"type": "string",
"value": "={{ $json.CreatedDate }}"
},
{
"id": "318c819e-d7b1-4faf-8e7b-2907f6df0c1a",
"name": "Last_Appointment_Date__c",
"type": "string",
"value": "={{ $json.Last_Appointment_Date__c }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e6bcdcc0-ebd6-423b-a6a7-59e284c38fae",
"name": "Preparar datos para GeoTab",
"type": "n8n-nodes-base.set",
"position": [
-1060,
-1000
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c45bb0c8-1ef9-4259-b985-d28be0a43878",
"name": "Name",
"type": "string",
"value": "={{ $json.WorkOrderNumber }}"
},
{
"id": "adfc451e-c84e-480e-9723-312cb85a8c7d",
"name": "Latitude",
"type": "string",
"value": "={{ $json.Address.latitude }}"
},
{
"id": "754cc87f-7e75-4187-80fa-b74dfb91983c",
"name": "Longitude",
"type": "string",
"value": "={{ $json.Address.longitude }}"
},
{
"id": "727937f2-8448-46b3-b9db-9170d2547ceb",
"name": "Reference",
"type": "string",
"value": "={{ $json.Job_Type__c }}"
},
{
"id": "fe9ccc9d-23c9-429a-9d9b-f5445ccf55fc",
"name": "Comment",
"type": "string",
"value": "={{ $json.Job_Sub_Type__c }}"
},
{
"id": "0cae7115-82fb-446b-8a95-3536f926c6b9",
"name": "ExternalReference",
"type": "string",
"value": "={{ $json.Id }}"
},
{
"id": "de07e177-0dca-4d5e-842f-1b8233a02502",
"name": "ActiveTo",
"type": "string",
"value": "={{ $json.Last_Appointment_Date__c }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "dcccefd2-b65b-44ef-86a0-1403f2a8279c",
"name": "Calcular puntos",
"type": "n8n-nodes-base.code",
"position": [
-880,
-1000
],
"parameters": {
"jsCode": "const inputData = items[0].json;\n\nconst centerLatitude = parseFloat(inputData.Latitude);\nconst centerLongitude = parseFloat(inputData.Longitude);\nconst radius = 200; // Radius in meters (adjust as needed) - Consider making this an input parameter\nconst numPoints = 20; // Number of points on the circle\n\nconst earthRadius = 6371000; // Earth's radius in meters\n\nlet results = [];\n\n\nfor (let i = 0; i < numPoints; i++) {\n const angle = 2 * Math.PI * i / numPoints;\n const lat = centerLatitude + (radius / earthRadius) * (180 / Math.PI) * Math.cos(angle);\n const lon = centerLongitude + (radius / earthRadius) * (180 / Math.PI) * Math.sin(angle) / Math.cos(centerLatitude * Math.PI / 180);\n results.push({\n ...inputData,\n latitude: lat,\n longitude: lon\n })\n}\n\n\n// Create an object with a key called \"result\" to hold the results array\n// this ensure that the the json key points to a valid object in item[0]\nitems[0].json.result = results\n\n//return the updated item\nreturn items;"
},
"typeVersion": 2
},
{
"id": "9e4b63fb-597f-448e-80b9-b1f066740a2c",
"name": "Autenticación GeoTab",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1600,
-420
],
"parameters": {
"url": "https://my.geotab.com/apiv1/Authenticate",
"method": "POST",
"options": {},
"jsonBody": "{\n \"method\": \"Authenticate\",\n \"params\": {\n \"database\": \"YOUR_GEOTAB_DATABASE_NAME\",\n \"userName\": \"YOUR@USERNAME.EMAIL\",\n \"password\": \"YOUR_GEOTAB_USER_PASSWORD\"\n }\n}\n",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "e7b80c7d-f5ac-4085-8428-f3b4757a094d",
"name": "Calcular fechas activas de la zona",
"type": "n8n-nodes-base.code",
"position": [
-1420,
-420
],
"parameters": {
"jsCode": "const today = new Date();\ntoday.setUTCHours(0, 0, 0, 0); // Ensures time is set to 00:00:00.000 UTC\nconst activeFrom = today.toISOString(); // Ensures the string format\n\nconst futureDate = new Date(today);\nfutureDate.setDate(today.getDate() + 60);\nfutureDate.setUTCHours(0, 0, 0, 0); // Ensures time is set to 00:00:00.000 UTC\nconst activeTo = futureDate.toISOString(); // Ensures the string format\n\nreturn [\n {\n json: {\n activeFrom: activeFrom.split(\".\")[0] + \"Z\", // Removes milliseconds if necessary\n activeTo: activeTo.split(\".\")[0] + \"Z\" // Removes milliseconds if necessary\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "01adf82d-0894-4f23-816f-beb236a390ef",
"name": "Crear zona en GeoTab",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1240,
-420
],
"parameters": {
"url": "https://my.geotab.com/apiv1",
"method": "POST",
"options": {},
"jsonBody": "={\n \"method\": \"Add\",\n \"params\": {\n \"typeName\": \"Zone\",\n\n \"entity\": {\n \"name\": \"{{ $('Prepare data for GeoTab').item.json.Name }}\",\n \"externalReference\": \"{{ $('Prepare data for GeoTab').item.json.ExternalReference }}\",\n \"reference\": \"{{ $('Prepare data for GeoTab').item.json.Reference }}\",\n \"comment\": \"{{ $('Prepare data for GeoTab').item.json.Comment }}\",\n\n \"groups\": [\n {\"id\": \"GroupCompanyId\"}\n ],\n\n \"activeFrom\": \"{{ $json.activeFrom }}\",\n \"activeTo\": \"{{ $json.activeTo }}\",\n\n\n \"points\": [\n { \"x\": {{ $('Calculate points').item.json.result[0].longitude }}, \"y\": {{ $('Calculate points').item.json.result[0].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[1].longitude }}, \"y\": {{ $('Calculate points').item.json.result[1].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[2].longitude }}, \"y\": {{ $('Calculate points').item.json.result[2].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[3].longitude }}, \"y\": {{ $('Calculate points').item.json.result[3].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[4].longitude }}, \"y\": {{ $('Calculate points').item.json.result[4].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[5].longitude }}, \"y\": {{ $('Calculate points').item.json.result[5].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[6].longitude }}, \"y\": {{ $('Calculate points').item.json.result[6].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[7].longitude }}, \"y\": {{ $('Calculate points').item.json.result[7].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[8].longitude }}, \"y\": {{ $('Calculate points').item.json.result[8].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[9].longitude }}, \"y\": {{ $('Calculate points').item.json.result[9].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[10].longitude }}, \"y\": {{ $('Calculate points').item.json.result[10].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[11].longitude }}, \"y\": {{ $('Calculate points').item.json.result[11].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[12].longitude }}, \"y\": {{ $('Calculate points').item.json.result[12].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[13].longitude }}, \"y\": {{ $('Calculate points').item.json.result[13].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[14].longitude }}, \"y\": {{ $('Calculate points').item.json.result[14].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[15].longitude }}, \"y\": {{ $('Calculate points').item.json.result[15].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[16].longitude }}, \"y\": {{ $('Calculate points').item.json.result[16].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[17].longitude }}, \"y\": {{ $('Calculate points').item.json.result[17].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[18].longitude }}, \"y\": {{ $('Calculate points').item.json.result[18].latitude }}},\n { \"x\": {{ $('Calculate points').item.json.result[19].longitude }}, \"y\": {{ $('Calculate points').item.json.result[19].latitude }}}\n ],\n\n \"visibleOnMap\": true,\n \"publishToGroups\": [1],\n \"showStopsInArea\": true\n },\n\n \"credentials\": {\n \"sessionId\": \"{{ $('GeoTab authentication').item.json.result.credentials.sessionId }}\",\n \"database\": \"YOUR_GEOTAB_DATABASE_NAME\",\n \"userName\": \"YOUR@EMAIL.COM\"\n }\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "c16af016-b846-4072-bc4a-fa99eec28e70",
"name": "Actualizar Salesforce con detalles de la zona",
"type": "n8n-nodes-base.salesforce",
"position": [
-1040,
-420
],
"parameters": {
"recordId": "={{ $('Get Work Order details').item.json.Id }}",
"resource": "customObject",
"operation": "update",
"customObject": "=WorkOrder",
"updateFields": {},
"customFieldsUi": {
"customFieldsValues": [
{
"value": "={{ $json.result }}",
"fieldId": "GeoTab_ID__c"
},
{
"value": "true",
"fieldId": "GeoTab_Zone_Created__c"
}
]
}
},
"credentials": {
"salesforceOAuth2Api": {
"id": "KAHKZKH1lz0bg0hS",
"name": "Salesforce account"
}
},
"typeVersion": 1
},
{
"id": "3e89e6b1-7716-465f-98ba-bed15ec63b5e",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-760
],
"parameters": {
"color": 3,
"width": 1020,
"height": 220,
"content": "## ⚠️ Missing Geolocation in Salesforce\n\nThis branch sends an email notification when a Work Order is missing latitude and longitude.\nYou can delete this section alongside \"If has location node\" if your Salesforce trigger already excludes such records."
},
"typeVersion": 1
},
{
"id": "d9490f6f-620f-4b95-b861-f74279ba4e58",
"name": "Esperar",
"type": "n8n-nodes-base.wait",
"position": [
-2040,
-1000
],
"webhookId": "41f8eb49-8fe2-46c3-b38f-21b7b2b3de68",
"parameters": {
"amount": 30
},
"typeVersion": 1.1
},
{
"id": "e8d8baff-0099-4540-9dea-040b82ef8496",
"name": "Si tiene ubicación",
"type": "n8n-nodes-base.if",
"position": [
-1400,
-1000
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "7d478faa-ef55-4f33-95db-1bb9e83437f0",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.Address.latitude }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "cdea4264-3b0e-4f5f-b822-70b0409b5d79",
"name": "Obtener detalles de la orden de trabajo",
"type": "n8n-nodes-base.salesforce",
"notes": "{{ $json.body['soapenv:envelope']['soapenv:body'].notifications.notification.sobject['sf:id'] }}",
"position": [
-1880,
-1000
],
"parameters": {
"recordId": "={{ $json.body['soapenv:envelope']['soapenv:body'].notifications.notification.sobject['sf:id'] }}",
"resource": "customObject",
"operation": "get",
"customObject": "=WorkOrder"
},
"credentials": {
"salesforceOAuth2Api": {
"id": "KAHKZKH1lz0bg0hS",
"name": "Salesforce account"
}
},
"typeVersion": 1
},
{
"id": "d7614077-3d8e-4a1e-b07e-778a4d058ac7",
"name": "Notificación por correo - éxito",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
-860,
-420
],
"webhookId": "bb379079-71c4-414f-91a0-6b22aafa2407",
"parameters": {
"subject": "=Job zone was created for job number {{ $('Get Work Order details').item.json.WorkOrderNumber }}",
"bodyContent": "=Hi Sobek,\n\nThe geofence for the job {{ $('Get Work Order details').item.json.WorkOrderNumber }} has been successfully created in GeoTab.\n\nLink to job in Salesforce:\nhttps://idealresponse.lightning.force.com/lightning/r/WorkOrder/{{ $('Get Work Order details').item.json.Id }}/view\n\nGeoTab Zone link:\nhttps://my.geotab.com/irg/#zones,edit:{{ $('Create zone in GeoTab').item.json.result }}\n\nBest regards,\n\nIRG Ltd\nIT Department\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nJob attribiutes:\nJob ID: {{ $('Get Work Order details').item.json.Id }}\nOpportunity ID: {{ $('Get Work Order details').item.json.Opportunity__c }}\nPrimary Quote ID: {{ $('Get Work Order details').item.json.Primary_Quote_ID__c }}\nQuote Value: {{ $('Get Work Order details').item.json.Quote_value__c }}\nLead Source: {{ $('Get Work Order details').item.json.Lead_Source__c }}\nLead Source Main: {{ $('Get Work Order details').item.json.Lead_Source_Main_Type__c }}\n\nAccount: {{ $('Get Work Order details').item.json.Account_Text__c }}\nContact: {{ $('Get Work Order details').item.json.Contact_Full_Name__c }}\nContact email: {{ $('Get Work Order details').item.json.Contact_Email__c }}\n\nStreet: {{ $('Get Work Order details').item.json.Street }}\nCity: {{ $('Get Work Order details').item.json.City }}\nPostcode: {{ $('Get Work Order details').item.json.PostalCode }}\nLatitude: {{ $('Get Work Order details').item.json.Address.latitude }}\nLongitude: {{ $('Get Work Order details').item.json.Address.longitude }}\n\nSubject: {{ $('Get Work Order details').item.json.Subject }}\nJob Type: {{ $('Get Work Order details').item.json.Job_Type__c }}\nJob Sub Type: {{ $('Get Work Order details').item.json.Job_Sub_Type__c }}\nPayment Terms: {{ $('Get Work Order details').item.json.Payment_Terms_Quote__c }}\n\nOwner's name: {{ $('Get Work Order details').item.json.Owner_name__c }}\nOwner's Job Title: {{ $('Get Work Order details').item.json.Owner_s_Title__c }}\nOwner's Division: {{ $('Get Work Order details').item.json.Owner_s_Division__c }}\nOwners' Email: {{ $('Get Work Order details').item.json.Owner_Email__c }}\n\nJob Description:\n{{ $('Get Work Order details').item.json.Description }}",
"toRecipients": "=some@email.com",
"additionalFields": {}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "25JUCOpf2f8qi9uO",
"name": "Microsoft Outlook Sobek"
}
},
"typeVersion": 2
},
{
"id": "869a3860-a66b-44bb-ac64-622ac582046f",
"name": "Notificación por correo - error",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
-860,
-720
],
"webhookId": "980733cc-3bc5-430b-ba59-fa522b5bd9d1",
"parameters": {
"subject": "=Action Required: Missing Geo Location for Job {{ $('Get Work Order details').item.json.WorkOrderNumber }}",
"bodyContent": "=THIS IS AUTOMATED MESSAGE. DO NOT RESPOND.\n\nDear {{ $('Get Work Order details').item.json.Owner_name__c }},\n\nThis is an automated notification. Please do not reply to this message.\n\nWe have identified that the geo location data for Work Order #{{ $('Get Work Order details').item.json.WorkOrderNumber }} s missing in Salesforce, likely due to an incomplete or incorrect address. This data is essential for the effective management and execution of our projects.\n\nFor quick access to the job details in Salesforce, please use the following link:\nhttps://USE_YOUR_SALESFORCE_URL-DOMAIN/lightning/r/WorkOrder/{{ $('Get Work Order details').item.json.Id }}/view\n\n\n\nBest regards,\n\nIRG Ltd\nIT Department\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nJob details:\n\nJob ID: {{ $('Get Work Order details').item.json.Id }}\nOpportunity ID: {{ $('Get Work Order details').item.json.Opportunity__c }}\nPrimary Quote ID: {{ $('Get Work Order details').item.json.Primary_Quote_ID__c }}\nQuote Value: {{ $('Get Work Order details').item.json.Quote_value__c }}\nLead Source: {{ $('Get Work Order details').item.json.Lead_Source__c }}\nLead Source Main: {{ $('Get Work Order details').item.json.Lead_Source_Main_Type__c }}\n\nAccount: {{ $('Get Work Order details').item.json.Account_Text__c }}\nContact: {{ $('Get Work Order details').item.json.Contact_Full_Name__c }}\nContact email: {{ $('Get Work Order details').item.json.Contact_Email__c }}\n\nStreet: {{ $('Get Work Order details').item.json.Street }}\nCity: {{ $('Get Work Order details').item.json.City }}\nPostcode: {{ $('Get Work Order details').item.json.PostalCode }}\nLatitude: {{ $('Get Work Order details').item.json.Address.latitude }}\nLongitude: {{ $('Get Work Order details').item.json.Address.longitude }}\n\nSubject: {{ $('Get Work Order details').item.json.Subject }}\nJob Type: {{ $('Get Work Order details').item.json.Job_Type__c }}\nJob Sub Type: {{ $('Get Work Order details').item.json.Job_Sub_Type__c }}\nPayment Terms: {{ $('Get Work Order details').item.json.Payment_Terms_Quote__c }}\n\nOwner's name: {{ $('Get Work Order details').item.json.Owner_name__c }}\nOwner's Job Title: {{ $('Get Work Order details').item.json.Owner_s_Title__c }}\nOwner's Division: {{ $('Get Work Order details').item.json.Owner_s_Division__c }}\nOwners' Email: {{ $('Get Work Order details').item.json.Owner_Email__c }}\n\nJob Description:\n{{ $('Get Work Order details').item.json.Description }}",
"toRecipients": "some@email.com",
"additionalFields": {}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "25JUCOpf2f8qi9uO",
"name": "Microsoft Outlook Sobek"
}
},
"typeVersion": 2
},
{
"id": "e4fa9f14-39b8-4b20-b288-425ceb01f51e",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-640,
-1080
],
"parameters": {
"height": 840,
"content": "### 🔐 Credentials to configure\n\nYou must connect or edit the following credentials:\n\n* 🔹 **Salesforce Account**\n\n * Nodes: `Get Work Order details`, `Update Salesforce with zone details`\n\n* 🔹 **Outlook Account**\n\n * Nodes: `Email notification - success`, `Email notification - error`\n\n* 🔹 **Geotab API**\n\n * Node: `GeoTab authentication`\n\n * Replace `userName`, `password`, and `database` fields in the JSON body\n * Node: `Create zone in GeoTab`\n\n * Update the same values at the end of the JSON body (`database`, `userName`)\n\n"
},
"typeVersion": 1
},
{
"id": "de984466-995e-4ea2-9a43-0d043b9fd5f0",
"name": "Nota adhesiva6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2740,
-1080
],
"parameters": {
"height": 840,
"content": "### 🧩 How the Salesforce trigger works\n\nThis workflow is triggered by **an Outbound Message from Salesforce**.\n\nIn Salesforce Setup, you can configure an **Outbound Message** tied to the **Work Order** object. When a new Work Order is created (or meets specific criteria), Salesforce sends a SOAP request to this workflow's **Webhook URL**.\n\nThe workflow starts by receiving this message and extracting the Work Order ID to retrieve full details using the Salesforce node.\n\n### ⚠️ Setup Required in Salesforce\n\n1. Go to **Setup → Outbound Messages**\n2. Create a new Outbound Message for the **Work Order** object\n3. Add fields as needed (at minimum, `Id`)\n4. Paste the Webhook URL from the **Salesforce Webhook** node in this workflow\n5. Link the Outbound Message to a Workflow Rule or Flow that fires when a **new Work Order is created**\n"
},
"typeVersion": 1
},
{
"id": "792ffeb9-24d8-4b1a-8659-fd515c17f1f7",
"name": "Nota adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1460,
-1040
],
"parameters": {
"color": 3,
"height": 200,
"content": "**Check geolocation data**"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {
"Salesforce Webhook": [
{
"json": {
"body": {
"soapenv:envelope": {
"$": {
"xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"xmlns:soapenv": "http://schemas.xmlsoap.org/soap/envelope/"
},
"soapenv:body": {
"notifications": {
"$": {
"xmlns": "http://soap.sforce.com/2005/09/outbound"
},
"actionid": "04kTf000001BWdVIAW",
"sessionid": {
"$": {
"xsi:nil": "true"
}
},
"partnerurl": "https://idealresponse.my.salesforce.com/services/Soap/u/63.0/00D1r000002EWR8",
"notification": {
"id": "04lTf00000UTGqQIAX",
"sobject": {
"$": {
"xmlns:sf": "urn:sobject.enterprise.soap.sforce.com",
"xsi:type": "sf:WorkOrder"
},
"sf:id": "0WOTf0000041LUjOAM"
}
},
"enterpriseurl": "https://idealresponse.my.salesforce.com/services/Soap/c/63.0/00D1r000002EWR8",
"organizationid": "00D1r000002EWR8EAO"
}
}
}
},
"query": {},
"params": {},
"headers": {
"via": "1.1 Caddy",
"host": "n8n.irgl.uk",
"soapaction": "\"\"",
"user-agent": "Jakarta Commons-HttpClient/3.1",
"content-type": "text/xml; charset=utf-8",
"content-length": "908",
"accept-encoding": "gzip",
"x-forwarded-for": "145.224.205.255",
"x-forwarded-host": "n8n.irgl.uk",
"x-forwarded-proto": "https"
},
"webhookUrl": "https://n8n.irgl.uk/webhook/irglsalesforcejob",
"executionMode": "production"
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "c8533727-0485-43f8-8efa-86fe44e871e9",
"connections": {
"d9490f6f-620f-4b95-b861-f74279ba4e58": {
"main": [
[
{
"node": "cdea4264-3b0e-4f5f-b822-70b0409b5d79",
"type": "main",
"index": 0
}
]
]
},
"e8d8baff-0099-4540-9dea-040b82ef8496": {
"main": [
[
{
"node": "e6bcdcc0-ebd6-423b-a6a7-59e284c38fae",
"type": "main",
"index": 0
}
],
[
{
"node": "869a3860-a66b-44bb-ac64-622ac582046f",
"type": "main",
"index": 0
}
]
]
},
"dcccefd2-b65b-44ef-86a0-1403f2a8279c": {
"main": [
[
{
"node": "9e4b63fb-597f-448e-80b9-b1f066740a2c",
"type": "main",
"index": 0
}
]
]
},
"bcd0e739-c12d-4713-8151-08bc4ed58ff9": {
"main": [
[
{
"node": "d1769685-53ba-4817-8acb-a7ff5c62cb7d",
"type": "main",
"index": 0
},
{
"node": "d9490f6f-620f-4b95-b861-f74279ba4e58",
"type": "main",
"index": 0
}
]
]
},
"01adf82d-0894-4f23-816f-beb236a390ef": {
"main": [
[
{
"node": "c16af016-b846-4072-bc4a-fa99eec28e70",
"type": "main",
"index": 0
}
]
]
},
"9e4b63fb-597f-448e-80b9-b1f066740a2c": {
"main": [
[
{
"node": "e7b80c7d-f5ac-4085-8428-f3b4757a094d",
"type": "main",
"index": 0
}
]
]
},
"cdea4264-3b0e-4f5f-b822-70b0409b5d79": {
"main": [
[
{
"node": "a277490a-b777-4502-b3b1-efeb4889a31d",
"type": "main",
"index": 0
}
]
]
},
"a277490a-b777-4502-b3b1-efeb4889a31d": {
"main": [
[
{
"node": "e8d8baff-0099-4540-9dea-040b82ef8496",
"type": "main",
"index": 0
}
]
]
},
"e6bcdcc0-ebd6-423b-a6a7-59e284c38fae": {
"main": [
[
{
"node": "dcccefd2-b65b-44ef-86a0-1403f2a8279c",
"type": "main",
"index": 0
}
]
]
},
"e7b80c7d-f5ac-4085-8428-f3b4757a094d": {
"main": [
[
{
"node": "01adf82d-0894-4f23-816f-beb236a390ef",
"type": "main",
"index": 0
}
]
]
},
"c16af016-b846-4072-bc4a-fa99eec28e70": {
"main": [
[
{
"node": "d7614077-3d8e-4a1e-b07e-778a4d058ac7",
"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?
Avanzado - Ventas, Operaciones de TI
¿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
Sobek
@maagicIT Manager and automation architect with expertise in Salesforce, Microsoft 365, and n8n. I build robust, production-grade workflows that solve real business problems—no fluff, just practical automation. Let’s streamline your operations with smart, maintainable solutions.
Compartir este flujo de trabajo