{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "80C81CDA-7827-431F-BC45-090CB65B9CA4",
    "name": "Xero: POD check before the carrier pay run"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -180,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Before the weekly carrier pay run, reads the Xero bills awaiting payment that fall due in the next days or are past due, earliest first, checks in McLeod that each load has a POD on file and that the bill matches the agreed carrier pay, and posts the ready and held lists to AP in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Before the weekly carrier pay run, reads every Xero bill awaiting payment that falls due in the next days, checks in McLeod that each load has a POD on file and that the bill matches the agreed carrier pay, and posts the ready and held lists to AP in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "page": "084bb935-4f64-4a44-a1af-c58f562c4098",
            "bills": "2b02e5af-ae2d-40f4-b2f6-e41e66614268",
            "more": "d688d9c5-93cf-4459-8520-4673bf1cf4d2"
          },
          "position": {
            "x": 735,
            "y": 49
          }
        },
        "flowElementId": "5B76AEA3-BB51-4713-9DA1-7E006A34AEED",
        "groupId": "21AF00EE-CB29-4B42-A5CB-110410AB9D83",
        "id": "2E0E3207-2205-496E-B5E4-8C474CBA61F6",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "next",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DF464F30-98E7-4872-B62B-D777335B0F51"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bills",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Page tally",
                    "subPathSegments": [
                      {
                        "key": "bills",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DF464F30-98E7-4872-B62B-D777335B0F51"
                  }
                ],
                "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": "DF464F30-98E7-4872-B62B-D777335B0F51"
                  }
                ],
                "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": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the pay run summary Result"
          },
          "position": {
            "x": 467,
            "y": 390
          }
        },
        "flowElementId": "89CCA610-EA07-4D13-BF35-55C90A7AA6C7",
        "groupId": null,
        "id": "E8B02A0E-7537-4A33-BB41-71ED93AE8C4E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - rows",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.rows",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "rows",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "until",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Due bills",
                    "subPathSegments": [
                      {
                        "key": "until",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A38FD13D-5E8D-42A4-9D75-8A3565E7D908"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = Array.isArray(rows) ? rows : [];\nconst money = (n) => '$' + Number(n || 0).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });\nconst ready = list.filter((r) => r.ok);\nconst held = list.filter((r) => !r.ok);\nconst sum = (a) => a.reduce((s, r) => s + Number(r.amountDue || 0), 0);\nconst line = (r) => `- ${r.carrier}, bill ${r.invoiceNumber}, load ${r.loadNumber || 'none'}: ${money(r.amountDue)} due ${r.dueDate}`;\nconst text = [\n  `*Carrier bills due by ${until}: ${ready.length} ready to pay, ${held.length} held*`,\n  '',\n  `*Ready to pay* (${money(sum(ready))})`,\n  ...(ready.length ? ready.map(line) : ['- none']),\n  '',\n  `*Held* (${money(sum(held))})`,\n  ...(held.length ? held.map((r) => `${line(r)}. ${(r.reasons || []).join('; ')}`) : ['- none']),\n].join('\\n');\nreturn { text, readyCount: ready.length, heldCount: held.length };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Pay run summary",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the pay run summary",
        "nextElementIds": [
          "F9079568-2B78-410C-9244-89D96A8498F3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "rows": "a10b702a-6c69-4ebe-9985-6664bce228d3"
          },
          "position": {
            "x": 1181,
            "y": 390
          }
        },
        "flowElementId": "CD27BD53-FDE0-4335-99BD-55C8BA662D86",
        "groupId": null,
        "id": "A77E67D4-8A56-497C-83A3-EE45D7A00B4B",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Due bills",
                    "subPathSegments": [
                      {
                        "key": "noLoad",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A38FD13D-5E8D-42A4-9D75-8A3565E7D908"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "startRows",
          "storeResult": true
        },
        "name": "Start the pay run list",
        "nextElementIds": [],
        "nextGroupIds": [
          "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the POD and the amount Result"
          },
          "position": {
            "x": 1106,
            "y": 459
          }
        },
        "flowElementId": "6B6B145D-5D79-400D-84D2-7C49F30B2CEF",
        "groupId": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "id": "53B3DEBA-4BE2-453C-A4CC-01AB9090EEC6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "bill",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": null,
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "found",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill load",
                    "subPathSegments": [
                      {
                        "key": "found",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CB673A9E-3185-491A-A880-2A624CC36551"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CB673A9E-3185-491A-A880-2A624CC36551"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docs",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load documents",
                    "subPathSegments": [
                      {
                        "key": "documents",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F176812-1589-4735-83F5-3E856803ECB4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - rows",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.rows",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "rows",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podTypes",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "POD document types",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "POD document types"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const b = bill || {};\nconst reasons = [];\nconst L = (found === true || found === 'true') && load && typeof load === 'object' ? load : null;\nif (!L) {\n  reasons.push(`load ${b.loadNumber} not found in McLeod`);\n} else {\n  const types = String(podTypes || 'POD').split(',').map((t) => t.trim().toLowerCase()).filter(Boolean);\n  const list = Array.isArray(docs) ? docs : [];\n  const hasPod = list.some((d) => types.includes(String(d.documentTypeId || '').toLowerCase()) || /proof of delivery/i.test(String(d.description || '')));\n  if (!hasPod) reasons.push('no POD on the load in McLeod');\n  const pay = L.carrierPay || {};\n  const agreed = Number(pay.totalPay != null ? pay.totalPay : (pay.amount || 0));\n  if (Math.round(agreed * 100) !== Math.round(Number(b.total || 0) * 100)) reasons.push(`bill total $${Number(b.total || 0).toFixed(2)} differs from the agreed carrier pay of $${agreed.toFixed(2)}`);\n}\nconst row = { ...b, ok: reasons.length === 0, reasons };\nreturn { rows: (Array.isArray(rows) ? rows : []).concat([row]) };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Bill result",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check the POD and the amount",
        "nextElementIds": [
          "FDE200F5-9B8C-46CC-B3E7-323DEB8D266D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the bills due this week Result"
          },
          "position": {
            "x": 1148,
            "y": 220
          }
        },
        "flowElementId": "CC6B4BD9-4685-4E68-87B6-A882A515E2C3",
        "groupId": null,
        "id": "A38FD13D-5E8D-42A4-9D75-8A3565E7D908",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "bills",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - bills",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.bills",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "bills",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "until",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Cutoff",
                    "subPathSegments": [
                      {
                        "key": "until",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0F112D52-5150-499A-9A6B-7D5C1DEE2FAA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const toDay = (b) => {\n  const m = /Date\\((\\d+)/.exec(String(b.DueDate || ''));\n  if (m) return new Date(Number(m[1])).toISOString().slice(0, 10);\n  return String(b.DueDateString || b.DueDate || '').slice(0, 10);\n};\nconst due = (Array.isArray(bills) ? bills : [])\n  .map((b) => ({\n    invoiceId: b.InvoiceID,\n    invoiceNumber: b.InvoiceNumber || '(no number)',\n    carrier: (b.Contact && b.Contact.Name) || 'Unknown carrier',\n    total: Number(b.Total || 0),\n    amountDue: Number(b.AmountDue || 0),\n    dueDate: toDay(b),\n    loadNumber: String(b.Reference || '').trim(),\n  }))\n  .filter((b) => b.amountDue > 0 && b.dueDate && b.dueDate <= until);\nconst noLoad = due.filter((b) => !b.loadNumber).map((b) => ({ ...b, ok: false, reasons: ['no load number in the bill reference'] }));\nreturn { until, check: due.filter((b) => b.loadNumber), noLoad, count: due.length };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Due bills",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Hold bills with no load number",
        "nextElementIds": [
          "A77E67D4-8A56-497C-83A3-EE45D7A00B4B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a load by its order number, PRO number, bill of lading, consignee reference or a stop reference number (McLeod order tracking search) and returns the first match in full, as Get Load does, with every match listed. Returns found: false instead of failing when nothing matches.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the bill's load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 110,
            "y": 450
          }
        },
        "flowElementId": "386C2DC9-8905-4FD6-A510-F3D97E70C07B",
        "groupId": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "id": "CB673A9E-3185-491A-A880-2A624CC36551",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Bill load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the bill's load in McLeod",
        "nextElementIds": [
          "EA8BF619-04CB-403F-A8E6-A1DCB30AE78A"
        ],
        "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": 415,
            "y": 49
          }
        },
        "flowElementId": "6C4ABBB9-8B22-45E1-9C4F-220D1F6D9215",
        "groupId": "21AF00EE-CB29-4B42-A5CB-110410AB9D83",
        "id": "DF464F30-98E7-4872-B62B-D777335B0F51",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "bills",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - bills",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.bills",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "bills",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageBills",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill page",
                    "subPathSegments": [
                      {
                        "key": "Invoices",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "26410EFA-921D-4753-A425-51C4423715A1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - page",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.page",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "page",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = Array.isArray(bills) ? bills : [];\nconst found = Array.isArray(pageBills) ? pageBills : [];\nreturn { bills: list.concat(found), more: found.length >= 100, next: Number(page || 1) + 1 };\n"
              }
            ],
            "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": [
          "2E0E3207-2205-496E-B5E4-8C474CBA61F6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 469,
            "y": 459
          }
        },
        "flowElementId": "F19A0E0A-3250-47EE-96D4-577B55FF0269",
        "groupId": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "id": "EA8BF619-04CB-403F-A8E6-A1DCB30AE78A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "2ec4e8b2-1f83-4c95-bf8b-6479d130f2c9",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Bill load",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "CB673A9E-3185-491A-A880-2A624CC36551"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "2ec4e8b2-1f83-4c95-bf8b-6479d130f2c9"
            ]
          },
          "elseComponent": {
            "componentId": "53B3DEBA-4BE2-453C-A4CC-01AB9090EEC6",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "1F176812-1589-4735-83F5-3E856803ECB4",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load found?",
        "nextElementIds": [
          "1F176812-1589-4735-83F5-3E856803ECB4",
          "53B3DEBA-4BE2-453C-A4CC-01AB9090EEC6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "rows": "ed4d38fe-0cef-4221-b192-5574776b4208"
          },
          "position": {
            "x": 1138,
            "y": 629
          }
        },
        "flowElementId": "25FF6B26-A887-4B06-A484-46352FF6C57E",
        "groupId": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "id": "FDE200F5-9B8C-46CC-B3E7-323DEB8D266D",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill result",
                    "subPathSegments": [
                      {
                        "key": "rows",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "53B3DEBA-4BE2-453C-A4CC-01AB9090EEC6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "addRow",
          "storeResult": true
        },
        "name": "Add to the pay run list",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Lists the documents McLeod Imaging holds for a load (rate confirmation, BOL, POD and the rest): those attached to the order and, unless turned off, those attached to its movements. Each has the ID that Download Document takes.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::listLoadDocuments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the load's documents Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::listLoadDocuments",
          "legacyElementId": null,
          "methodName": "listLoadDocuments",
          "position": {
            "x": 769,
            "y": 450
          }
        },
        "flowElementId": "441DABA6-9B6C-48A3-BA9D-4588388CD7CD",
        "groupId": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "id": "1F176812-1589-4735-83F5-3E856803ECB4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CB673A9E-3185-491A-A880-2A624CC36551"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeMovementDocuments",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listLoadDocuments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Load documents",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the load's documents",
        "nextElementIds": [
          "53B3DEBA-4BE2-453C-A4CC-01AB9090EEC6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": true,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "page": "f9012cf6-2035-46ac-a45e-89b98bf18cb2",
            "bills": "293e438e-02dc-434c-b47b-17601e2e62c1",
            "more": "dc38c8ec-b1bd-4233-ab45-fa067290c709"
          },
          "position": {
            "x": 139,
            "y": 220
          }
        },
        "flowElementId": "B3C0A695-8C56-4A42-B56B-7D082A723D5B",
        "groupId": null,
        "id": "99F72B8E-8D79-43C9-9183-C30DF4A55EFB",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bills",
              "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": "init",
          "storeResult": true
        },
        "name": "Start the bill list",
        "nextElementIds": [
          "0F112D52-5150-499A-9A6B-7D5C1DEE2FAA"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Searches for invoices with optional filters by contact, status, type, and date range.",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::findInvoices",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find bills awaiting payment Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::findInvoices",
          "legacyElementId": "JS###v1###XeroService###findInvoices",
          "methodName": "findInvoices",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "DED0EFEE-BEB9-4368-A9E7-2C4A3DD8D757",
        "groupId": "21AF00EE-CB29-4B42-A5CB-110410AB9D83",
        "id": "26410EFA-921D-4753-A425-51C4423715A1",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "contactId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "AUTHORISED"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "ACCPAY"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fromDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "toDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - page",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.page",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "page",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Cutoff",
                    "subPathSegments": [
                      {
                        "key": "until",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0F112D52-5150-499A-9A6B-7D5C1DEE2FAA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "DueDate"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "ASC"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find bills coming due', 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": "findInvoices",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Bill page",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xero",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find bills coming due",
        "nextElementIds": [
          "DF464F30-98E7-4872-B62B-D777335B0F51"
        ],
        "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,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Post the pay run check to AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 110,
            "y": 381
          }
        },
        "flowElementId": "CF93E2D8-29BB-4A64-AAAF-663FD151ED5B",
        "groupId": null,
        "id": "F9079568-2B78-410C-9244-89D96A8498F3",
        "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": "Pay run summary",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E8B02A0E-7537-4A33-BB41-71ED93AE8C4E"
                  }
                ],
                "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": "Pay run post",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the pay run check to AP",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out the last due date Result"
          },
          "position": {
            "x": 469,
            "y": 220
          }
        },
        "flowElementId": "CD80D5DA-F52F-4666-93D7-2EBE2A8F0B25",
        "groupId": null,
        "id": "0F112D52-5150-499A-9A6B-7D5C1DEE2FAA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "daysAhead",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Days ahead",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Days ahead"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const d = new Date();\nd.setUTCDate(d.getUTCDate() + Number(daysAhead || 7));\nreturn { until: d.toISOString().slice(0, 10) };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Cutoff",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out the last due date",
        "nextElementIds": [],
        "nextGroupIds": [
          "21AF00EE-CB29-4B42-A5CB-110410AB9D83"
        ],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "99F72B8E-8D79-43C9-9183-C30DF4A55EFB",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "repeat",
          "isFirstElement": false,
          "blockDefinitionId": "repeat",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 812,
            "y": 220
          }
        },
        "flowElementId": "484E5EBF-1241-4D31-8F9C-F70555805B77",
        "groupId": null,
        "id": "21AF00EE-CB29-4B42-A5CB-110410AB9D83",
        "loopType": "REPEAT",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Read the bills coming due', Error: Children have error",
            "valid": false
          },
          "condition": {
            "conditionParts": [
              {
                "id": "c78720a5-9c06-4ea5-9c2c-a5a2d12b5953",
                "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": [
              "c78720a5-9c06-4ea5-9c2c-a5a2d12b5953"
            ]
          },
          "enabled": true,
          "firstElementId": "26410EFA-921D-4753-A425-51C4423715A1",
          "maxIterations": 50,
          "onFailElemId": null,
          "resultAlias": "loop",
          "storeResult": true
        },
        "name": "Read the bills coming due",
        "nextElementIds": [
          "A38FD13D-5E8D-42A4-9D75-8A3565E7D908"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -70,
            "y": -410,
            "zoom": 1
          },
          "position": {
            "x": 830,
            "y": 390
          }
        },
        "flowElementId": "BC069044-A468-4A5C-A6D8-5BC286DC67F1",
        "groupId": null,
        "id": "9AC6C5B9-6587-44F2-8BB6-D1F1E984DCB2",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "CB673A9E-3185-491A-A880-2A624CC36551",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Due bills",
                "subPathSegments": [
                  {
                    "key": "check",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A38FD13D-5E8D-42A4-9D75-8A3565E7D908"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "each",
          "storeResult": true
        },
        "name": "Check each bill",
        "nextElementIds": [
          "E8B02A0E-7537-4A33-BB41-71ED93AE8C4E"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "08FEC812-A483-41CD-8C10-CFE09BC34BD8",
    "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": "Bills due within this many days, and any already past due, are checked.",
          "error": null,
          "name": "Days ahead",
          "type": "INT",
          "value": ""
        },
        {
          "description": "The McLeod Imaging document type IDs that count as a proof of delivery, separated by commas.",
          "error": null,
          "name": "POD document types",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-26T05:48:46.717Z"
}
