{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "71877557-DB0B-4964-AD3F-BB6DA26888A5",
    "name": "FMCSA: carrier checked when booked in McLeod"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -54.71094710947109,
        "y": 5.559655596555963,
        "zoom": 0.86
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a carrier is booked on a McLeod load, finds it at FMCSA by its exact name and checks that it is allowed to operate, has active authority, has the required liability insurance on file and has no out-of-service order. A pass needs no one; a problem, or a carrier FMCSA can't match by name, goes to dispatch in Slack before the rate con goes out.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a carrier is booked on a McLeod load, looks it up at FMCSA and checks operating status, authority, insurance on file and out-of-service orders. A pass needs no one; any problem goes to dispatch in Slack before the rate con goes out.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 188,
            "y": 219
          }
        },
        "flowElementId": "C73B9145-BE94-40CD-B630-3FE1A6F7255E",
        "groupId": null,
        "id": "18451AFB-CE6B-42BC-B967-2F10C8E32524",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "e078b022-92d9-45ee-b327-b2d7263c60b3",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Carrier check",
                      "subPathSegments": [
                        {
                          "key": "passes",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "BAA6B1D4-7360-471E-B0B7-2AE89F9D0D51"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "e078b022-92d9-45ee-b327-b2d7263c60b3"
            ]
          },
          "elseComponent": {
            "componentId": "92C20DE5-06C0-446C-8655-B522A27A7ABF",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "pass",
          "storeResult": false,
          "thenComponent": null
        },
        "name": "Carrier passes?",
        "nextElementIds": [
          "92C20DE5-06C0-446C-8655-B522A27A7ABF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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 to check it by MC number Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 938,
            "y": 340
          }
        },
        "flowElementId": "AFDEC6A1-82BF-44FD-8ABA-D59D4E3C5C91",
        "groupId": null,
        "id": "32250985-D048-4E3B-B481-8CF79482AD45",
        "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": "*Check "
                  },
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "carrier",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " at FMCSA before the rate con goes out*\nLoad "
                  },
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", PRO "
                  },
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", carrier rep "
                  },
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "dispatcher",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "why",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " Look the carrier up by its MC number in SAFER before you send the rate con.\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "candidates",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
                  }
                ],
                "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": "BASIC",
                "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": "BASIC",
                "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": "Dispatch check request",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask dispatch to check it by MC number",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns the out-of-service orders FMCSA holds for the carrier, each with its date and reason. An empty list means none are on record.",
          "elementId": "EXTENSION:::SHARED:::default:::fmcsa:::getCarrierOutOfServiceOrders",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check out-of-service orders Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fmcsa:::getCarrierOutOfServiceOrders",
          "legacyElementId": null,
          "methodName": "getCarrierOutOfServiceOrders",
          "position": {
            "x": 974,
            "y": 210
          }
        },
        "flowElementId": "06ECA84B-3BC4-4252-9AEF-9243EE716E5B",
        "groupId": null,
        "id": "0ED79723-1D79-4331-96B6-9681513EDBD6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "dotNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "dotNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
                  }
                ],
                "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": "getCarrierOutOfServiceOrders",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "OOS orders",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fmcsa",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check out-of-service orders",
        "nextElementIds": [
          "BAA6B1D4-7360-471E-B0B7-2AE89F9D0D51"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the name ready for FMCSA Result"
          },
          "position": {
            "x": 566,
            "y": 49
          }
        },
        "flowElementId": "224059E0-5BC4-4228-B3EE-F43DA1E9FF72",
        "groupId": null,
        "id": "9D582A4C-1D3D-46DD-A25E-0C4A749E599A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "carrier",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const clean = String(name || '').replace(/&/g, ' and ').replace(/[^A-Za-z0-9 ]/g, ' ')\n  .replace(/\\b(llc|l l c|inc|incorporated|corp|corporation|co|company|ltd|lp|llp|pllc)\\b/gi, ' ')\n  .replace(/\\s+/g, ' ').trim();\nreturn { searchName: clean || String(name || '') };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Carrier name",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Get the name ready for FMCSA",
        "nextElementIds": [
          "C78F23D5-C5A4-44AD-B135-66F69F52DDC0"
        ],
        "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": "Warn dispatch before the rate con goes out Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 110,
            "y": 510
          }
        },
        "flowElementId": "18C4D6D0-F977-4124-9365-57B7306E5BA6",
        "groupId": null,
        "id": "92C20DE5-06C0-446C-8655-B522A27A7ABF",
        "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": "Carrier check",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "BAA6B1D4-7360-471E-B0B7-2AE89F9D0D51"
                  }
                ],
                "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": "BASIC",
                "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": "BASIC",
                "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": "Dispatch warning",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Warn dispatch before the rate con goes out",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Searches FMCSA for carriers whose legal or DBA name matches. Returns each match flattened to one level, with the same fields and true or false flags as Get Carrier by DOT Number. FMCSA returns at most 50 carriers per call; use Start and Size to read further.",
          "elementId": "EXTENSION:::SHARED:::default:::fmcsa:::searchCarriersByName",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the carrier at FMCSA Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fmcsa:::searchCarriersByName",
          "legacyElementId": null,
          "methodName": "searchCarriersByName",
          "position": {
            "x": 984,
            "y": 40
          }
        },
        "flowElementId": "15DBC1B4-CF60-4153-8DE1-D70C17CBA0CA",
        "groupId": null,
        "id": "C78F23D5-C5A4-44AD-B135-66F69F52DDC0",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier name",
                    "subPathSegments": [
                      {
                        "key": "searchName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9D582A4C-1D3D-46DD-A25E-0C4A749E599A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "start",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "size",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 50
                  }
                ],
                "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": "searchCarriersByName",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "FMCSA matches",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fmcsa",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the carrier at FMCSA",
        "nextElementIds": [
          "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1365,
            "y": 219
          }
        },
        "flowElementId": "CB489EA6-2B16-4E2E-8420-0404142826B3",
        "groupId": null,
        "id": "668C7EBC-AE04-4B20-9899-305ECD716834",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "78a8d0b7-aca1-48af-afe3-fb45fbff87c0",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Match",
                      "subPathSegments": [
                        {
                          "key": "identified",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "78a8d0b7-aca1-48af-afe3-fb45fbff87c0"
            ]
          },
          "elseComponent": {
            "componentId": "32250985-D048-4E3B-B481-8CF79482AD45",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "one",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0ED79723-1D79-4331-96B6-9681513EDBD6",
            "componentType": "ELEMENT"
          }
        },
        "name": "One FMCSA carrier by that name?",
        "nextElementIds": [
          "32250985-D048-4E3B-B481-8CF79482AD45",
          "0ED79723-1D79-4331-96B6-9681513EDBD6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Fires when a carrier is booked on a brokerage movement (PowerBroker), or the movement's carrier is replaced, with the movement, its carrier and its load IDs. McLeod cannot register webhooks, so this polls the movements changed since the last check (it needs table auditing on movements). It starts from the Available and In Progress brokerage movements (up to 2,000); movements created after that are watched from the start.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::onCarrierAssigned",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::onCarrierAssigned",
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::onCarrierAssigned",
          "legacyElementId": null,
          "methodName": "onCarrierAssigned",
          "position": {
            "x": 170,
            "y": 40
          }
        },
        "flowElementId": "C303C64B-D620-4EA4-93D3-CF1086A71173",
        "groupId": null,
        "id": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onCarrierAssigned",
          "frequency": {
            "repeat": {
              "every": 120
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Booking",
          "serviceId": "mcleod-loadmaster",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "Carrier booked in McLeod",
        "nextElementIds": [
          "9D582A4C-1D3D-46DD-A25E-0C4A749E599A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the exact match Result"
          },
          "position": {
            "x": 1409,
            "y": 49
          }
        },
        "flowElementId": "2117FBF7-FAB2-47AA-9696-38D42AA30C43",
        "groupId": null,
        "id": "FC4FAD03-836E-4AAB-A826-490AA238B7DC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "carriers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "FMCSA matches",
                    "subPathSegments": [
                      {
                        "key": "carriers",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C78F23D5-C5A4-44AD-B135-66F69F52DDC0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "carrier",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const norm = s => String(s || '').toUpperCase().replace(/&/g, ' AND ').replace(/[^A-Z0-9 ]/g, ' ')\n  .replace(/\\b(LLC|L L C|INC|INCORPORATED|CORP|CORPORATION|CO|COMPANY|LTD|LP|LLP|PLLC|THE)\\b/g, ' ')\n  .replace(/\\s+/g, ' ').trim();\nconst list = Array.isArray(carriers) ? carriers : [];\nconst key = norm(name);\nconst byDot = {};\nlist.filter(c => key && [c.legalName, c.dbaName].map(norm).includes(key)).forEach(c => { byDot[String(c.dotNumber)] = c; });\nconst exact = Object.values(byDot);\nconst identified = exact.length === 1;\nconst rec = identified ? exact[0] : null;\nconst describe = c => c.legalName + (c.dbaName ? ' (DBA ' + c.dbaName + ')' : '') + ', USDOT ' + c.dotNumber + (c.phyCity ? ', ' + c.phyCity + ', ' + (c.phyState || '') : '');\nconst shown = (exact.length ? exact : list).slice(0, 5).map(c => '- ' + describe(c)).join('\\n');\nconst why = exact.length > 1\n  ? 'FMCSA has ' + exact.length + ' carriers with that exact name, so the flow could not tell which one this is.'\n  : 'FMCSA has no carrier with that exact legal or DBA name.';\nreturn {\n  identified,\n  dotNumber: rec ? Number(rec.dotNumber) : 0,\n  record: rec || {},\n  why,\n  candidates: shown,\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Match",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the exact match",
        "nextElementIds": [
          "668C7EBC-AE04-4B20-9899-305ECD716834"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check authority and insurance Result"
          },
          "position": {
            "x": 568,
            "y": 219
          }
        },
        "flowElementId": "6EEDA2CE-4172-4D6C-B85B-0FEC58637963",
        "groupId": null,
        "id": "BAA6B1D4-7360-471E-B0B7-2AE89F9D0D51",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "FC4FAD03-836E-4AAB-A826-490AA238B7DC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "oos",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "OOS orders",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "0ED79723-1D79-4331-96B6-9681513EDBD6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pro",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rep",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "dispatcher",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "carrierName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Booking",
                    "subPathSegments": [
                      {
                        "key": "carrier",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const c = match && match.record ? match.record : {};\nconst orders = oos && Array.isArray(oos.outOfServiceOrders) ? oos.outOfServiceOrders : [];\nconst money = n => '$' + Number(n || 0).toLocaleString('en-US');\nconst problems = [];\nif (c.isAllowedToOperate !== true) problems.push('FMCSA does not show the carrier as allowed to operate.');\nif (c.hasActiveCommonAuthority !== true && c.hasActiveContractAuthority !== true) problems.push('FMCSA shows no active common or contract authority.');\nif (c.isBipdInsuranceRequired === true && Number(c.bipdInsuranceOnFileUsd || 0) < Number(c.bipdRequiredAmountUsd || 0)) {\n  problems.push(Number(c.bipdInsuranceOnFileUsd || 0) === 0\n    ? 'FMCSA has no liability insurance on file (' + money(c.bipdRequiredAmountUsd) + ' required).'\n    : 'Liability insurance on file at FMCSA is ' + money(c.bipdInsuranceOnFileUsd) + ', below the ' + money(c.bipdRequiredAmountUsd) + ' required.');\n}\norders.forEach(o => problems.push('Out-of-service order dated ' + o.oosDate + ': ' + (o.oosReasonDescription || o.oosReason || 'no reason given') + '.'));\nconst loadLine = 'Load ' + orderId + (pro ? ', PRO ' + pro : '') + (rep ? ', carrier rep ' + rep : '');\nconst text = '*Check ' + (carrierName || c.legalName) + ' before the rate con goes out*\\n' + loadLine\n  + '\\nFMCSA: ' + c.legalName + ', USDOT ' + c.dotNumber + '\\n' + problems.map(p => '- ' + p).join('\\n')\n  + '\\nThe carrier is booked on the load in McLeod. Hold the rate con until dispatch has looked at this.';\nreturn { passes: problems.length === 0, problems, text };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Carrier check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check authority and insurance",
        "nextElementIds": [
          "18451AFB-CE6B-42BC-B967-2F10C8E32524"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "E0498F17-6EE4-4436-9C1C-5DFC6CD967FA",
    "groups": [],
    "id": "9CA2B121-F543-4B71-BC0E-E2E92B10515F",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [],
      "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-29T02:51:39.638Z"
}
