{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "A39B2467-06BF-4B40-AEB1-2D5C0669BEC8",
    "name": "ShipBob: inbound receipts checked against the ASN"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -40.16657990629881,
        "y": 10.848516397709528,
        "zoom": 0.73
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When ShipBob completes a receiving order, checks what was received and stowed against the quantities expected on the ASN. A receipt that matches needs nothing. Short, over or unstowed lines go to the receiving lead in Slack, who picks a claim to the delivering carrier from McLeod, a notice to the client, or accepting the count.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Every morning, checks the ShipBob receiving orders closed since the last run against the quantities expected on the ASN. Matching receipts are marked checked. Short, over or unstowed lines go to the receiving lead in Slack, who picks a claim to the delivering carrier from McLeod, a notice to the client, or accepting the count.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Compare received with the ASN Result"
          },
          "position": {
            "x": 858,
            "y": 49
          }
        },
        "flowElementId": "859D1F6A-3EB6-45CA-AB61-DA95F807586E",
        "groupId": null,
        "id": "87727B0C-5921-4483-B0F1-AF3240638E15",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "wro",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Receipt",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "6EF33615-B41F-47E9-9386-30C3939305BB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const w = wro || {};\nconst lines = (w.inventory_quantities || []).map((q) => {\n  const expected = Number(q.expected_quantity) || 0;\n  const received = Number(q.received_quantity) || 0;\n  const stowed = Number(q.stowed_quantity) || 0;\n  return {\n    sku: q.sku,\n    expected,\n    received,\n    stowed,\n    short: Math.max(expected - received, 0),\n    over: Math.max(received - expected, 0),\n    notStowed: Math.max(received - stowed, 0),\n  };\n});\nconst off = lines.filter((l) => l.short || l.over || l.notStowed);\nreturn {\n  id: w.id,\n  poNumber: w.purchase_order_number || '',\n  status: w.status || '',\n  fulfillmentCenter: (w.fulfillment_center && w.fulfillment_center.name) || '',\n  expectedArrival: (w.expected_arrival_date || '').slice(0, 10),\n  lines: off,\n  offCount: off.length,\n  unitsShort: off.reduce((s, l) => s + l.short, 0),\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Receipt check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Compare received with the ASN",
        "nextElementIds": [
          "383956F4-993F-44C8-B01C-3917D27C7009"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1300,
            "y": 49
          }
        },
        "flowElementId": "78A369E6-4A1E-45B1-94A4-277F9C2BB5E0",
        "groupId": null,
        "id": "383956F4-993F-44C8-B01C-3917D27C7009",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "4e61dbe4-43a5-4862-a521-74fd68c573ca",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Receipt check",
                      "subPathSegments": [
                        {
                          "key": "offCount",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "87727B0C-5921-4483-B0F1-AF3240638E15"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "INT",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 0
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "4e61dbe4-43a5-4862-a521-74fd68c573ca"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Any clean",
          "storeResult": false,
          "thenComponent": {
            "componentId": "4B98EB3F-36BC-4C28-BFEB-1E02E5F2C061",
            "componentType": "ELEMENT"
          }
        },
        "name": "Any line off the ASN?",
        "nextElementIds": [
          "4B98EB3F-36BC-4C28-BFEB-1E02E5F2C061"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves all boxes and their contents for a specific Warehouse Receiving Order. Each box includes its status, tracking number, arrival/receiving dates, and a detailed list of items with expected, received, and stowed quantities.",
          "elementId": "EXTENSION:::SHARED:::default:::shipbob:::getWROBoxes",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the receipt's boxes Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shipbob:::getWROBoxes",
          "legacyElementId": "JS###v1###ShipBobService###getWROBoxes",
          "methodName": "getWROBoxes",
          "position": {
            "x": 1700,
            "y": 40
          }
        },
        "flowElementId": "38A79D42-260C-4AAF-887B-60075B384ED1",
        "groupId": null,
        "id": "4B98EB3F-36BC-4C28-BFEB-1E02E5F2C061",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "wroId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Receipt",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6EF33615-B41F-47E9-9386-30C3939305BB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Get the receipt's boxes', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getWROBoxes",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "WRO boxes",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shipbob",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the receipt's boxes",
        "nextElementIds": [
          "B2162C61-03D7-4E04-A30A-EABD1881BFBC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Email the notice to the client Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 1275,
            "y": 770
          }
        },
        "flowElementId": "A2CD2E6E-922D-4409-A295-9FAC4FBBB43D",
        "groupId": null,
        "id": "32D34D83-7D54-4A79-896F-78E9B417AC72",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Client email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Client email"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Client notice",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "26FFEF8C-05BB-471F-863F-1E93EA1D8E83"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Client notice",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "body",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "26FFEF8C-05BB-471F-863F-1E93EA1D8E83"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Email the notice to the client', Error: The placeholder \"Client email\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Notice email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Email the notice to the client",
        "nextElementIds": [
          "6CDC36E1-67A3-4CF9-9577-6087478AD011"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a Warehouse Receiving Order is completed at a ShipBob fulfillment center (the wro.completed event), after its inventory is received and stowed. Use it to reconcile received quantities, for example with Get WRO and Get WRO Boxes, instead of polling for completed receiving orders.",
          "elementId": "EXTENSION:::SHARED:::default:::shipbob:::onWROCompleted",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-trigger",
          "newElementId": "EXTENSION:::SHARED:::default:::shipbob:::onWROCompleted",
          "legacyElementId": "JS###v1###ShipBobService###onWROCompleted",
          "methodName": "onWROCompleted",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "CECD69CF-DF25-4684-AA24-D68C675FAC9B",
        "groupId": null,
        "id": "FC6BF8BC-EBDB-41AF-9B60-D5118E5A8F2D",
        "metaInfo": {
          "callbackUrl": null,
          "clientValidationState": {
            "errorMessage": "Block: 'Receiving order completed', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "eventName": "onWROCompleted",
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Completed WRO",
          "scope": "SINGLE_APP",
          "serviceId": "shipbob",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "REALTIME",
          "type": "CUSTOM"
        },
        "name": "Receiving order completed",
        "nextElementIds": [
          "6EF33615-B41F-47E9-9386-30C3939305BB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 454,
            "y": 219
          }
        },
        "flowElementId": "334AC254-6082-4737-919F-277C515DF3B8",
        "groupId": null,
        "id": "C1D3C3F4-31D2-4A7F-B56E-9D26B301DEDF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Receiving decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the receiving lead's answer",
        "nextElementIds": [
          "E37BC7DA-5213-4754-B75F-877BB99B5DF2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "No load to match Result"
          },
          "position": {
            "x": 1302,
            "y": 349
          }
        },
        "flowElementId": "3D29A791-273B-45AC-84C7-74F3F2297644",
        "groupId": null,
        "id": "9B234C41-A267-4B42-9A3E-0797B7687A64",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load lookup error",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "No load to match",
        "nextElementIds": [
          "90DE1D82-E4EA-4549-B391-42364D0E7763"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the receiving lead Result"
          },
          "position": {
            "x": 1235,
            "y": 219
          }
        },
        "flowElementId": "04598F1E-3C60-43D0-A0BC-147155125F57",
        "groupId": null,
        "id": "90DE1D82-E4EA-4549-B391-42364D0E7763",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the question for the receiving lead', Error: The placeholder \"Answer link\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "wro",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Receipt check",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "87727B0C-5921-4483-B0F1-AF3240638E15"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "boxes",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "WRO boxes",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "4B98EB3F-36BC-4C28-BFEB-1E02E5F2C061"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Inbound load",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "B2162C61-03D7-4E04-A30A-EABD1881BFBC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (d) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${d}`;\nconst w = wro || {};\nconst boxList = Array.isArray(boxes) ? boxes : [];\nconst tracking = boxList.map((b) => b.tracking_number).filter(Boolean);\nconst l = load && load.found === true && load.load ? load.load : null;\nlet carrierName = '';\nlet carrierEmail = '';\nlet pro = tracking[0] || '';\nif (l) {\n  const moves = l.movements || [];\n  const mv = moves.find((m) => tracking.includes(m.proNumber)) || moves[0] || {};\n  carrierName = (mv.carrier && mv.carrier.name) || (l.carrier && l.carrier.name) || '';\n  carrierEmail = mv.carrierEmail || '';\n  pro = mv.proNumber || pro;\n}\nconst lastStop = l ? (l.stops || []).slice(-1)[0] || {} : {};\nconst deliveredAt = (lastStop.actualArrival || '').slice(0, 16).replace('T', ' ');\nconst lineText = (w.lines || []).map((x) => {\n  const parts = [];\n  if (x.short) parts.push(`${x.short} short`);\n  if (x.over) parts.push(`${x.over} over`);\n  if (x.notStowed) parts.push(`${x.notStowed} received but not stowed`);\n  return `${x.sku}: expected ${x.expected}, received ${x.received}, stowed ${x.stowed} (${parts.join(', ')})`;\n});\nconst loadLine = l\n  ? `Inbound load ${l.orderId} in McLeod, carrier ${carrierName || 'not named'}, PRO ${pro || 'none'}${deliveredAt ? `, delivered ${deliveredAt}` : ''}`\n  : `No McLeod load matches the PRO or tracking number on this receipt (${tracking.join(', ') || 'none given'}).`;\nconst lines = [\n  `*Receiving order ${w.id} does not match the ASN*`,\n  `PO ${w.poNumber || 'none'} at ${w.fulfillmentCenter || 'ShipBob'}, status ${w.status}`,\n  loadLine,\n  ...lineText.map((t) => `- ${t}`),\n];\nconst buttons = [];\nif (carrierEmail && w.unitsShort > 0) {\n  buttons.push({ type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Claim with the carrier' }, url: link('carrier') });\n}\nbuttons.push({ type: 'button', text: { type: 'plain_text', text: 'Tell the client' }, url: link('client') });\nbuttons.push({ type: 'button', text: { type: 'plain_text', text: 'Accept the count' }, url: link('accept') });\nconst details = [\n  `Receiving order: ${w.id}`,\n  `PO number: ${w.poNumber || 'none'}`,\n  `Fulfillment center: ${w.fulfillmentCenter}`,\n  `Expected arrival: ${w.expectedArrival}`,\n  l ? `McLeod load: ${l.orderId}, carrier ${carrierName}, PRO ${pro}, delivered ${deliveredAt || 'date not recorded'}, ${l.pieces || ''} pieces, ${l.weight || ''} ${l.weightUnit || ''}` : 'McLeod load: none found',\n  'Lines that do not match:',\n  ...lineText,\n].join('\\n');\nreturn {\n  text: `Receiving order ${w.id} does not match the ASN`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: buttons },\n  ],\n  carrierName,\n  carrierEmail,\n  proNumber: pro,\n  loadNumber: l ? l.orderId : '',\n  details,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the receiving lead",
        "nextElementIds": [
          "3C2ED9D6-F262-4849-AB1E-56721F80CBB5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Draft the carrier claim Result"
          },
          "tools": {},
          "position": {
            "x": 892,
            "y": 649
          }
        },
        "flowElementId": "0EC5A758-75C1-441F-90CA-CD808B2740C5",
        "groupId": null,
        "id": "CE61C3A3-47B2-42DF-A9B4-4514817B00C0",
        "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": "Carrier claim",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You write shortage claim notices from a warehouse receiving team to the motor carrier that delivered an inbound load. Use only the facts you are given. Name the PRO number, the McLeod load number, the delivery date, the receiving order and PO number, and each SKU with the units short. Say the shortage was found at receiving against the shipper's advance ship notice, that this is notice of a cargo shortage claim, and ask the carrier to acknowledge it and send the signed delivery receipt. Do not state a dollar value, do not mention overages or units not stowed, and do not invent facts. Plain text, short paragraphs, no em dashes. Reply with JSON only, with these fields:\nsubject: the email subject, with the PRO number in it\nbody: the email body, signed \"Receiving team\""
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Carrier: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Question card",
                "subPathSegments": [
                  {
                    "key": "carrierName",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Question card",
                "subPathSegments": [
                  {
                    "key": "details",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Draft the carrier claim",
        "nextElementIds": [
          "2EB09CB3-D257-4B8B-92AE-04BA0AAB165B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the receiving lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 891,
            "y": 210
          }
        },
        "flowElementId": "2429F08F-A58F-4A0A-AEC3-0258F36AF38F",
        "groupId": null,
        "id": "3C2ED9D6-F262-4849-AB1E-56721F80CBB5",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to receiving lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the receiving lead",
        "nextElementIds": [
          "C1D3C3F4-31D2-4A7F-B56E-9D26B301DEDF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the notice in Slack Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1688,
            "y": 770
          }
        },
        "flowElementId": "7B6293E7-41DB-443B-9178-96919C801F01",
        "groupId": null,
        "id": "6CDC36E1-67A3-4CF9-9577-6087478AD011",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Receiving notice emailed to the client at "
                  },
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Client email",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Client email"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to receiving lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3C2ED9D6-F262-4849-AB1E-56721F80CBB5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Confirm the notice in Slack', Error: The placeholder \"Client email\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Notice confirmed",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the notice in Slack",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Draft the client notice Result"
          },
          "tools": {},
          "position": {
            "x": 892,
            "y": 779
          }
        },
        "flowElementId": "57B50BC1-59CC-4C5D-8349-55C6F5268BEA",
        "groupId": null,
        "id": "26FFEF8C-05BB-471F-863F-1E93EA1D8E83",
        "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": "Client notice",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You write receiving discrepancy notices from a 3PL warehouse to the client who owns the inventory. Use only the facts you are given. Name the receiving order and PO number, then list each SKU that did not match with the quantity on the ASN, the quantity received and the quantity stowed. Ask the client how they want the short and over units handled, for example whether they will take it up with their supplier or send a corrected ASN. Do not promise credits, do not blame anyone, and do not invent facts. Plain text, short, no em dashes. Reply with JSON only, with these fields:\nsubject: the email subject, with the PO number in it\nbody: the email body, signed \"Receiving team\""
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Question card",
                "subPathSegments": [
                  {
                    "key": "details",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Draft the client notice",
        "nextElementIds": [
          "32D34D83-7D54-4A79-896F-78E9B417AC72"
        ],
        "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 inbound load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 1669,
            "y": 210
          }
        },
        "flowElementId": "937A16EF-510A-4D72-BF2B-5ED86CC3D643",
        "groupId": null,
        "id": "B2162C61-03D7-4E04-A30A-EABD1881BFBC",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "WRO boxes",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "tracking_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4B98EB3F-36BC-4C28-BFEB-1E02E5F2C061"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "9B234C41-A267-4B42-9A3E-0797B7687A64",
          "packageId": "default",
          "resultAlias": "Inbound load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the inbound load in McLeod",
        "nextElementIds": [
          "90DE1D82-E4EA-4549-B391-42364D0E7763"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the claim in Slack Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1691,
            "y": 640
          }
        },
        "flowElementId": "8C074FD4-2241-4090-BDB9-628D49E1800F",
        "groupId": null,
        "id": "9F387EE2-25EF-4C84-B980-6F060359F00D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Shortage claim emailed to "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "carrierName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " at "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "carrierEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for PRO "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to receiving lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3C2ED9D6-F262-4849-AB1E-56721F80CBB5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Claim confirmed",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the claim in Slack",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the accepted count Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 882,
            "y": 510
          }
        },
        "flowElementId": "2A1182D1-5D1E-4F3B-88C6-F1110EA41436",
        "groupId": null,
        "id": "413AB778-FF1E-42DB-8238-82E08EDAD3B5",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Count accepted for receiving order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Receipt check",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "87727B0C-5921-4483-B0F1-AF3240638E15"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". No email was sent."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to receiving lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3C2ED9D6-F262-4849-AB1E-56721F80CBB5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Count accepted",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the accepted count",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Email the claim to the carrier Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 1275,
            "y": 640
          }
        },
        "flowElementId": "9DBA40F5-A61E-4529-99AA-B236B0BB2B51",
        "groupId": null,
        "id": "2EB09CB3-D257-4B8B-92AE-04BA0AAB165B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "carrierEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90DE1D82-E4EA-4549-B391-42364D0E7763"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier claim",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CE61C3A3-47B2-42DF-A9B4-4514817B00C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier claim",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "body",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CE61C3A3-47B2-42DF-A9B4-4514817B00C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Claim email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Email the claim to the carrier",
        "nextElementIds": [
          "9F387EE2-25EF-4C84-B980-6F060359F00D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves details of a specific Warehouse Receiving Order by its ID, including current status, fulfillment center, inventory quantities with expected/received/stowed counts, and status history. Essential for tracking inbound shipment progress.",
          "elementId": "EXTENSION:::SHARED:::default:::shipbob:::getWRO",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the receiving order Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shipbob:::getWRO",
          "legacyElementId": "JS###v1###ShipBobService###getWRO",
          "methodName": "getWRO",
          "position": {
            "x": 497,
            "y": 40
          }
        },
        "flowElementId": "99FC4D78-D649-4D81-A0AD-8AD13F61F787",
        "groupId": null,
        "id": "6EF33615-B41F-47E9-9386-30C3939305BB",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "wroId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Completed WRO",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "FC6BF8BC-EBDB-41AF-9B60-D5118E5A8F2D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Get the receiving order', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getWRO",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Receipt",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shipbob",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the receiving order",
        "nextElementIds": [
          "87727B0C-5921-4483-B0F1-AF3240638E15"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "5274643d-af26-4fb1-8b4d-43952ef253c5": "SIMPLE",
            "018bde04-4b4a-45f5-9cd4-d43412db97e5": "SIMPLE"
          },
          "position": {
            "x": 463,
            "y": 649
          }
        },
        "flowElementId": "77AB9231-EB86-42D3-B6CD-5B2E41E98011",
        "groupId": null,
        "id": "E37BC7DA-5213-4754-B75F-877BB99B5DF2",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Receiving pick",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "5274643d-af26-4fb1-8b4d-43952ef253c5",
              "label": "Claim with the carrier",
              "nextComponents": [
                {
                  "componentId": "CE61C3A3-47B2-42DF-A9B4-4514817B00C0",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "carrier"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "018bde04-4b4a-45f5-9cd4-d43412db97e5",
              "label": "Tell the client",
              "nextComponents": [
                {
                  "componentId": "26FFEF8C-05BB-471F-863F-1E93EA1D8E83",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "client"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "224f88af-b2ed-47e2-939d-4e6750cc11cf",
              "label": "Everything Else",
              "nextComponents": [
                {
                  "componentId": "413AB778-FF1E-42DB-8238-82E08EDAD3B5",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "RESULT",
                "label": "Receiving decision",
                "subPathSegments": [
                  {
                    "key": "decision",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "C1D3C3F4-31D2-4A7F-B56E-9D26B301DEDF"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "What did the receiving lead pick?",
        "nextElementIds": [
          "CE61C3A3-47B2-42DF-A9B4-4514817B00C0",
          "26FFEF8C-05BB-471F-863F-1E93EA1D8E83",
          "413AB778-FF1E-42DB-8238-82E08EDAD3B5"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      }
    ],
    "firstElementId": "FC6BF8BC-EBDB-41AF-9B60-D5118E5A8F2D",
    "groups": [],
    "id": "DA58A442-CC3D-4DF2-8A3C-840FE7C51672",
    "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 question for the receiving lead' has an invalid configuration. Code Argument 'answerLink' has invalid value. Placeholder Data 'Answer link': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key for the two AI steps that draft the emails.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for the receiving lead's answer. The Slack buttons open it.",
          "error": "Placeholder Data 'Answer link': value is required",
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The email address of the client whose inventory this ShipBob account holds. Receiving notices go there.",
          "error": null,
          "name": "Client 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-26T05:51:10.961Z"
}
