{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "5BEFEA08-8F95-4B05-84A9-F221C0C57884",
    "name": "UPS Quantum View: delivered parcels to invoicing"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -360,
        "zoom": 1
      },
      "autoSave": true,
      "descriptions": {
        "flow": "Every hour, reads new UPS deliveries from Quantum View, checks who signed against the ShipStation order, sends the order's QuickBooks invoice when they agree, and asks the billing lead in Slack when they don't.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Every hour, reads new UPS deliveries from Quantum View, checks who signed against the ShipStation order, sends the order's QuickBooks invoice when they agree, and asks the billing lead in Slack when they don't.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": true,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the UPS delivery Result"
          },
          "position": {
            "x": 463,
            "y": 49
          }
        },
        "flowElementId": "EE42FA6D-C0AD-4BBC-9A48-488255A909BB",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "F9423A30-C412-4E7B-B958-40DF7E8B8236",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "item",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": null,
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "4CC4ED63-E215-4B92-9E41-5323C23DF427"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const e = item || {};\nconst pkg = Array.isArray(e.Package) ? (e.Package[0] || {}) : (e.Package || {});\nconst values = (r) => [].concat(r || []).map((x) => (x && typeof x === 'object') ? (x.Value || x.value || '') : (x || '')).filter(Boolean);\nconst references = [...new Set([...values(e.ShipmentReferenceNumber), ...values(e.PackageReferenceNumber), ...values(pkg.PackageReferenceNumber), ...values(pkg.ReferenceNumber)])];\nconst ymd = (d) => (d && String(d).length >= 8) ? `${String(d).slice(0, 4)}-${String(d).slice(4, 6)}-${String(d).slice(6, 8)}` : '';\nconst hm = (t) => (t && String(t).length >= 4) ? `${String(t).slice(0, 2)}:${String(t).slice(2, 4)}` : '';\nconst activity = pkg.Activity || {};\nconst loc = e.ActivityLocation || {};\nconst art = loc.AddressArtifactFormat || {};\nconst spot = e.DeliveryLocation || {};\nreturn {\n  trackingNumber: e.TrackingNumber || pkg.TrackingNumber || '',\n  references: references.join(', '),\n  deliveredAt: [ymd(e.Date || activity.Date), hm(e.Time || activity.Time)].filter(Boolean).join(' '),\n  place: [loc.City || art.PoliticalDivision2, loc.StateProvinceCode || art.PoliticalDivision1].filter(Boolean).join(', '),\n  signedBy: spot.SignedForByName || '',\n  leftAt: spot.Description || spot.Code || '',\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Delivery",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the UPS delivery",
        "nextElementIds": [
          "D9875692-6855-4AE1-8FEB-4B37500FC92A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check who signed Result"
          },
          "tools": {},
          "position": {
            "x": 1226,
            "y": 219
          }
        },
        "flowElementId": "CF679347-8342-4DC0-A56E-E0DEB2D5A281",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "918AF452-B97B-4E53-ACFE-74E044900673",
        "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": "Signature check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You check UPS delivery confirmations before the order's invoice is sent. Compare who signed and where UPS left the package with who the order was shipped to. Reply with JSON only, with these fields:\nagrees: true when the delivery fits the order: the signer is the recipient, or plainly someone at the recipient's business (receiving, dock, front desk, mailroom or a staff member at a business address), or the city matches and nothing looks wrong. false when the signer is a different person at a home address, a neighbor or another business, the name is blank or a placeholder, the delivery city differs from the ship-to city, or anything else looks wrong. When there is no order to compare with, answer false.\nreason: one plain sentence saying why, naming the signer and the recipient."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Order number: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order",
                "subPathSegments": [
                  {
                    "key": "orderNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nShipped to: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order",
                "subPathSegments": [
                  {
                    "key": "shipTo",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nShip-to address: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order",
                "subPathSegments": [
                  {
                    "key": "destination",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nResidential address: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order",
                "subPathSegments": [
                  {
                    "key": "residential",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nUPS tracking: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery",
                "subPathSegments": [
                  {
                    "key": "trackingNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nDelivered: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery",
                "subPathSegments": [
                  {
                    "key": "deliveredAt",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " in "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery",
                "subPathSegments": [
                  {
                    "key": "place",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSigned for by: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery",
                "subPathSegments": [
                  {
                    "key": "signedBy",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nWhere UPS left it: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Delivery",
                "subPathSegments": [
                  {
                    "key": "leftAt",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Check who signed",
        "nextElementIds": [
          "2581BBBF-3E65-4A30-8654-2B1C8C4C2F0A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends an invoice to the customer via email. Uses the customer's email address on file or a specified email address. QuickBooks Online generates and sends a professionally formatted email with the invoice details.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::sendInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Send the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::sendInvoice",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###sendInvoice",
          "methodName": "sendInvoice",
          "position": {
            "x": 470,
            "y": 980
          }
        },
        "flowElementId": "144A17E6-7704-4493-9C25-99E278B4B6BD",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "AAA8BFEA-9F7F-449F-AD4F-0A71AE439498",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "invoiceId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "emailTo",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Send the invoice', 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": "sendInvoice",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sent invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the invoice",
        "nextElementIds": [],
        "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 billing lead Result"
          },
          "position": {
            "x": 1170,
            "y": 519
          }
        },
        "flowElementId": "EA59A457-58C5-42F1-810B-243F63F571A3",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "493BAEB8-C0C5-43AB-B145-138897316F0B",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "invoice",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "docNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "customer",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "total",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "order",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shipTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "shipTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "destination",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "destination",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tracking",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "deliveredAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "deliveredAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "place",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "place",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "signedBy",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "signedBy",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "leftAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "leftAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reason",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Signature check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "reason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "918AF452-B97B-4E53-ACFE-74E044900673"
                  }
                ],
                "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 lines = [\n  `*Check this delivery before invoice ${invoice} goes out*`,\n  `Order ${order} for ${customer || shipTo}, invoice total ${Number(total || 0).toFixed(2)}`,\n  `Shipped to: ${shipTo}${destination ? ' (' + destination + ')' : ''}`,\n  `UPS: delivered ${deliveredAt}${place ? ' in ' + place : ''}, signed by ${signedBy || 'nobody named'}${leftAt ? ', left at ' + leftAt : ''}`,\n  `Tracking: ${tracking}`,\n  reason ? `Why it was flagged: ${reason}` : null,\n].filter(Boolean);\nreturn {\n  text: `Check this delivery before invoice ${invoice} goes out`,\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: 'Send the invoice' }, url: link('bill') },\n      { type: 'button', text: { type: 'plain_text', text: 'Hold the invoice' }, url: link('hold') },\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 billing lead",
        "nextElementIds": [
          "094B71C2-6D64-4922-85BA-F6F1D4EE63C0"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoice Result"
          },
          "position": {
            "x": 470,
            "y": 219
          }
        },
        "flowElementId": "3F2233EF-5810-455E-B29F-25061DAC9239",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "result",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice search",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "2581BBBF-3E65-4A30-8654-2B1C8C4C2F0A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "order",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = (result && result.QueryResponse && Array.isArray(result.QueryResponse.Invoice)) ? result.QueryResponse.Invoice : [];\nconst inv = order ? list.find((x) => x && String(x.DocNumber) === String(order)) : null;\nif (!inv) {\n  return { ready: false, missing: Boolean(order), id: '', docNumber: '', customer: '', total: 0 };\n}\nconst sent = inv.EmailStatus === 'EmailSent';\nconst balance = Number(inv.Balance || 0);\nreturn {\n  ready: !sent && balance > 0,\n  missing: false,\n  id: String(inv.Id),\n  docNumber: String(inv.DocNumber),\n  customer: (inv.CustomerRef && inv.CustomerRef.name) || '',\n  total: Number(inv.TotalAmt || 0),\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the invoice",
        "nextElementIds": [
          "C774D65E-4FAE-489A-B111-E7911174D78E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 824,
            "y": 649
          }
        },
        "flowElementId": "651EC33B-419E-4D8A-BE60-26E5C5007059",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "430D6BE0-9374-493F-AB5F-2CD91D51BD2A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "83b7b379-0359-4be9-bf6e-8b4f5794c466",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice",
                      "subPathSegments": [
                        {
                          "key": "missing",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "83b7b379-0359-4be9-bf6e-8b4f5794c466"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Missing check",
          "storeResult": false,
          "thenComponent": {
            "componentId": "824A1358-C642-452F-BD84-97F20D959A49",
            "componentType": "ELEMENT"
          }
        },
        "name": "Order has no invoice?",
        "nextElementIds": [
          "824A1358-C642-452F-BD84-97F20D959A49"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "bookmark": "1bf2f408-c2ff-406d-be8e-c37b19c1406c",
            "events": "5e7608bd-263f-4b03-ac78-2c11af404dc9",
            "more": "023665c6-2c24-49ac-baaf-6f852d913466"
          },
          "position": {
            "x": 750,
            "y": 49
          }
        },
        "flowElementId": "940B5CE2-127D-4ECC-BAF2-F702D34E193B",
        "groupId": "3A34062E-258C-43D4-9C5B-09F6A8F6DCB5",
        "id": "777669B8-F0F1-4577-A841-E1A6F8645443",
        "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": "811CB682-F8DE-44E8-AA57-000237D0B9D4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "events",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "events",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "811CB682-F8DE-44E8-AA57-000237D0B9D4"
                  }
                ],
                "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": "811CB682-F8DE-44E8-AA57-000237D0B9D4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "keep",
          "storeResult": true
        },
        "name": "Keep the list",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 787,
            "y": 819
          }
        },
        "flowElementId": "449EEE30-C756-4AA4-8CF4-AECA43B191B1",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "0F00E688-72BF-44CD-B280-E7669C3E0AE7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Billing decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the billing lead's answer",
        "nextElementIds": [
          "525332C1-1ECD-4731-B08D-293CDEBD2A23"
        ],
        "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": "Tell billing the invoice is missing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1187,
            "y": 380
          }
        },
        "flowElementId": "1EBA2BF7-C982-4500-892E-BF774E2B84C4",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "824A1358-C642-452F-BD84-97F20D959A49",
        "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": "*Order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " was delivered, but QuickBooks has no invoice numbered "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "*"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "UPS tracking "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", delivered "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "deliveredAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " in "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "place",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", signed by "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "signedBy",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Create the invoice so it can go out."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Missing invoice note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell billing the invoice is missing",
        "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 order Result"
          },
          "position": {
            "x": 1226,
            "y": 49
          }
        },
        "flowElementId": "EB41A981-1960-4A78-9D31-E14DB2A3A939",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "5643455F-9950-47E6-AFB0-A032576E5B52",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "result",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Shipment",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "D9875692-6855-4AE1-8FEB-4B37500FC92A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tracking",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "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 { found: false, orderNumber: '', shipTo: '', destination: '' };\n}\nconst to = s.shipTo || {};\nreturn {\n  found: true,\n  orderNumber: String(s.orderNumber || ''),\n  shipTo: [to.name, to.company].filter(Boolean).join(', '),\n  destination: [to.street1, to.city, to.state].filter(Boolean).join(', '),\n  residential: to.residential === true,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Order",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Match the order",
        "nextElementIds": [
          "918AF452-B97B-4E53-ACFE-74E044900673"
        ],
        "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 invoice is held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 110,
            "y": 810
          }
        },
        "flowElementId": "92342919-4EF8-4A7D-A179-14836077FDFD",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "281FEDC3-4760-497C-A3C7-FEDAC34958CB",
        "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": "Invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "docNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is held and has not been sent. Check with the customer, and open a claim with UPS if the package did not reach them."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "094B71C2-6D64-4922-85BA-F6F1D4EE63C0"
                  }
                ],
                "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": "Hold confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the invoice is held",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 470,
            "y": 819
          }
        },
        "flowElementId": "D8F99811-B063-4960-9785-464E8777B1A5",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "525332C1-1ECD-4731-B08D-293CDEBD2A23",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "b63b3c7e-06ca-48ab-ab33-32b03ab58c90",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Billing decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "0F00E688-72BF-44CD-B280-E7669C3E0AE7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "bill"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "b63b3c7e-06ca-48ab-ab33-32b03ab58c90"
            ]
          },
          "elseComponent": {
            "componentId": "281FEDC3-4760-497C-A3C7-FEDAC34958CB",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Bill it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "AAA8BFEA-9F7F-449F-AD4F-0A71AE439498",
            "componentType": "ELEMENT"
          }
        },
        "name": "Bill it?",
        "nextElementIds": [
          "AAA8BFEA-9F7F-449F-AD4F-0A71AE439498",
          "281FEDC3-4760-497C-A3C7-FEDAC34958CB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Queries invoices in QuickBooks Online with optional filtering by customer, invoice number, open or paid balance and transaction date range. Results are paginated and sorted by transaction date in descending order. QuickBooks cannot filter on a custom field in a query, so the Custom Field filter is applied to the returned page: narrow the page with the other filters first, or put the reference (e.g. the load number) in the Invoice Number and filter on that exactly.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listInvoices",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the invoice in QuickBooks Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listInvoices",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listInvoices",
          "methodName": "listInvoices",
          "position": {
            "x": 794,
            "y": 210
          }
        },
        "flowElementId": "C51F55C6-98EA-4070-97A1-186A9B8C44B2",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "2581BBBF-3E65-4A30-8654-2B1C8C4C2F0A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 5
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5643455F-9950-47E6-AFB0-A032576E5B52"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "balanceStatus",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "txnDateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "txnDateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFieldId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFieldValue",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the invoice in QuickBooks', 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": "listInvoices",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice search",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the invoice in QuickBooks",
        "nextElementIds": [
          "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 452,
            "y": 519
          }
        },
        "flowElementId": "2D2D5E97-BED0-429D-B852-7487E36B3F22",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "C774D65E-4FAE-489A-B111-E7911174D78E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "e326f645-da4e-462a-afcb-def6abd59bbf",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice",
                      "subPathSegments": [
                        {
                          "key": "ready",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DDD3CDC9-2EE2-4096-BFEB-C95D0F243D02"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "e326f645-da4e-462a-afcb-def6abd59bbf"
            ]
          },
          "elseComponent": {
            "componentId": "430D6BE0-9374-493F-AB5F-2CD91D51BD2A",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Ready check",
          "storeResult": false,
          "thenComponent": {
            "componentId": "90D61AFE-BD78-49D9-BAF7-63A648810975",
            "componentType": "ELEMENT"
          }
        },
        "name": "Invoice waiting to go out?",
        "nextElementIds": [
          "430D6BE0-9374-493F-AB5F-2CD91D51BD2A",
          "90D61AFE-BD78-49D9-BAF7-63A648810975"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": true,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "bookmark": "00b89628-027c-4a4c-a1b8-d1ce39d9a836",
            "events": "669482c0-88c8-4158-b902-e65c0aa9eb23",
            "more": "23166e87-0619-4575-8989-9d3b4241dc45"
          },
          "position": {
            "x": 110,
            "y": 400
          }
        },
        "flowElementId": "1A5CE6B7-90B8-4D1E-BD98-FB09523C7BFB",
        "groupId": null,
        "id": "C3BC1F1F-53C7-4214-A8FD-8A41AF7EAB8A",
        "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": "events",
              "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 delivery list",
        "nextElementIds": [],
        "nextGroupIds": [
          "3A34062E-258C-43D4-9C5B-09F6A8F6DCB5"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves Quantum View Delivery events, the confirmations UPS generates when packages are delivered. Returns a flattened list of delivered packages with tracking numbers, delivery date and time, delivery location, and the name of the person who signed. This is the fastest way for an AI agent to confirm that shipments reached their destination. Use the returned bookmark to page through additional data.",
          "elementId": "EXTENSION:::SHARED:::default:::ups-quantum-view:::getDeliveryEvents",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get new UPS deliveries Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ups-quantum-view:::getDeliveryEvents",
          "legacyElementId": "JS###v1###UPSQuantumViewService###getDeliveryEvents",
          "methodName": "getDeliveryEvents",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "1663EEEA-5E41-4207-8CFC-96019F813CA1",
        "groupId": "3A34062E-258C-43D4-9C5B-09F6A8F6DCB5",
        "id": "0E19C8F8-925C-49AE-A2A2-1DF7E465ADF4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subscriptionName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Delivery subscription",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Delivery subscription"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "beginDateTime",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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 new UPS deliveries', Error: The placeholder \"Delivery subscription\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getDeliveryEvents",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Delivery page",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ups-quantum-view",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get new UPS deliveries",
        "nextElementIds": [
          "811CB682-F8DE-44E8-AA57-000237D0B9D4"
        ],
        "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 billing lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1226,
            "y": 810
          }
        },
        "flowElementId": "0336936A-DDD6-4EC6-86B7-2B621BFEF63A",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "094B71C2-6D64-4922-85BA-F6F1D4EE63C0",
        "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": "493BAEB8-C0C5-43AB-B145-138897316F0B"
                  }
                ],
                "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": "493BAEB8-C0C5-43AB-B145-138897316F0B"
                  }
                ],
                "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 billing lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the billing lead",
        "nextElementIds": [
          "0F00E688-72BF-44CD-B280-E7669C3E0AE7"
        ],
        "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": 430,
            "y": 49
          }
        },
        "flowElementId": "6C3338E6-3E04-4D73-8535-C03DE4D63A16",
        "groupId": "3A34062E-258C-43D4-9C5B-09F6A8F6DCB5",
        "id": "811CB682-F8DE-44E8-AA57-000237D0B9D4",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "events",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - events",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.events",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "events",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageEvents",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery page",
                    "subPathSegments": [
                      {
                        "key": "events",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0E19C8F8-925C-49AE-A2A2-1DF7E465ADF4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bookmark",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Delivery page",
                    "subPathSegments": [
                      {
                        "key": "bookmark",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0E19C8F8-925C-49AE-A2A2-1DF7E465ADF4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = Array.isArray(events) ? events : [];\nconst page = Array.isArray(pageEvents) ? pageEvents : [];\nconst next = bookmark ? String(bookmark) : '';\nreturn { events: list.concat(page), 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": [
          "777669B8-F0F1-4577-A841-E1A6F8645443"
        ],
        "nextGroupIds": [],
        "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": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the order in ShipStation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shipstation:::listShipments",
          "legacyElementId": "JS###v1###ShipStation###listShipments",
          "methodName": "listShipments",
          "position": {
            "x": 801,
            "y": 40
          }
        },
        "flowElementId": "808FF297-BCE4-410A-824E-4A90193DA84F",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "D9875692-6855-4AE1-8FEB-4B37500FC92A",
        "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": "ELEMENT_RESULT",
                    "label": "Delivery",
                    "subPathSegments": [
                      {
                        "key": "trackingNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F9423A30-C412-4E7B-B958-40DF7E8B8236"
                  }
                ],
                "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 order in ShipStation",
        "nextElementIds": [
          "5643455F-9950-47E6-AFB0-A032576E5B52"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 797,
            "y": 519
          }
        },
        "flowElementId": "6935F227-2046-4372-81FA-144B1D82BACB",
        "groupId": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "id": "90D61AFE-BD78-49D9-BAF7-63A648810975",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "69f695e9-15c4-41b2-a344-44dd44a746a3",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Signature check",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "agrees",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "918AF452-B97B-4E53-ACFE-74E044900673"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "69f695e9-15c4-41b2-a344-44dd44a746a3"
            ]
          },
          "elseComponent": {
            "componentId": "493BAEB8-C0C5-43AB-B145-138897316F0B",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Signature match",
          "storeResult": false,
          "thenComponent": {
            "componentId": "AAA8BFEA-9F7F-449F-AD4F-0A71AE439498",
            "componentType": "ELEMENT"
          }
        },
        "name": "Signature matches the order?",
        "nextElementIds": [
          "AAA8BFEA-9F7F-449F-AD4F-0A71AE439498",
          "493BAEB8-C0C5-43AB-B145-138897316F0B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "C3BC1F1F-53C7-4214-A8FD-8A41AF7EAB8A",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -40.29197080291971,
            "y": 10.802919708029197,
            "zoom": 0.73
          },
          "position": {
            "x": 727,
            "y": 400
          }
        },
        "flowElementId": "61097EA5-B57A-42BC-B153-2E3EDE20CECB",
        "groupId": null,
        "id": "4CC4ED63-E215-4B92-9E41-5323C23DF427",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Check each delivery', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "F9423A30-C412-4E7B-B958-40DF7E8B8236",
          "list": {
            "expression": [
              {
                "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                "label": "Default - events",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.dataBuckets.Default.events",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "dataBuckets",
                    "optional": false
                  },
                  {
                    "key": "Default",
                    "optional": false
                  },
                  {
                    "key": "events",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "each",
          "storeResult": true
        },
        "name": "Check each delivery",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "repeat",
          "isFirstElement": false,
          "blockDefinitionId": "repeat",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 413,
            "y": 400
          }
        },
        "flowElementId": "329D30CA-96AE-4226-BEB9-3AB1EC116021",
        "groupId": null,
        "id": "3A34062E-258C-43D4-9C5B-09F6A8F6DCB5",
        "loopType": "REPEAT",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Read the delivery feed', Error: Children have error",
            "valid": false
          },
          "condition": {
            "conditionParts": [
              {
                "id": "058c88a6-68ca-4b35-b65f-c425c09a125e",
                "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": [
              "058c88a6-68ca-4b35-b65f-c425c09a125e"
            ]
          },
          "enabled": true,
          "firstElementId": "0E19C8F8-925C-49AE-A2A2-1DF7E465ADF4",
          "maxIterations": 20,
          "onFailElemId": null,
          "resultAlias": "feedLoop",
          "storeResult": true
        },
        "name": "Read the delivery feed",
        "nextElementIds": [],
        "nextGroupIds": [
          "4CC4ED63-E215-4B92-9E41-5323C23DF427"
        ],
        "type": "LOOP"
      }
    ],
    "id": "F4958416-A592-4177-BDD6-5A9C01207B9B",
    "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": "",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The name of your UPS Quantum View subscription for delivery events (up to 21 letters and digits).",
          "error": null,
          "name": "Delivery subscription",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The URL of the block Wait for the billing lead's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-26T09:36:19.436Z"
}
