{
  "name": "Auto-create Geotab zone for new Salesforce work order",
  "nodes": [
    {
      "id": "ccd1329c-71ad-48ac-b5cd-a09e3ee7cc22",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -500
      ],
      "parameters": {
        "width": 1020,
        "height": 260,
        "content": "## Create zone via GeoTab API"
      }
    },
    {
      "id": "6284e435-3929-42c7-9712-275d9dbf9941",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -1080
      ],
      "parameters": {
        "width": 1020,
        "height": 280,
        "content": "## Prepare Data"
      }
    },
    {
      "id": "bcd0e739-c12d-4713-8151-08bc4ed58ff9",
      "name": "Salesforce Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2240,
        -1000
      ]
    },
    {
      "id": "d1769685-53ba-4817-8acb-a7ff5c62cb7d",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -2400,
        -1000
      ]
    },
    {
      "id": "565627d5-ccf9-4e74-a4be-7c7054bc0359",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2480,
        -1080
      ],
      "parameters": {
        "width": 780,
        "height": 280,
        "content": "## Salesforce Trigger"
      }
    },
    {
      "id": "92d0377b-9566-47c7-ba7b-59d11af13ee7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2480,
        -780
      ],
      "parameters": {
        "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 me"
      }
    },
    {
      "id": "a277490a-b777-4502-b3b1-efeb4889a31d",
      "name": "Extract required fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -1620,
        -1000
      ]
    },
    {
      "id": "e6bcdcc0-ebd6-423b-a6a7-59e284c38fae",
      "name": "Prepare data for GeoTab",
      "type": "n8n-nodes-base.set",
      "position": [
        -1060,
        -1000
      ]
    },
    {
      "id": "dcccefd2-b65b-44ef-86a0-1403f2a8279c",
      "name": "Calculate points",
      "type": "n8n-nodes-base.code",
      "position": [
        -880,
        -1000
      ]
    },
    {
      "id": "9e4b63fb-597f-448e-80b9-b1f066740a2c",
      "name": "GeoTab authentication",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1600,
        -420
      ]
    },
    {
      "id": "e7b80c7d-f5ac-4085-8428-f3b4757a094d",
      "name": "Calculate zone's active dates",
      "type": "n8n-nodes-base.code",
      "position": [
        -1420,
        -420
      ]
    },
    {
      "id": "01adf82d-0894-4f23-816f-beb236a390ef",
      "name": "Create zone in GeoTab",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1240,
        -420
      ]
    },
    {
      "id": "c16af016-b846-4072-bc4a-fa99eec28e70",
      "name": "Update Salesforce with zone details",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        -1040,
        -420
      ]
    },
    {
      "id": "3e89e6b1-7716-465f-98ba-bed15ec63b5e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -760
      ],
      "parameters": {
        "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 yo"
      }
    },
    {
      "id": "d9490f6f-620f-4b95-b861-f74279ba4e58",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2040,
        -1000
      ]
    },
    {
      "id": "e8d8baff-0099-4540-9dea-040b82ef8496",
      "name": "If has location",
      "type": "n8n-nodes-base.if",
      "position": [
        -1400,
        -1000
      ]
    },
    {
      "id": "cdea4264-3b0e-4f5f-b822-70b0409b5d79",
      "name": "Get Work Order details",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        -1880,
        -1000
      ]
    },
    {
      "id": "d7614077-3d8e-4a1e-b07e-778a4d058ac7",
      "name": "Email notification  - success",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -860,
        -420
      ]
    },
    {
      "id": "869a3860-a66b-44bb-ac64-622ac582046f",
      "name": "Email notification  - error",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -860,
        -720
      ]
    },
    {
      "id": "e4fa9f14-39b8-4b20-b288-425ceb01f51e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -1080
      ],
      "parameters": {
        "width": null,
        "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* 🔹 **Outlo"
      }
    },
    {
      "id": "de984466-995e-4ea2-9a43-0d043b9fd5f0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2740,
        -1080
      ],
      "parameters": {
        "width": null,
        "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*"
      }
    },
    {
      "id": "792ffeb9-24d8-4b1a-8659-fd515c17f1f7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1460,
        -1040
      ],
      "parameters": {
        "width": null,
        "height": 200,
        "content": "**Check geolocation data**"
      }
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}