为新Salesforce工单自动创建Geotab区域
高级
这是一个Sales, IT Ops领域的自动化工作流,包含 22 个节点。主要使用 If, Set, Code, Wait, Webhook 等节点。 为新Salesforce工单自动创建Geotab区域
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •Salesforce OAuth 凭证
- •可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "c4MGMFdD3nrhySMt",
"meta": {
"instanceId": "3ac92fef3584b8cf9f500ec865cb5dd3ab2a3285c90c76fd93c4c042de9ba832",
"templateCredsSetupCompleted": true
},
"name": "为新 Salesforce 工单自动创建 Geotab 区域",
"tags": [],
"nodes": [
{
"id": "ccd1329c-71ad-48ac-b5cd-a09e3ee7cc22",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-500
],
"parameters": {
"color": 5,
"width": 1020,
"height": 260,
"content": "## 通过 GeoTab API 创建区域"
},
"typeVersion": 1
},
{
"id": "6284e435-3929-42c7-9712-275d9dbf9941",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-1080
],
"parameters": {
"color": 4,
"width": 1020,
"height": 280,
"content": "## 准备数据"
},
"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": "响应 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": "便签3",
"type": "n8n-nodes-base.stickyNote",
"disabled": true,
"position": [
-2480,
-1080
],
"parameters": {
"color": 6,
"width": 780,
"height": 280,
"content": "## Salesforce 触发器"
},
"typeVersion": 1
},
{
"id": "92d0377b-9566-47c7-ba7b-59d11af13ee7",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2480,
-780
],
"parameters": {
"color": 7,
"width": 780,
"height": 540,
"content": "## 🛰️ 为新 Salesforce 工单自动创建 Geotab 区域"
},
"typeVersion": 1
},
{
"id": "a277490a-b777-4502-b3b1-efeb4889a31d",
"name": "提取必需字段",
"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": "为 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": "计算点",
"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": "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": "计算区域的活动日期",
"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": "在 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": "使用区域详情更新 Salesforce",
"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": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-760
],
"parameters": {
"color": 3,
"width": 1020,
"height": 220,
"content": "## ⚠️ Salesforce 中缺少地理位置"
},
"typeVersion": 1
},
{
"id": "d9490f6f-620f-4b95-b861-f74279ba4e58",
"name": "等待",
"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": "如果有位置",
"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": "获取工单详情",
"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": "电子邮件通知 - 成功",
"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": "电子邮件通知 - 错误",
"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": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-640,
-1080
],
"parameters": {
"height": 840,
"content": "### 🔐 需要配置的凭据"
},
"typeVersion": 1
},
{
"id": "de984466-995e-4ea2-9a43-0d043b9fd5f0",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2740,
-1080
],
"parameters": {
"height": 840,
"content": "### 🧩 Salesforce 触发器的工作原理"
},
"typeVersion": 1
},
{
"id": "792ffeb9-24d8-4b1a-8659-fd515c17f1f7",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1460,
-1040
],
"parameters": {
"color": 3,
"height": 200,
"content": "**检查地理定位数据**"
},
"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": {
"Wait": {
"main": [
[
{
"node": "Get Work Order details",
"type": "main",
"index": 0
}
]
]
},
"If has location": {
"main": [
[
{
"node": "Prepare data for GeoTab",
"type": "main",
"index": 0
}
],
[
{
"node": "Email notification - error",
"type": "main",
"index": 0
}
]
]
},
"Calculate points": {
"main": [
[
{
"node": "GeoTab authentication",
"type": "main",
"index": 0
}
]
]
},
"Salesforce Webhook": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
},
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Create zone in GeoTab": {
"main": [
[
{
"node": "Update Salesforce with zone details",
"type": "main",
"index": 0
}
]
]
},
"GeoTab authentication": {
"main": [
[
{
"node": "Calculate zone's active dates",
"type": "main",
"index": 0
}
]
]
},
"Get Work Order details": {
"main": [
[
{
"node": "Extract required fields",
"type": "main",
"index": 0
}
]
]
},
"Extract required fields": {
"main": [
[
{
"node": "If has location",
"type": "main",
"index": 0
}
]
]
},
"Prepare data for GeoTab": {
"main": [
[
{
"node": "Calculate points",
"type": "main",
"index": 0
}
]
]
},
"Calculate zone's active dates": {
"main": [
[
{
"node": "Create zone in GeoTab",
"type": "main",
"index": 0
}
]
]
},
"Update Salesforce with zone details": {
"main": [
[
{
"node": "Email notification - success",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 销售, IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用GPT-4.1、Outlook和Mem.ai自动化Microsoft Teams会议分析
使用GPT-4.1、Outlook和Mem.ai自动化Microsoft Teams会议分析
If
Set
Code
+19
61 节点Wayne Simpson
人力资源
实时Notion Todoist双向同步模板
使用Redis的Notion Todoist实时双向同步
If
Set
Code
+26
246 节点Mario
销售
[模板] AI宠物店 v8
🐶 AI宠物店助手 - 集成GPT-4o、Google日历和WhatsApp/Instagram/Facebook
If
N8n
Set
+38
244 节点Amanda Benks
销售
基础PDF数字签名服务
创建支持Webhook的PDF数字签名REST API
If
Set
Code
+6
32 节点Ferenc Erb
销售
自动化Airtable到Postgres迁移,使用n8n
自动化Airtable到Postgres迁移,使用n8n
If
Set
Code
+9
66 节点Imperol
IT 运维
获取所有Scaleway服务器信息副本
通过动态筛选获取Scaleway服务器信息
If
Set
Code
+7
24 节点Pablo
工程
工作流信息
难度等级
高级
节点数量22
分类2
节点类型10
作者
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.
外部链接
在 n8n.io 查看 →
分享此工作流