{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "C6ECA9E6-AD6F-4C36-8DBF-FAB2F14E72E8",
    "name": "Front: carrier emails tagged and assigned"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Sorts each new unassigned email in the shared ops inbox in Front (carrier invoice, POD, rate con, track and trace), looks the load up in McLeod, tags and assigns the conversation, and posts the load details as a comment.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Sorts each new unassigned email in the shared ops inbox in Front (carrier invoice, POD, rate con, track and trace), looks the load up in McLeod, tags and assigns the conversation, and posts the load details as a comment.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Retrieves a single conversation by ID with full metadata: subject, status, recipient, assignee, tags, links, custom fields, and counts.",
          "elementId": "EXTENSION:::SHARED:::default:::front-service:::getConversation",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the conversation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::getConversation",
          "legacyElementId": "JS###v1###FrontService###getConversation",
          "methodName": "getConversation",
          "position": {
            "x": 507,
            "y": 40
          }
        },
        "flowElementId": "BED9B151-A9B4-4986-ABB1-A79000C50C51",
        "groupId": null,
        "id": "3D9E49C2-F09C-493A-9848-44A810277F74",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
                  }
                ],
                "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": "getConversation",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Conversation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "front-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the conversation",
        "nextElementIds": [
          "3F18B481-2622-43A7-B27C-5756B964509A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the tag and the teammate Result"
          },
          "position": {
            "x": 474,
            "y": 219
          }
        },
        "flowElementId": "F172406F-69E6-4B0D-92AC-9A11F5939A14",
        "groupId": null,
        "id": "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Pick the tag and the teammate', Error: The placeholder \"AP teammate email\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "kind",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "kind",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "summary",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bolNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "bolNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "existingTags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Conversation",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3D9E49C2-F09C-493A-9848-44A810277F74"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "found",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "found",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AD92EDE6-0DDC-49F7-9DAD-D77D2DFD2416"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AD92EDE6-0DDC-49F7-9DAD-D77D2DFD2416"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "apTeammate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "AP teammate email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "AP teammate email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billingTeammate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Billing teammate email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Billing teammate email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadDeskTeammate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Load desk teammate email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Load desk teammate email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "trackingTeammate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Track and trace teammate email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Track and trace teammate email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const routes = {\n  carrier_invoice: { tag: 'Carrier invoice', teammate: apTeammate, team: 'AP', label: 'a carrier invoice' },\n  pod: { tag: 'POD', teammate: billingTeammate, team: 'billing', label: 'a POD' },\n  rate_con: { tag: 'Rate con', teammate: loadDeskTeammate, team: 'the load desk', label: 'a rate con' },\n  status_update: { tag: 'Track and trace', teammate: trackingTeammate, team: 'track and trace', label: 'a status update or a load status question' },\n};\nconst route = routes[kind] || { tag: 'Needs a look', teammate: '', team: '', label: 'something other than carrier paperwork' };\nconst current = Array.isArray(existingTags) ? existingTags.map(t => t && t.name).filter(Boolean) : [];\nconst tags = [...new Set([...current, route.tag])];\nconst email = String(route.teammate || '').trim();\n\nconst lines = [];\nlines.push(`Sorted as ${route.label}${route.team ? ` and assigned to ${route.team}` : ', left unassigned'}. ${summary || ''}`.trim());\nconst numbers = [loadNumber && `load ${loadNumber}`, proNumber && `PRO ${proNumber}`, bolNumber && `BOL ${bolNumber}`].filter(Boolean);\nif (!numbers.length) {\n  lines.push('The email gives no load, PRO or BOL number, so nothing was looked up in McLeod.');\n} else if (!found || !load) {\n  lines.push(`No McLeod load matches ${numbers.join(', ')}. Check the number with the sender.`);\n} else {\n  const stops = Array.isArray(load.stops) ? load.stops : [];\n  const first = stops[0];\n  const last = stops[stops.length - 1];\n  const place = s => s ? `${s.locationName || ''} ${s.city || ''}, ${s.state || ''}`.trim() : '';\n  const customer = load.customer ? (load.customer.name || load.customer.id) : 'the customer';\n  lines.push(`McLeod order ${load.orderId} for ${customer}: ${load.statusDescription || load.status}.`);\n  if (first && last) lines.push(`${place(first)} to ${place(last)}${last.actualArrival ? `, arrived ${last.actualArrival}` : ''}.`);\n  if (load.carrier && load.carrier.name) lines.push(`Carrier: ${load.carrier.name}${load.carrierPay && load.carrierPay.totalPay != null ? `, carrier pay ${load.carrierPay.totalPay} ${load.carrierPay.currency || ''}`.trimEnd() : ''}.`);\n  lines.push(`Ready to bill: ${load.readyToBill === 'Y' ? 'yes' : 'no'}.`);\n}\nreturn { tags, assigneeId: email ? `alt:email:${email}` : '', comment: lines.join('\\n') };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Routing",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the tag and the teammate",
        "nextElementIds": [
          "85EF8F13-2E8E-42A6-9568-3D35D49F22A4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates a conversation's status, assignee, inbox, or tags. Only the fields you provide are changed; leave others empty to keep them unchanged.",
          "elementId": "EXTENSION:::SHARED:::default:::front-service:::updateConversation",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tag and assign it Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::updateConversation",
          "legacyElementId": "JS###v1###FrontService###updateConversation",
          "methodName": "updateConversation",
          "position": {
            "x": 142,
            "y": 210
          }
        },
        "flowElementId": "A8B982E0-B45E-4DC8-BCBF-A9055C1377F1",
        "groupId": null,
        "id": "85EF8F13-2E8E-42A6-9568-3D35D49F22A4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assigneeId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "assigneeId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tagIds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "inboxId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "createMissingTags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "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": "updateConversation",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Assigned",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "front-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tag and assign it",
        "nextElementIds": [
          "3BA7CAF5-A1FB-45CD-8760-7B0D886ED23D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1166,
            "y": 219
          }
        },
        "flowElementId": "FFF620C6-7E8C-4321-8426-CEC3E4A51E26",
        "groupId": null,
        "id": "71BB50E1-AF2E-44A1-8AF6-21ABB96D1333",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "10c785ff-dc9d-4aa4-8038-1767a5c2906d",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Sorting",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "hasNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "10c785ff-dc9d-4aa4-8038-1767a5c2906d"
            ]
          },
          "elseComponent": {
            "componentId": "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load number on it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "AD92EDE6-0DDC-49F7-9DAD-D77D2DFD2416",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load number on it?",
        "nextElementIds": [
          "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078",
          "AD92EDE6-0DDC-49F7-9DAD-D77D2DFD2416"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a new inbound message arrives in Front. Uses Front Query Language to find conversations updated since the last poll, then walks up to 10 of them to find new inbound messages. If more than 10 conversations receive new inbound messages between polls, the 11th+ may be missed. Polling interval can be customized (minimum 30 seconds); for higher fidelity, use Front's native webhooks.",
          "elementId": "EXTENSION:::SHARED:::default:::front-service:::onNewInboundMessage",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::front-service:::onNewInboundMessage",
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::onNewInboundMessage",
          "legacyElementId": "JS###v1###FrontService###onNewInboundMessage",
          "methodName": "onNewInboundMessage",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "B31A1331-36DF-489B-8395-9542B2F9B5C9",
        "groupId": null,
        "id": "0D87E80B-BA18-445D-ABE1-79985AA47A92",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewInboundMessage",
          "frequency": {
            "repeat": {
              "every": 120
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Inbound email",
          "serviceId": "front-service",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New email in the shared inbox",
        "nextElementIds": [
          "3D9E49C2-F09C-493A-9848-44A810277F74"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 855,
            "y": 49
          }
        },
        "flowElementId": "B218D08A-964B-4A13-BF0F-F1CA3D18072C",
        "groupId": null,
        "id": "3F18B481-2622-43A7-B27C-5756B964509A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "114eaf24-5ac7-4965-a15a-4a7dcf22b272",
                "nestedOperation": null,
                "operation": "isEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Conversation",
                      "subPathSegments": [
                        {
                          "key": "assignee",
                          "optional": false
                        },
                        {
                          "key": "id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3D9E49C2-F09C-493A-9848-44A810277F74"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              },
              {
                "id": "c767ecd1-5355-4711-9f56-eb47d45d946f",
                "nestedOperation": null,
                "operation": "isNull",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Conversation",
                      "subPathSegments": [
                        {
                          "key": "assignee",
                          "optional": false
                        },
                        {
                          "key": "id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3D9E49C2-F09C-493A-9848-44A810277F74"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "114eaf24-5ac7-4965-a15a-4a7dcf22b272",
              "OR",
              "c767ecd1-5355-4711-9f56-eb47d45d946f"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Not assigned",
          "storeResult": false,
          "thenComponent": {
            "componentId": "86A679FD-4336-410A-934A-DE35BED511C1",
            "componentType": "ELEMENT"
          }
        },
        "name": "Not assigned yet?",
        "nextElementIds": [
          "86A679FD-4336-410A-934A-DE35BED511C1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Sort the email Result"
          },
          "tools": {},
          "position": {
            "x": 1166,
            "y": 49
          }
        },
        "flowElementId": "B2ED6A40-5714-4AA5-B901-6EBEC2B75FA6",
        "groupId": null,
        "id": "86A679FD-4336-410A-934A-DE35BED511C1",
        "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": [],
          "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": "Sorting",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You sort emails that arrive in a freight brokerage's shared operations inbox in Front. Reply with JSON only, with these fields:\nkind: one of carrier_invoice (a carrier billing for a load, including accessorial charges such as detention, lumper, layover or TONU), pod (a proof of delivery or delivery receipt), rate_con (a rate confirmation, signed or with changes asked for), status_update (a carrier or driver reporting a pickup, a delivery, an ETA, a delay or a check call, or anyone asking where a load is), other (anything else)\nloadNumber: the load or order number, or empty text\nproNumber: the PRO number, or empty text\nbolNumber: the bill of lading number, or empty text\nhasNumber: true if any of the three numbers above is filled in, otherwise false\nlookup: an object with loadNumber, proNumber and bolNumber in which only one is filled: the load number if the email has one, otherwise the PRO number, otherwise the BOL number; the other two are empty text\ncarrier: the carrier's name if the email gives it, or empty text\nsummary: one plain sentence saying what the sender wants, for the teammate who picks this up"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From: "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "senderEmail",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nAttachments: "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "attachments",
                    "optional": false
                  },
                  {
                    "index": 0,
                    "last": false
                  },
                  {
                    "key": "filename",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "attachments",
                    "optional": false
                  },
                  {
                    "index": 1,
                    "last": false
                  },
                  {
                    "key": "filename",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "attachments",
                    "optional": false
                  },
                  {
                    "index": 2,
                    "last": false
                  },
                  {
                    "key": "filename",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Sort the email",
        "nextElementIds": [
          "71BB50E1-AF2E-44A1-8AF6-21ABB96D1333"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Posts an internal comment on a conversation. Comments are team-only notes (not visible to the customer) and support @-mentions of teammates by ID.",
          "elementId": "EXTENSION:::SHARED:::default:::front-service:::addComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Post the load details Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::addComment",
          "legacyElementId": "JS###v1###FrontService###addComment",
          "methodName": "addComment",
          "position": {
            "x": 142,
            "y": 380
          }
        },
        "flowElementId": "D06A834E-D32B-42FA-AD82-9D6A0D96EABB",
        "groupId": null,
        "id": "3BA7CAF5-A1FB-45CD-8760-7B0D886ED23D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "0D87E80B-BA18-445D-ABE1-79985AA47A92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "comment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "authorId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Load details comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "front-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the load details",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a load by its order number, PRO number, bill of lading, consignee reference or a stop reference number (McLeod order tracking search) and returns the first match in full, as Get Load does, with every match listed. Returns found: false instead of failing when nothing matches.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 843,
            "y": 210
          }
        },
        "flowElementId": "521AA38E-3947-4FD7-8F73-A60A6718A054",
        "groupId": null,
        "id": "AD92EDE6-0DDC-49F7-9DAD-D77D2DFD2416",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sorting",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "bolNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "86A679FD-4336-410A-934A-DE35BED511C1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "McLeod load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "B4EC1CFE-B4A5-4BD6-BEB0-F6451FF83078"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "0D87E80B-BA18-445D-ABE1-79985AA47A92",
    "groups": [],
    "id": "8584334E-89A5-45B9-80DA-900920DD09AB",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Block 'Pick the tag and the teammate' has an invalid configuration. Code Argument 'apTeammate' has invalid value. Placeholder Data 'AP teammate email': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the block Sort the email.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The Front login email of the person who takes carrier invoices.",
          "error": "Placeholder Data 'AP teammate email': value is required",
          "name": "AP teammate email",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The Front login email of the person who takes PODs.",
          "error": null,
          "name": "Billing teammate email",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The Front login email of the person who takes rate cons.",
          "error": null,
          "name": "Load desk teammate email",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The Front login email of the person who takes status updates and where's-my-load emails.",
          "error": null,
          "name": "Track and trace teammate 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-26T09:37:21.370Z"
}
