{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "4FC59CEE-F9A2-4C4A-B97B-72B2253A0095",
    "name": "UPS Quantum View: labels with no pickup scan"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Every morning, reads the last few days of Quantum View activity, finds UPS labels that were printed but never scanned at pickup, and asks the shipping lead in Slack whether to keep each label or void it in ShipStation.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Every morning, reads the last few days of Quantum View activity, finds UPS labels that were printed but never scanned at pickup, and asks the shipping lead in Slack whether to keep each label or void it in ShipStation.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find labels with no pickup scan Result"
          },
          "position": {
            "x": 1048,
            "y": 40
          }
        },
        "flowElementId": "DA64DF53-33A9-4C05-8F9F-A424101ECB72",
        "groupId": null,
        "id": "805554B2-1F01-4391-8E93-C955F04BCE7A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "manifests",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - manifests",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.manifests",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "manifests",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scanned",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - scanned",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.scanned",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "scanned",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "today",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Window",
                    "subPathSegments": [
                      {
                        "key": "today",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "653C8422-5426-4A95-A760-C74BD0FF4C76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const seen = new Set(Array.isArray(scanned) ? scanned : []);\nconst done = new Set();\nconst labels = [];\nfor (const m of (Array.isArray(manifests) ? manifests : [])) {\n  if (!m || !m.trackingNumber || seen.has(m.trackingNumber) || done.has(m.trackingNumber)) continue;\n  const day = /^\\d{8}$/.test(m.pickupDate) ? m.pickupDate : '20' + String(m.fileName || '').slice(0, 6);\n  if (!/^\\d{8}$/.test(day) || day >= String(today)) continue;\n  done.add(m.trackingNumber);\n  labels.push({ ...m, pickupDay: `${day.slice(0, 4)}-${day.slice(4, 6)}-${day.slice(6, 8)}` });\n}\nreturn { labels, count: labels.length };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Unscanned",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Find labels with no pickup scan",
        "nextElementIds": [],
        "nextGroupIds": [
          "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
        ],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a paginated list of shipments matching optional filters such as recipient, carrier, service, tracking number, store, and date ranges. Useful for tracking dashboards or post-fulfillment automations.",
          "elementId": "EXTENSION:::SHARED:::default:::shipstation:::listShipments",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the label in ShipStation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shipstation:::listShipments",
          "legacyElementId": "JS###v1###ShipStation###listShipments",
          "methodName": "listShipments",
          "position": {
            "x": 111,
            "y": 310
          }
        },
        "flowElementId": "EB2C1B10-7FD7-4D05-96C0-5962C369B029",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "1D16FE61-56DD-4DD6-B88A-902C2AF9D4F7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "recipientName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "recipientCountryCode",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "carrierCode",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "serviceCode",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "trackingNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "storeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "createDateStart",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "createDateEnd",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shipDateStart",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shipDateEnd",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeShipmentItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDir",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "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": "listShipments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Shipment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shipstation",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the label in ShipStation",
        "nextElementIds": [
          "42D54F5C-1D3C-4C50-B651-176C5CEDEE01"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves the raw Quantum View events feed for your UPS account, returning newly manifested shipments, origin scans, exceptions, and deliveries across all subscriptions. Provide a subscription name and a date range (Format: YYYYMMDDHHmmss) to narrow the results, or leave them blank to receive all unread events. If the response includes a Bookmark, pass it back in on a follow up call to page through the remaining data.",
          "elementId": "EXTENSION:::SHARED:::default:::ups-quantum-view:::getEvents",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get UPS shipment activity Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ups-quantum-view:::getEvents",
          "legacyElementId": "JS###v1###UPSQuantumViewService###getEvents",
          "methodName": "getEvents",
          "position": {
            "x": 110,
            "y": 220
          }
        },
        "flowElementId": "4F5E874B-D00B-42AF-AA0E-3ED4FE4130DC",
        "groupId": "43ABA91D-F6AE-4AE0-9137-FE4DE88A7A48",
        "id": "4BE47929-7B9D-4778-8FB1-47A2FA6FE5D4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subscriptionName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Pickup subscription",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Pickup subscription"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "beginDateTime",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Window",
                    "subPathSegments": [
                      {
                        "key": "begin",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "653C8422-5426-4A95-A760-C74BD0FF4C76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "endDateTime",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bookmark",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - bookmark",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.bookmark",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "bookmark",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Get UPS shipment activity', Error: The placeholder \"Pickup subscription\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getEvents",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Activity page",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ups-quantum-view",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get UPS shipment activity",
        "nextElementIds": [
          "6F071179-E0F4-48E2-8226-D8C33E4B43A7"
        ],
        "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 label stays Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 127,
            "y": 480
          }
        },
        "flowElementId": "0B1F11F7-A300-42C9-BDC8-C42963685A82",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "5C551E63-944B-4370-A0FE-7ABF2FF5FB15",
        "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": "Keeping the label for tracking "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". The next morning's check asks again if UPS still has no scan for it."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to shipping lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "177AD9FA-A081-4643-AD6D-9BAC00191E17"
                  }
                ],
                "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": "Keep confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the label stays",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": true,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Set the look-back window Result"
          },
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "84C83B15-C873-4831-9EB9-30B8E7BC8D38",
        "groupId": null,
        "id": "653C8422-5426-4A95-A760-C74BD0FF4C76",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "days",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Days to look back",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Days to look back"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tz",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Time zone",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Time zone"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const n = Math.max(1, Number(days) || 3);\nconst start = new Date(Date.now() - n * 86400000);\nconst pad = (x) => String(x).padStart(2, '0');\nconst begin = `${start.getUTCFullYear()}${pad(start.getUTCMonth() + 1)}${pad(start.getUTCDate())}000000`;\nconst today = new Intl.DateTimeFormat('en-CA', { timeZone: tz || 'America/Chicago', year: 'numeric', month: '2-digit', day: '2-digit' }).format(new Date()).replace(/-/g, '');\nreturn { begin, today };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Window",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Set the look-back window",
        "nextElementIds": [
          "C39DC38A-CA02-4BD5-AFAC-D86C621E135D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "bookmark": "8e0e7d55-b95c-440c-a28f-79b37c8f8b3c",
            "manifests": "17a2d6a8-b9c3-4ede-ac7c-54f13c3e483c",
            "scanned": "c5a142cd-17b8-4de1-9edf-d047dd565c17",
            "more": "3355b9d2-80fc-4cec-acb8-bc4e0ba21b27"
          },
          "position": {
            "x": 448,
            "y": 40
          }
        },
        "flowElementId": "04C235B5-EB02-44DB-B88F-1C2ABD080084",
        "groupId": null,
        "id": "C39DC38A-CA02-4BD5-AFAC-D86C621E135D",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "bookmark",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "manifests",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [],
                    "type": "INPUT",
                    "value": "[]"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scanned",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [],
                    "type": "INPUT",
                    "value": "[]"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "more",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "start",
          "storeResult": true
        },
        "name": "Start the activity list",
        "nextElementIds": [],
        "nextGroupIds": [
          "43ABA91D-F6AE-4AE0-9137-FE4DE88A7A48"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "bookmark": "ea48a72f-b9ae-4187-87cb-d2f827a89c4a",
            "manifests": "0f39e788-bc59-4eae-808a-c6a12aae5c0d",
            "scanned": "054de5bb-acf8-4bae-8a7e-7198de2974f6",
            "more": "7256c737-db69-49b1-b943-4865ab5a68f7"
          },
          "position": {
            "x": 769,
            "y": 229
          }
        },
        "flowElementId": "4220537D-A2BE-40A0-A3EC-471C99926BDF",
        "groupId": "43ABA91D-F6AE-4AE0-9137-FE4DE88A7A48",
        "id": "19FD9004-2E69-4DA7-AC18-DBC67850419D",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "bookmark",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "bookmark",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F071179-E0F4-48E2-8226-D8C33E4B43A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "manifests",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "manifests",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F071179-E0F4-48E2-8226-D8C33E4B43A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scanned",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "scanned",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F071179-E0F4-48E2-8226-D8C33E4B43A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "more",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "more",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F071179-E0F4-48E2-8226-D8C33E4B43A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "keep",
          "storeResult": true
        },
        "name": "Keep the list",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "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 shipping lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1223,
            "y": 610
          }
        },
        "flowElementId": "8F00C6FE-C316-4E79-B5A5-29C1D804BF01",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "177AD9FA-A081-4643-AD6D-9BAC00191E17",
        "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": "CA162F71-B906-409C-A9A4-2D2797226A1A"
                  }
                ],
                "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": "CA162F71-B906-409C-A9A4-2D2797226A1A"
                  }
                ],
                "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 shipping lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the shipping lead",
        "nextElementIds": [
          "63636C97-E92B-4C98-A713-C6F8FAC08BB6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 762,
            "y": 619
          }
        },
        "flowElementId": "867A71E6-273A-4B01-B2B2-D6B1F07CA68F",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "63636C97-E92B-4C98-A713-C6F8FAC08BB6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Shipping decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the shipping lead's answer",
        "nextElementIds": [
          "127BE528-1E60-42F9-897D-AD631FF97F67"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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 label is voided Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 115,
            "y": 780
          }
        },
        "flowElementId": "0F2451EB-B20E-400E-9DF1-B961EEAE8E18",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "24D2154E-BFAA-47DC-B710-95363C9CD5AE",
        "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": "Void sent to ShipStation for tracking "
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". ShipStation answered: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Voided label",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E7617BDB-A745-4838-988C-02BC2DC504A8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to shipping lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "177AD9FA-A081-4643-AD6D-9BAC00191E17"
                  }
                ],
                "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": "Void confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the label is voided",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Match the label Result"
          },
          "position": {
            "x": 462,
            "y": 319
          }
        },
        "flowElementId": "7410F2A3-5514-4889-BD20-CB11866CEF17",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "42D54F5C-1D3C-4C50-B651-176C5CEDEE01",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "result",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Shipment",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "1D16FE61-56DD-4DD6-B88A-902C2AF9D4F7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tracking",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = (result && Array.isArray(result.shipments)) ? result.shipments : [];\nconst s = tracking ? list.find((x) => x && x.trackingNumber === tracking && !x.voided) : null;\nif (!s) {\n  return { live: false, shipmentId: '', orderNumber: '', shipDate: '' };\n}\nreturn { live: true, shipmentId: s.shipmentId, orderNumber: String(s.orderNumber || ''), shipDate: String(s.shipDate || '').slice(0, 10) };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Label",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Match the label",
        "nextElementIds": [
          "1C06E8C5-33E1-4238-B89E-67B9DCA4B5C4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 462,
            "y": 619
          }
        },
        "flowElementId": "E0ADF8C4-2BD9-400B-8FF1-5A4474182049",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "127BE528-1E60-42F9-897D-AD631FF97F67",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "ea9c40de-ab5f-4fb1-91f9-c0f1d413257d",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Shipping decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "63636C97-E92B-4C98-A713-C6F8FAC08BB6"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "void"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "ea9c40de-ab5f-4fb1-91f9-c0f1d413257d"
            ]
          },
          "elseComponent": {
            "componentId": "5C551E63-944B-4370-A0FE-7ABF2FF5FB15",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Void it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "E7617BDB-A745-4838-988C-02BC2DC504A8",
            "componentType": "ELEMENT"
          }
        },
        "name": "Void it?",
        "nextElementIds": [
          "E7617BDB-A745-4838-988C-02BC2DC504A8",
          "5C551E63-944B-4370-A0FE-7ABF2FF5FB15"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Voids a previously created shipping label so that the carrier does not charge the account for it. The label may not be voidable after a carrier-defined cutoff window.",
          "elementId": "EXTENSION:::SHARED:::default:::shipstation:::voidShipmentLabel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Void the label in ShipStation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shipstation:::voidShipmentLabel",
          "legacyElementId": "JS###v1###ShipStation###voidShipmentLabel",
          "methodName": "voidShipmentLabel",
          "position": {
            "x": 110,
            "y": 610
          }
        },
        "flowElementId": "8380EFC3-323D-4A72-BDF1-27140C3849EA",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "E7617BDB-A745-4838-988C-02BC2DC504A8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "shipmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Label",
                    "subPathSegments": [
                      {
                        "key": "shipmentId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42D54F5C-1D3C-4C50-B651-176C5CEDEE01"
                  }
                ],
                "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": "voidShipmentLabel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Voided label",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shipstation",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Void the label in ShipStation",
        "nextElementIds": [
          "24D2154E-BFAA-47DC-B710-95363C9CD5AE"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add the page to the list Result"
          },
          "position": {
            "x": 449,
            "y": 229
          }
        },
        "flowElementId": "D47A3BD3-F17D-4F2A-84B6-A96058BE9E8B",
        "groupId": "43ABA91D-F6AE-4AE0-9137-FE4DE88A7A48",
        "id": "6F071179-E0F4-48E2-8226-D8C33E4B43A7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Activity page",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "4BE47929-7B9D-4778-8FB1-47A2FA6FE5D4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "manifests",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - manifests",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.manifests",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "manifests",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scanned",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - scanned",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.scanned",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "scanned",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const r = (page && page.QuantumViewResponse) || {};\nconst arr = (v) => (v == null ? [] : (Array.isArray(v) ? v : [v]));\nconst val = (x) => (x && typeof x === 'object') ? (x.Value || x.value || '') : (x || '');\nconst found = Array.isArray(manifests) ? manifests.slice() : [];\nconst seen = new Set(Array.isArray(scanned) ? scanned : []);\nconst events = r.QuantumViewEvents || {};\nfor (const sub of arr(events.SubscriptionEvents)) {\n  for (const file of arr(sub.SubscriptionFile)) {\n    for (const m of arr(file.Manifest)) {\n      const to = m.ShipTo || {};\n      const addr = to.Address || {};\n      const refs = arr(m.ReferenceNumber).map(val).filter(Boolean);\n      for (const p of arr(m.Package)) {\n        if (!p || !p.TrackingNumber) continue;\n        const own = arr(p.PackageReferenceNumber).map(val).filter(Boolean);\n        found.push({\n          trackingNumber: p.TrackingNumber,\n          pickupDate: m.PickupDate || '',\n          fileName: file.FileName || '',\n          shipTo: [to.CompanyName, to.AttentionName || to.Name].filter(Boolean).join(', '),\n          destination: [addr.City, addr.StateProvinceCode].filter(Boolean).join(', '),\n          references: [...new Set([...refs, ...own])].join(', '),\n          service: (m.Service && (m.Service.Description || m.Service.Code)) || '',\n        });\n      }\n    }\n    for (const key of ['Origin', 'Delivery', 'Exception', 'Generic']) {\n      for (const ev of arr(file[key])) {\n        const t = ev && (ev.TrackingNumber || (ev.Package && ev.Package.TrackingNumber));\n        if (t) seen.add(t);\n      }\n    }\n  }\n}\nconst next = r.Bookmark ? String(r.Bookmark) : '';\nreturn { manifests: found, scanned: [...seen], bookmark: next, more: next !== '' };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Page tally",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Add the page to the list",
        "nextElementIds": [
          "19FD9004-2E69-4DA7-AC18-DBC67850419D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the shipping lead Result"
          },
          "position": {
            "x": 1162,
            "y": 319
          }
        },
        "flowElementId": "D43C3902-E814-47E7-8B5F-505DB5B68FC6",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "CA162F71-B906-409C-A9A4-2D2797226A1A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "tracking",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pickupDay",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "pickupDay",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "service",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "service",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shipTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "shipTo",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "destination",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "destination",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "references",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "references",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "64C93F3D-B553-4A82-85AA-2CB02714FBDE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "order",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Label",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42D54F5C-1D3C-4C50-B651-176C5CEDEE01"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shipDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Label",
                    "subPathSegments": [
                      {
                        "key": "shipDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42D54F5C-1D3C-4C50-B651-176C5CEDEE01"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst name = order ? `order ${order}` : `tracking ${tracking}`;\nconst lines = [\n  `*UPS has no pickup scan for ${name}*`,\n  `Tracking: ${tracking}`,\n  `Label made for the ${pickupDay} pickup${service ? ', ' + service : ''}${shipDate ? ' (ship date in ShipStation: ' + shipDate + ')' : ''}`,\n  shipTo ? `Ship to: ${shipTo}${destination ? ' (' + destination + ')' : ''}` : null,\n  references ? `Reference on the label: ${references}` : null,\n  'UPS has the label but has not scanned the package since. Is it still on the dock?',\n].filter(Boolean);\nreturn {\n  text: `UPS has no pickup scan for ${name}`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Keep the label' }, url: link('keep') },\n      { type: 'button', style: 'danger', text: { type: 'plain_text', text: 'Void the label' }, url: link('void') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the shipping lead",
        "nextElementIds": [
          "177AD9FA-A081-4643-AD6D-9BAC00191E17"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 783,
            "y": 319
          }
        },
        "flowElementId": "753F4803-5842-41B9-945F-32746D80F323",
        "groupId": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "id": "1C06E8C5-33E1-4238-B89E-67B9DCA4B5C4",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "6ced237a-b8e7-4e59-b2c7-c6014e3c9ea2",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Label",
                      "subPathSegments": [
                        {
                          "key": "live",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "42D54F5C-1D3C-4C50-B651-176C5CEDEE01"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "6ced237a-b8e7-4e59-b2c7-c6014e3c9ea2"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Live check",
          "storeResult": false,
          "thenComponent": {
            "componentId": "CA162F71-B906-409C-A9A4-2D2797226A1A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Label still live in ShipStation?",
        "nextElementIds": [
          "CA162F71-B906-409C-A9A4-2D2797226A1A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "653C8422-5426-4A95-A760-C74BD0FF4C76",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "repeat",
          "isFirstElement": false,
          "blockDefinitionId": "repeat",
          "viewport": {
            "x": -70,
            "y": -180,
            "zoom": 1
          },
          "position": {
            "x": 748,
            "y": 40
          }
        },
        "flowElementId": "568505E6-B524-4B72-AA8A-71E8F3265A8B",
        "groupId": null,
        "id": "43ABA91D-F6AE-4AE0-9137-FE4DE88A7A48",
        "loopType": "REPEAT",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Read the UPS feed', Error: Children have error",
            "valid": false
          },
          "condition": {
            "conditionParts": [
              {
                "id": "87414074-0227-41c9-9d05-584a1af5fb27",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                      "label": "Default - more",
                      "subPathSegments": null,
                      "type": "EXECUTION_CONTEXT_PATH",
                      "value": "executionContext.dataBuckets.Default.more",
                      "valueSegments": [
                        {
                          "key": "executionContext",
                          "optional": false
                        },
                        {
                          "key": "dataBuckets",
                          "optional": false
                        },
                        {
                          "key": "Default",
                          "optional": false
                        },
                        {
                          "key": "more",
                          "optional": false
                        }
                      ]
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "87414074-0227-41c9-9d05-584a1af5fb27"
            ]
          },
          "enabled": true,
          "firstElementId": "4BE47929-7B9D-4778-8FB1-47A2FA6FE5D4",
          "maxIterations": 30,
          "onFailElemId": null,
          "resultAlias": "feedLoop",
          "storeResult": true
        },
        "name": "Read the UPS feed",
        "nextElementIds": [
          "805554B2-1F01-4391-8E93-C955F04BCE7A"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -65.40725530458589,
            "y": -257.05681040383297,
            "zoom": 0.96
          },
          "position": {
            "x": 1085,
            "y": 210
          }
        },
        "flowElementId": "62249D06-2401-444D-A3C6-E3F2D87C6D6C",
        "groupId": null,
        "id": "64C93F3D-B553-4A82-85AA-2CB02714FBDE",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "1D16FE61-56DD-4DD6-B88A-902C2AF9D4F7",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Unscanned",
                "subPathSegments": [
                  {
                    "key": "labels",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "805554B2-1F01-4391-8E93-C955F04BCE7A"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "each",
          "storeResult": true
        },
        "name": "Chase each label",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "7ACF82BC-B733-4D19-9F79-5163FCE82969",
    "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": "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.",
      "executionStaticData": [
        {
          "description": "The name of your UPS Quantum View subscription that carries manifest and origin (pickup scan) events.",
          "error": null,
          "name": "Pickup subscription",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The URL of the block Wait for the shipping lead's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Your warehouse time zone, used to decide which labels missed a pickup day.",
          "error": null,
          "name": "Time zone",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "How many days of UPS activity each run reads.",
          "error": null,
          "name": "Days to look back",
          "type": "INT",
          "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:36:40.327Z"
}
