{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "4A3ADDC4-E2A7-4186-85DB-809364BF011B",
    "name": "Front: load status replies drafted from McLeod"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a customer asks where a load is in the customer inbox in Front, finds the load in McLeod, drafts a reply from its stops and status, and posts the draft as a comment for a teammate to check and send.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a customer asks where a load is in the customer inbox in Front, finds the load in McLeod, drafts a reply from its stops and status, and posts the draft as a comment for a teammate to check and send.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1212,
            "y": 219
          }
        },
        "flowElementId": "D9BBB66A-C968-472F-9523-2A08D4960D83",
        "groupId": null,
        "id": "37E141C9-9F56-4EFA-AF7B-FD624B6BE655",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "7dc73de5-07eb-48cf-b208-90965e964834",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "McLeod load",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DA3153DE-681A-4B82-8CAE-27210CE45DC7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "7dc73de5-07eb-48cf-b208-90965e964834"
            ]
          },
          "elseComponent": {
            "componentId": "A823E9EE-5891-4EBB-AAF0-79C75BE10F1C",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "8E559808-ECCE-4131-9427-CFD404EC12A1",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load found?",
        "nextElementIds": [
          "8E559808-ECCE-4131-9427-CFD404EC12A1",
          "A823E9EE-5891-4EBB-AAF0-79C75BE10F1C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": 149,
            "y": 210
          }
        },
        "flowElementId": "74E8CE9E-F85B-46D4-AB3A-391C543836BD",
        "groupId": null,
        "id": "8E9E95EE-B2FE-4DCE-B905-79DCAE3FD09C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  }
                ],
                "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": [
          "451256B1-F251-425E-8883-8BE49320F5C0"
        ],
        "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 draft for a teammate Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::addComment",
          "legacyElementId": "JS###v1###FrontService###addComment",
          "methodName": "addComment",
          "position": {
            "x": 815,
            "y": 510
          }
        },
        "flowElementId": "284335C5-059D-4888-9375-BC19788D487B",
        "groupId": null,
        "id": "AC3FA4A2-25AD-4674-BB0D-C67B654E0052",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Team note",
                    "subPathSegments": [
                      {
                        "key": "comment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "451256B1-F251-425E-8883-8BE49320F5C0"
                  }
                ],
                "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": "Draft comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "front-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the draft for a teammate",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "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": "79B31212-0D4A-4027-A5AB-A08C5A9BE215",
        "groupId": null,
        "id": "89E7D89D-D480-471F-A013-B2C68B81EBCF",
        "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 customer inbox",
        "nextElementIds": [
          "96CDAF81-A1D7-43FF-89A6-1225376B423A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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": 1200,
            "y": 40
          }
        },
        "flowElementId": "0735B48A-5161-42E3-A591-625E5D9B5989",
        "groupId": null,
        "id": "DA3153DE-681A-4B82-8CAE-27210CE45DC7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "bolNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "reference",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  }
                ],
                "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": [
          "37E141C9-9F56-4EFA-AF7B-FD624B6BE655"
        ],
        "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 load facts Result"
          },
          "position": {
            "x": 846,
            "y": 219
          }
        },
        "flowElementId": "4EADF4C6-C138-4493-8E31-A60A5F09E49C",
        "groupId": null,
        "id": "8E559808-ECCE-4131-9427-CFD404EC12A1",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA3153DE-681A-4B82-8CAE-27210CE45DC7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const stops = Array.isArray(load.stops) ? load.stops : [];\nconst kind = { PU: 'Pickup', SO: 'Delivery' };\nconst lines = [\n  `Load ${load.orderId}, status ${load.statusDescription || load.status}.`,\n  load.billOfLading ? `BOL ${load.billOfLading}.` : null,\n  load.poNumber ? `PO ${load.poNumber}.` : null,\n  load.pieces ? `${load.pieces} pieces, ${load.weight || ''} ${load.weightUnit || ''}`.trim() + '.' : null,\n];\nfor (const s of stops) {\n  const label = kind[s.stopType] || s.stopTypeDescription || 'Stop';\n  const where = `${s.locationName || ''}, ${s.city || ''}, ${s.state || ''}`;\n  const window = s.scheduledArriveEarly ? ` Appointment ${s.scheduledArriveEarly}${s.scheduledArriveLate ? ` to ${s.scheduledArriveLate}` : ''}.` : '';\n  const actual = s.actualArrival ? ` Arrived ${s.actualArrival}.` : ' Not arrived yet.';\n  const left = s.actualDeparture ? ` Departed ${s.actualDeparture}.` : '';\n  lines.push(`${label} ${s.sequence}: ${where}.${window}${actual}${left}`);\n}\nreturn { text: lines.filter(Boolean).join('\\n'), customer: load.customer ? (load.customer.name || load.customer.id) : '', orderId: load.orderId };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Load facts",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the load facts",
        "nextElementIds": [
          "74BD2982-948D-4CE8-B9E8-8048591D2DC8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the question Result"
          },
          "tools": {},
          "position": {
            "x": 492,
            "y": 49
          }
        },
        "flowElementId": "DBD3BBEC-12F3-4EAA-8574-0A5FC6CD291A",
        "groupId": null,
        "id": "96CDAF81-A1D7-43FF-89A6-1225376B423A",
        "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": "Question",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read emails that shippers and customers send to a freight brokerage's customer inbox in Front. Reply with JSON only, with these fields:\nstatusQuestion: true if the sender asks where a load is, when it will pick up or deliver, whether it delivered, or for an update on it; otherwise false\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\nreference: the customer's PO, shipment ID or other reference number, or empty text\nnumbersGiven: the numbers above that the email gives, written as a short list such as load 0451873, PO 55120; or empty text\ncanLookUp: true if statusQuestion is true and at least one of the four numbers above is filled in, otherwise false\nlookup: an object with loadNumber, proNumber, bolNumber and reference in which only one is filled: the load number if the email has one, otherwise the PRO number, otherwise the BOL number, otherwise the reference; the others are empty text\nquestion: the sender's question in one plain sentence"
              }
            ],
            "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": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the question",
        "nextElementIds": [
          "55B011C0-318D-44FC-9DC3-646CD39F37F5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 792,
            "y": 49
          }
        },
        "flowElementId": "011E24D3-ED37-4F9E-90DA-0C0CCDEA13B2",
        "groupId": null,
        "id": "55B011C0-318D-44FC-9DC3-646CD39F37F5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "98694833-e3ce-4037-aaf2-39597eef765b",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Question",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "canLookUp",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "98694833-e3ce-4037-aaf2-39597eef765b"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Status question",
          "storeResult": false,
          "thenComponent": {
            "componentId": "DA3153DE-681A-4B82-8CAE-27210CE45DC7",
            "componentType": "ELEMENT"
          }
        },
        "name": "Status question with a load number?",
        "nextElementIds": [
          "DA3153DE-681A-4B82-8CAE-27210CE45DC7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": 492,
            "y": 510
          }
        },
        "flowElementId": "989E361F-204C-4235-AA18-6B760E8FD527",
        "groupId": null,
        "id": "4A655F69-1EBA-44ED-A045-68B66614407C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  }
                ],
                "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": "Team note",
                    "subPathSegments": [
                      {
                        "key": "assigneeId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "451256B1-F251-425E-8883-8BE49320F5C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tagIds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Team note",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "451256B1-F251-425E-8883-8BE49320F5C0"
                  }
                ],
                "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": [
          "AC3FA4A2-25AD-4674-BB0D-C67B654E0052"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the note for the team Result"
          },
          "position": {
            "x": 129,
            "y": 519
          }
        },
        "flowElementId": "1D58460A-10D3-4BB2-B598-AEF9435E8540",
        "groupId": null,
        "id": "451256B1-F251-425E-8883-8BE49320F5C0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the note for the team', Error: The placeholder \"Track and trace teammate email\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "existingTags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Conversation",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8E9E95EE-B2FE-4DCE-B905-79DCAE3FD09C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assignee",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Conversation",
                    "subPathSegments": [
                      {
                        "key": "assignee",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8E9E95EE-B2FE-4DCE-B905-79DCAE3FD09C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "defaultTeammate",
              "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
              }
            },
            {
              "name": "sender",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "senderEmail",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load facts",
                    "subPathSegments": [
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8E559808-ECCE-4131-9427-CFD404EC12A1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load facts",
                    "subPathSegments": [
                      {
                        "key": "customer",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8E559808-ECCE-4131-9427-CFD404EC12A1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "draft",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Draft",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "reply",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74BD2982-948D-4CE8-B9E8-8048591D2DC8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const current = Array.isArray(existingTags) ? existingTags.map(t => t && t.name).filter(Boolean) : [];\nconst tags = [...new Set([...current, 'Load status'])];\nconst email = String(defaultTeammate || '').trim();\nconst assigned = assignee && assignee.id;\nconst lines = [\n  `Draft reply to ${sender}, from McLeod order ${orderId}${customer ? ` for ${customer}` : ''}.`,\n  customer ? `Check that ${sender} works for ${customer} before you send. Then copy the draft into a reply, edit it as you like and send it.` : 'Copy the draft into a reply, edit it as you like and send it.',\n  '',\n  draft || '',\n];\nreturn { tags, assigneeId: assigned ? '' : (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": "Team note",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the note for the team",
        "nextElementIds": [
          "4A655F69-1EBA-44ED-A045-68B66614407C"
        ],
        "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": "Tell the team no load matched Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::front-service:::addComment",
          "legacyElementId": "JS###v1###FrontService###addComment",
          "methodName": "addComment",
          "position": {
            "x": 813,
            "y": 340
          }
        },
        "flowElementId": "36B1101C-19BE-4107-9447-F5C77784D86A",
        "groupId": null,
        "id": "A823E9EE-5891-4EBB-AAF0-79C75BE10F1C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "conversation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Load status question from "
                  },
                  {
                    "id": "RESULT",
                    "label": "Inbound email",
                    "subPathSegments": [
                      {
                        "key": "senderEmail",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ": "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "question",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "No McLeod load matches "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "numbersGiven",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". Check the number with the sender and answer by hand."
                  }
                ],
                "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": "No match comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "front-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the team no load matched",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Draft the reply Result"
          },
          "tools": {},
          "position": {
            "x": 492,
            "y": 219
          }
        },
        "flowElementId": "BB881B31-6653-44AF-A73C-9858879BC8AE",
        "groupId": null,
        "id": "74BD2982-948D-4CE8-B9E8-8048591D2DC8",
        "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": "Draft",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You draft replies for a freight brokerage's customer service team. A teammate reads every draft before anything is sent. Write a short, friendly, plain reply to the customer's load status question, using only the load facts given. Rules:\n- Give the last thing that happened (picked up, delivered, arrived, departed) with its date and time, and the next appointment if the load has not delivered.\n- Never mention the carrier's name, the carrier's pay, rates or charges.\n- Never guess an ETA or a time the facts don't give. If the facts don't answer the question, say the team is checking with the driver and will follow up.\n- Write times the way a person would (Nov 4 at 1:22 pm), in the stop's local time as given.\n- No sign-off name.\nReply with JSON only, with this field:\nreply: the reply text, in plain text with line breaks"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Customer email from "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "senderEmail",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Inbound email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89E7D89D-D480-471F-A013-B2C68B81EBCF"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nTheir question: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Question",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "question",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "96CDAF81-A1D7-43FF-89A6-1225376B423A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nLoad facts from McLeod:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Load facts",
                "subPathSegments": [
                  {
                    "key": "text",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "8E559808-ECCE-4131-9427-CFD404EC12A1"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Draft the reply",
        "nextElementIds": [
          "8E9E95EE-B2FE-4DCE-B905-79DCAE3FD09C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "89E7D89D-D480-471F-A013-B2C68B81EBCF",
    "groups": [],
    "id": "8B3FCA9F-B6B1-47E8-84F0-F913770ED4A0",
    "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 'Write the note for the team' has an invalid configuration. Code Argument 'defaultTeammate' has invalid value. Placeholder Data 'Track and trace teammate email': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by Read the question and Draft the reply.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The Front login email of the person who answers load status questions when the conversation has no assignee yet.",
          "error": "Placeholder Data 'Track and trace teammate email': value is required",
          "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:25.939Z"
}
