{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "3B455D65-ACFF-418B-B1FC-B0F9D823C08A",
    "name": "Detrack: delivery exceptions to OS&D review"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -270,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Every evening, finds the day's failed and short deliveries in Detrack, reads the delivery record and POD for what went wrong, and asks dispatch in Slack whether to reattempt, open an OS&D claim, or leave it. Then does what dispatch picked.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Every evening, finds the day's failed and short deliveries in Detrack, reads the delivery record and POD for what went wrong, and asks dispatch in Slack whether to reattempt, open an OS&D claim, or leave it. Then does what dispatch picked.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask dispatch Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 457,
            "y": 210
          }
        },
        "flowElementId": "53314B8D-045C-47EC-ABDA-44165C756E58",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "EF7DEB57-44AD-4CBC-8AD7-7B970477900E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B3E1E23C-CA31-4B60-8051-AFE9804BDDC7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B3E1E23C-CA31-4B60-8051-AFE9804BDDC7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to dispatch",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask dispatch",
        "nextElementIds": [
          "455C54C3-BC44-4469-B225-4B9EF5BCE980"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the exception Result"
          },
          "tools": {},
          "position": {
            "x": 796,
            "y": 49
          }
        },
        "flowElementId": "29881736-BEF6-4C96-8641-213A3C6EECE3",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "4BB74D88-708E-4351-9C21-0C05E500923D",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [
            {
              "mimeType": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "application/pdf"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3B3231B7-EFFA-4965-95F3-3F0AB14A1D1F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Exception reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You review deliveries that a driver closed in Detrack as failed or delivered short. You get the Detrack job record and the exported POD with the driver's signature, photos and notes. Reply with JSON only, with these fields:\nexception: one of refused, short, damaged, not delivered, other\nsummary: one or two plain sentences on what happened at delivery, using the failure reason and the driver's note\nitemsAffected: the pieces or items that were short, damaged or refused, with the quantity expected and the quantity delivered where the record shows them; empty text if the record does not say\nattempts: how many times this load has been attempted, from the record, or 1 if it does not say"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Load "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "do_number",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", delivery date "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "date",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", status "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "status",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
              },
              {
                "id": "NEWLINE",
                "label": null,
                "type": "KEYWORD",
                "value": "\n"
              },
              {
                "id": "NEWLINE",
                "label": null,
                "type": "KEYWORD",
                "value": "\n"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Detrack job record:"
              },
              {
                "id": "NEWLINE",
                "label": null,
                "type": "KEYWORD",
                "value": "\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery record",
                "subPathSegments": [
                  {
                    "key": "data",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A527DFC1-9FEC-45AC-B9EF-F0A1ACCB91B7"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the exception",
        "nextElementIds": [
          "B3E1E23C-CA31-4B60-8051-AFE9804BDDC7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": true,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out today's date Result"
          },
          "position": {
            "x": 110,
            "y": 319
          }
        },
        "flowElementId": "327BF1CE-0FB6-42A1-912C-416C54AF0EAF",
        "groupId": null,
        "id": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "timeZone",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Time zone",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Time zone"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const fmt = (d) => new Intl.DateTimeFormat('en-CA', { timeZone: timeZone || 'America/Chicago', year: 'numeric', month: '2-digit', day: '2-digit' }).format(d);\nconst now = new Date();\nreturn { today: fmt(now), tomorrow: fmt(new Date(now.getTime() + 86400000)) };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Dates",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out today's date",
        "nextElementIds": [
          "89D664E6-6118-497D-9422-4266AEA78F46"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single job by its D.O. number and date, returning the complete job record. This includes proof-of-delivery details captured by the driver such as status, milestones, signature and photo file URLs, recipient name, and geolocation of the completed stop.",
          "elementId": "EXTENSION:::SHARED:::default:::detrack:::getJob",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the delivery record Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::detrack:::getJob",
          "legacyElementId": "JS###v1###DetrackService###getJob",
          "methodName": "getJob",
          "position": {
            "x": 123,
            "y": 40
          }
        },
        "flowElementId": "B6D0ED0B-E0D6-4486-94C2-37432AB4B144",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "A527DFC1-9FEC-45AC-B9EF-F0A1ACCB91B7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "doNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Delivery"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getJob",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Delivery record",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "detrack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the delivery record",
        "nextElementIds": [
          "3B3231B7-EFFA-4965-95F3-3F0AB14A1D1F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 110,
            "y": 219
          }
        },
        "flowElementId": "BB112610-8AA8-466A-B999-FA7A2345FF8F",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "455C54C3-BC44-4469-B225-4B9EF5BCE980",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Dispatch decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for dispatch's answer",
        "nextElementIds": [
          "6F6033AC-B199-42D7-A32C-46FD11966CF8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "96187fa2-8cf9-4ac1-9c48-688103588167": "SIMPLE",
            "511a87ca-ec5a-4360-89a4-b8b01a5c61e1": "SIMPLE"
          },
          "position": {
            "x": 119,
            "y": 389
          }
        },
        "flowElementId": "C90F3D96-CA50-4C14-93CF-913BD3FACA99",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "6F6033AC-B199-42D7-A32C-46FD11966CF8",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Dispatch pick",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "96187fa2-8cf9-4ac1-9c48-688103588167",
              "label": "Reattempt tomorrow",
              "nextComponents": [
                {
                  "componentId": "0CB67D86-D39E-4739-A6EE-357E92C10243",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "reattempt"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "511a87ca-ec5a-4360-89a4-b8b01a5c61e1",
              "label": "Open OS&D claim",
              "nextComponents": [
                {
                  "componentId": "6E0AA54A-BEE5-4B03-A8A2-5DBDF09FD598",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "claim"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "5eae722b-bf24-4ef8-8a82-132e09adf505",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "RESULT",
                "label": "Dispatch decision",
                "subPathSegments": [
                  {
                    "key": "decision",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "455C54C3-BC44-4469-B225-4B9EF5BCE980"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "What did dispatch pick?",
        "nextElementIds": [
          "0CB67D86-D39E-4739-A6EE-357E92C10243",
          "6E0AA54A-BEE5-4B03-A8A2-5DBDF09FD598"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "notes": "Creates a reattempt for a failed or incomplete job, optionally scheduling it for a new date. Useful for automatically rescheduling deliveries that could not be completed on the original attempt.",
          "elementId": "EXTENSION:::SHARED:::default:::detrack:::reattemptJob",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Reattempt tomorrow Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::detrack:::reattemptJob",
          "legacyElementId": "JS###v1###DetrackService###reattemptJob",
          "methodName": "reattemptJob",
          "position": {
            "x": 455,
            "y": 380
          }
        },
        "flowElementId": "044BE8FF-68B3-4B0B-BBD6-AF2C4E850948",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "0CB67D86-D39E-4739-A6EE-357E92C10243",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "doNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "newDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dates",
                    "subPathSegments": [
                      {
                        "key": "tomorrow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Delivery"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "reattemptJob",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Reattempt",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "detrack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Reattempt tomorrow",
        "nextElementIds": [
          "5A3D9464-6B3E-4A50-A854-462EDCBEB2CF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Exports a job's proof-of-delivery (or shipping label) document as a file, stores it in FlowRunner file storage, and returns a downloadable URL. The POD document contains the captured signature, photos, and delivery details. Choose PDF or TIFF format.",
          "elementId": "EXTENSION:::SHARED:::default:::detrack:::getProofOfDelivery",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Export the POD Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::detrack:::getProofOfDelivery",
          "legacyElementId": "JS###v1###DetrackService###getProofOfDelivery",
          "methodName": "getProofOfDelivery",
          "position": {
            "x": 457,
            "y": 40
          }
        },
        "flowElementId": "B76A3E2C-80DA-4CEC-BB4D-302D4042FE7D",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "3B3231B7-EFFA-4965-95F3-3F0AB14A1D1F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "doNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "document",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "pod"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "format",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "pdf"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Delivery"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getProofOfDelivery",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "POD file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "detrack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Export the POD",
        "nextElementIds": [
          "4BB74D88-708E-4351-9C21-0C05E500923D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the claim Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 796,
            "y": 510
          }
        },
        "flowElementId": "1CD3BE7B-6C22-4821-ADB9-7C535D3528D6",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "24C0D82C-006B-4CAC-AFF5-259B12D6E6F7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "OS&D claim for load "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " sent to claims with the POD attached."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to dispatch",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "EF7DEB57-44AD-4CBC-8AD7-7B970477900E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Claim confirmed",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the claim",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the reattempt Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 790,
            "y": 380
          }
        },
        "flowElementId": "36FE9FD6-E6B7-4EFE-841B-8A782315FB8E",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "5A3D9464-6B3E-4A50-A854-462EDCBEB2CF",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Load "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is booked for another delivery attempt on "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dates",
                    "subPathSegments": [
                      {
                        "key": "tomorrow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " in Detrack."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to dispatch",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "EF7DEB57-44AD-4CBC-8AD7-7B970477900E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Reattempt confirmed",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the reattempt",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for dispatch Result"
          },
          "position": {
            "x": 760,
            "y": 219
          }
        },
        "flowElementId": "E10E7E08-E518-4E51-8B17-4E3948E049AA",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "B3E1E23C-CA31-4B60-8051-AFE9804BDDC7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consignee",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery record",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "deliver_to_collect_from",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A527DFC1-9FEC-45AC-B9EF-F0A1ACCB91B7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "exception",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "exception",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "summary",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "itemsAffected",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attempts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "attempts",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3B3231B7-EFFA-4965-95F3-3F0AB14A1D1F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst lines = [\n  `*Delivery exception on load ${loadNumber}: ${exception}*`,\n  `Delivery date: ${date}. Consignee: ${consignee || 'not on the job'}`,\n  summary,\n  items ? `Pieces affected: ${items}` : null,\n  attempts ? `Attempts so far: ${attempts}` : null,\n  `<${podUrl}|Open the POD>`,\n].filter(Boolean);\nreturn {\n  text: `Delivery exception on load ${loadNumber}: ${exception}`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Reattempt tomorrow' }, url: link('reattempt') },\n      { type: 'button', text: { type: 'plain_text', text: 'Open OS&D claim' }, url: link('claim') },\n      { type: 'button', text: { type: 'plain_text', text: 'Leave it' }, url: link('leave') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for dispatch",
        "nextElementIds": [
          "EF7DEB57-44AD-4CBC-8AD7-7B970477900E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Runs an advanced search across jobs using structured filters including a date range, one or more D.O. numbers, multiple statuses, type, and zone. More flexible than List Jobs when you need to match several D.O. numbers or statuses at once, or query across a date window.",
          "elementId": "EXTENSION:::SHARED:::default:::detrack:::searchJobs",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find failed and short deliveries Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::detrack:::searchJobs",
          "legacyElementId": "JS###v1###DetrackService###searchJobs",
          "methodName": "searchJobs",
          "position": {
            "x": 422,
            "y": 310
          }
        },
        "flowElementId": "D064EE8F-F020-4F03-98A0-CDFD036B9C1B",
        "groupId": null,
        "id": "89D664E6-6118-497D-9422-4266AEA78F46",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Delivery"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "doNumbers",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "statuses",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [
                      "failed",
                      "completed_partial"
                    ],
                    "type": "INPUT",
                    "value": "[\"failed\", \"completed_partial\"]"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dates",
                    "subPathSegments": [
                      {
                        "key": "today",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dates",
                    "subPathSegments": [
                      {
                        "key": "today",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "zone",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 100
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "searchJobs",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Exceptions",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "detrack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find failed and short deliveries",
        "nextElementIds": [],
        "nextGroupIds": [
          "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
        ],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Send the OS&D claim Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 453,
            "y": 510
          }
        },
        "flowElementId": "6F028ADC-D2D5-4FC7-B76A-741A52BDA6EC",
        "groupId": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "id": "6E0AA54A-BEE5-4B03-A8A2-5DBDF09FD598",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Claims email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Claims email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "OS&D claim: load "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "exception",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " on "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Dispatch opened an OS&D claim for load "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "do_number",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", delivered "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Consignee: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery record",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "deliver_to_collect_from",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A527DFC1-9FEC-45AC-B9EF-F0A1ACCB91B7"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Exception: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "exception",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "What happened: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Pieces affected: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exception reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "itemsAffected",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4BB74D88-708E-4351-9C21-0C05E500923D"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "The POD from Detrack, with the driver's photos and notes, is attached."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "[\""
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3B3231B7-EFFA-4965-95F3-3F0AB14A1D1F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\"]"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": true,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Claim sent",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the OS&D claim",
        "nextElementIds": [
          "24C0D82C-006B-4CAC-AFF5-259B12D6E6F7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "78E62AEF-B314-4FB5-B4B5-5D75D3DFC703",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 791,
            "y": 319
          }
        },
        "flowElementId": "EED17BCD-1D4B-45DF-A841-B6590F556C40",
        "groupId": null,
        "id": "CDA19C57-7E93-49CE-AE86-6D96FE6343E7",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "A527DFC1-9FEC-45AC-B9EF-F0A1ACCB91B7",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Exceptions",
                "subPathSegments": [
                  {
                    "key": "data",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "89D664E6-6118-497D-9422-4266AEA78F46"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "loop",
          "storeResult": true
        },
        "name": "For each delivery exception",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "AEDADC40-0B58-4D9B-8BEF-336428EF724B",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for dispatch's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Your dispatch time zone, used to decide which day counts as today.",
          "error": null,
          "name": "Time zone",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The inbox that handles OS&D claims.",
          "error": null,
          "name": "Claims email",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-19T06:35:22.561Z"
}
