{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "D4DA15E9-A3E5-4649-928B-D5A3DAB5E6A3",
    "name": "Microsoft Teams: carrier quick pay approved"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -33.71948300622307,
        "y": 13.19291527046434,
        "zoom": 0.67
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a carrier emails a quick pay request to the AP inbox in Outlook, finds the load in McLeod, checks the POD and agreed carrier pay, and asks AP in Teams on an Adaptive Card. On approval, the carrier's QuickBooks Online bill is created or updated with the quick pay fee taken off and due today, and the carrier gets a reply.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a carrier emails a quick pay request to the AP inbox in Outlook, finds the load in McLeod, checks the POD and agreed carrier pay, and asks AP in Teams on an Adaptive Card. On approval, the carrier's QuickBooks Online bill is created or updated with the quick pay fee taken off and due today, and the carrier gets a reply.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out the quick pay Result"
          },
          "position": {
            "x": 471,
            "y": 389
          }
        },
        "flowElementId": "0666D648-6511-41CB-AE02-086E498AE901",
        "groupId": null,
        "id": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Work out the quick pay', Error: The placeholder \"Quick pay fee percent\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docs",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load documents",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "85609366-21D8-437A-BC8B-1883DC503DE3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vendors",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks carrier",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Vendor",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4F3692F2-A1BE-48E9-8738-D9E409297499"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bills",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Existing bills",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Bill",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "32970F2B-1978-4E5E-A8E2-4161ACBF93A6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks accounts",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Account",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "751F5999-8601-46D5-A3FC-645E0C3D3FC2"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "payAccountName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Carrier pay account",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Carrier pay account"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "feeAccountName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Quick pay fee account",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Quick pay fee account"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "feePercent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Quick pay fee percent",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Quick pay fee percent"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "POD document type",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "POD document type"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "senderAddress",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "address",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  }
                ],
                "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 num = (v) => { const n = Number(v); return Number.isFinite(n) ? n : 0; };\nconst round2 = (n) => Math.round(num(n) * 100) / 100;\nconst usd = (n) => (num(n) < 0 ? '-$' : '$') + Math.abs(num(n)).toFixed(2);\nconst same = (a, b) => Math.abs(num(a) - num(b)) < 0.005;\nconst esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\nconst clean = (s) => String(s || '').toLowerCase().replace(/[^a-z0-9 ]/g, ' ').replace(/\\b(inc|llc|ltd|co|corp|company|trucking|transport|transportation|logistics|express|freight|lines?)\\b/g, ' ').replace(/\\s+/g, ' ').trim();\nconst domainOf = (e) => String(e || '').toLowerCase().split('@')[1] || '';\n\nconst req = request && typeof request === 'object' ? request : {};\nconst load = match && match.load ? match.load : {};\nconst moves = Array.isArray(load.movements) ? load.movements : [];\nconst movement = moves.find((m) => String(m.movementId) === String(load.currentMovementId)) || moves[moves.length - 1] || {};\nconst carrierName = (movement.carrier && movement.carrier.name) || (load.carrier && load.carrier.name) || '';\nconst pay = movement.carrierPay || load.carrierPay || {};\nconst extraPay = Array.isArray(movement.extraPay) && movement.extraPay.length ? movement.extraPay : (Array.isArray(load.carrierExtraPay) ? load.carrierExtraPay : []);\nconst orderId = String(load.orderId || '');\nconst proNumber = String(movement.proNumber || '');\nconst invoiceNumber = String(req.invoiceNumber || '').trim();\nconst mcleodTotal = round2(pay.totalPay != null ? pay.totalPay : num(pay.amount) + num(pay.otherPay));\nconst requested = round2(req.amountRequested);\nconst pct = num(feePercent);\nconst where = `load ${orderId}` + (proNumber ? `, PRO ${proNumber}` : '');\n\nconst documents = docs && Array.isArray(docs.documents) ? docs.documents : [];\nconst pod = documents.find((d) => String(d.documentTypeId || '').toUpperCase() === String(podType || 'POD').toUpperCase());\n\nconst vendorList = Array.isArray(vendors) ? vendors : [];\nconst vendor = vendorList.find((v) => String(v.DisplayName || '').trim().toLowerCase() === carrierName.trim().toLowerCase()) || vendorList[0];\nconst vendorId = vendor ? String(vendor.Id) : '';\nconst accountList = Array.isArray(accounts) ? accounts : [];\nconst findAccount = (name) => accountList.find((x) => String(x.Name || '').trim().toLowerCase() === String(name || '').trim().toLowerCase());\nconst payAccount = findAccount(payAccountName);\nconst feeAccount = findAccount(feeAccountName);\nconst billList = Array.isArray(bills) ? bills : [];\nconst bill = invoiceNumber ? billList.find((x) => String(x.DocNumber || '').trim() === invoiceNumber && (!vendorId || !x.VendorRef || String(x.VendorRef.value) === vendorId)) : null;\n\nconst basis = bill ? round2(bill.TotalAmt) : mcleodTotal;\nconst fee = round2(basis * pct / 100);\nconst net = round2(basis - fee);\nconst billLines = bill && Array.isArray(bill.Line) ? bill.Line.filter((l) => l && (l.DetailType === 'AccountBasedExpenseLineDetail' || l.DetailType === 'ItemBasedExpenseLineDetail')) : [];\nconst feeAlready = billLines.some((l) => /quick ?pay/i.test(String(l.Description || '')));\nconst today = new Date().toISOString().slice(0, 10);\n\nconst problems = [];\nif (!vendorId) problems.push(`${carrierName || req.carrierName || 'the carrier'} is not a vendor in QuickBooks Online`);\nif (!feeAccount) problems.push(`no QuickBooks account is named \"${feeAccountName}\"`);\nif (!bill && !payAccount) problems.push(`no QuickBooks account is named \"${payAccountName}\"`);\nif (bill && num(bill.Balance) <= 0) problems.push(`bill ${invoiceNumber} in QuickBooks is already paid`);\nif (feeAlready) problems.push(`bill ${invoiceNumber} in QuickBooks already has a quick pay fee line`);\nif (!bill && mcleodTotal <= 0) problems.push('McLeod has no carrier pay on this load');\nconst outcome = problems.length ? 'notice' : 'ask';\n\nconst warnings = [];\nif (!pod) warnings.push('No POD is on file for this load in McLeod.');\nif (requested > 0 && !same(requested, basis)) warnings.push(`The carrier asks for ${usd(requested)}, not ${usd(basis)}.`);\nconst named = clean(req.carrierName);\nconst onLoad = clean(carrierName);\nif (named && onLoad && !named.includes(onLoad) && !onLoad.includes(named)) warnings.push(`McLeod has ${carrierName} on this load, not ${req.carrierName}.`);\nconst carrierDomain = domainOf(movement.carrierEmail);\nconst senderDomain = domainOf(senderAddress);\nif (carrierDomain && senderDomain && carrierDomain !== senderDomain) warnings.push(`The email came from ${senderDomain}, but McLeod has ${carrierDomain} for this carrier.`);\nif (req.newBankDetails === true) warnings.push('The email gives new bank or remit-to details. Call the carrier on the number in McLeod before changing anything. This flow changes no bank details.');\nif (bill && !same(bill.TotalAmt, mcleodTotal)) warnings.push(`The QuickBooks bill is ${usd(bill.TotalAmt)} and the McLeod carrier pay is ${usd(mcleodTotal)}.`);\nif (req.feeOffered) warnings.push(`The carrier offered a fee of ${req.feeOffered}. The fee here is your ${pct}%.`);\n\nconst accountLine = (amount, description, accountId) => ({ DetailType: 'AccountBasedExpenseLineDetail', Amount: round2(amount), Description: description, AccountBasedExpenseLineDetail: { AccountRef: { value: String(accountId) } } });\nconst feeLine = feeAccount ? accountLine(-fee, `Quick pay fee ${pct}% (${where})`, feeAccount.Id) : null;\nconst createLines = [];\nif (payAccount) {\n  const extras = extraPay.filter((e) => num(e.amount) !== 0).map((e) => accountLine(e.amount, `${e.description || e.deductCodeId || 'Extra pay'} (${where})`, payAccount.Id));\n  const extrasSum = round2(extras.reduce((s, l) => s + l.Amount, 0));\n  createLines.push(accountLine(mcleodTotal - extrasSum, `Carrier pay (${where})`, payAccount.Id), ...extras);\n}\nif (feeLine) createLines.push(feeLine);\nconst updateLines = feeLine ? [...billLines, feeLine] : billLines;\nconst docNumber = invoiceNumber || `${orderId}-QP`;\nconst quickNote = `Quick pay approved in Microsoft Teams on ${today}: ${pct}% fee ${usd(fee)} taken off, net ${usd(net)}. McLeod ${where}.`;\nconst note = bill && bill.PrivateNote ? `${bill.PrivateNote} ${quickNote}`.slice(0, 4000) : quickNote;\n\nconst link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst extraText = extraPay.length ? extraPay.map((e) => `${e.description || e.deductCodeId || 'Extra pay'} ${usd(e.amount)}`).join(', ') : 'none';\nconst card = {\n  type: 'AdaptiveCard',\n  $schema: 'http://adaptivecards.io/schemas/adaptive-card.json',\n  version: '1.4',\n  body: [\n    { type: 'TextBlock', text: `Quick pay request from ${carrierName || req.carrierName || 'a carrier'} on ${where}`, weight: 'Bolder', size: 'Medium', wrap: true },\n    { type: 'TextBlock', text: String(req.summary || ''), wrap: true, isSubtle: true },\n    { type: 'FactSet', facts: [\n      { title: 'Invoice', value: invoiceNumber || 'No number given' },\n      { title: 'Customer', value: (load.customer && load.customer.name) || 'Not shown' },\n      { title: 'Load status', value: load.statusDescription || load.status || 'Not shown' },\n      { title: 'POD on file', value: pod ? `Yes, scanned ${String(pod.scanDate || '').slice(0, 10)}` : 'No' },\n      { title: 'Carrier pay in McLeod', value: `${usd(mcleodTotal)} (extra pay: ${extraText})` },\n      { title: 'QuickBooks', value: bill ? `Bill ${invoiceNumber} is in QuickBooks for ${usd(bill.TotalAmt)}, balance ${usd(bill.Balance)}` : `No bill yet. Approving creates bill ${docNumber}.` },\n      { title: 'Quick pay fee', value: `${pct}% of ${usd(basis)} = ${usd(fee)}` },\n      { title: 'Pay the carrier', value: `${usd(net)}, due today` },\n    ] },\n    ...(warnings.length ? [{ type: 'TextBlock', text: warnings.map((w) => `- ${w}`).join('\\n'), color: 'Attention', wrap: true }] : []),\n  ],\n  actions: [\n    { type: 'Action.OpenUrl', title: 'Approve quick pay', url: link('approve') },\n    { type: 'Action.OpenUrl', title: 'Decline', url: link('decline') },\n  ],\n};\nconst inv = invoiceNumber ? `, invoice ${esc(invoiceNumber)}` : '';\n\nreturn {\n  outcome,\n  orderId,\n  vendorId,\n  billMode: bill ? 'update' : 'create',\n  billId: bill ? String(bill.Id) : '',\n  docNumber,\n  dueDate: today,\n  createLines,\n  updateLines,\n  note,\n  fee,\n  net,\n  subject: `Quick pay request on ${where}`,\n  card,\n  noticeHtml: `<p><b>Quick pay request from ${esc(req.carrierName || carrierName)} on ${esc(where)}${inv} can't be booked:</b> ${esc(problems.join('; '))}.</p><p>Fix it in QuickBooks Online and answer the carrier from the AP inbox.</p>`,\n  approvedHtml: `<p>Hi,</p><p>Your quick pay request for ${esc(where)}${inv} is approved. We will pay ${usd(net)}, which is ${usd(basis)} less our ${pct}% quick pay fee of ${usd(fee)}.</p><p>Thank you,<br>Accounts payable</p>`,\n  declinedHtml: `<p>Hi,</p><p>We can't offer quick pay on ${esc(where)}${inv}. It will be paid on your standard terms.</p><p>Thank you,<br>Accounts payable</p>`,\n  confirmText: `Quick pay approved. QuickBooks bill ${docNumber} for ${carrierName} now nets ${usd(net)} after the ${usd(fee)} fee, due ${today}. The carrier has been told by email.`,\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Quick pay",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out the quick pay",
        "nextElementIds": [
          "AD324E52-3CD6-4A1B-9A53-3C955CA2C736"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 1531,
            "y": 389
          }
        },
        "flowElementId": "27CD4B4D-FA89-4F64-840B-38D15F510125",
        "groupId": null,
        "id": "5F529F67-18FD-42F9-AD3D-65D3C3BB59AA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "AP decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for AP's answer",
        "nextElementIds": [
          "930D0DDA-B773-4044-B75F-6577721AECC9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Fires once for each new email that arrives in a mail folder (the Inbox unless another folder is chosen), optionally only for emails from a sender, with a subject, with attachments or still unread.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "legacyElementId": "JS###v1###OutlookService###onNewEmail",
          "methodName": "onNewEmail",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "C14BB967-34E0-45FD-815C-1DC99EB87365",
        "groupId": null,
        "id": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New email in the AP inbox', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewEmail",
          "frequency": {
            "repeat": {
              "every": 120
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Request email",
          "serviceId": "outlook",
          "slaConditions": [],
          "staticData": {
            "bodyFormat": "text"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New email in the AP inbox",
        "nextElementIds": [
          "A169A946-82EC-4BC8-B21E-8F479818137E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Sends a reply to an existing email with the specified content and optional parameters.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::replyToMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the carrier it's approved Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::replyToMessage",
          "legacyElementId": "JS###v1###OutlookService###replyToMessage",
          "methodName": "replyToMessage",
          "position": {
            "x": 454,
            "y": 680
          }
        },
        "flowElementId": "40DF01E6-4C48-4F02-87C5-2330F36AAB32",
        "groupId": null,
        "id": "B325B029-6009-4335-9415-2B5A861C5150",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "HTML"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "approvedHtml",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Tell the carrier it's approved', 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": "replyToMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Approval reply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "outlook",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the carrier it's approved",
        "nextElementIds": [
          "CB970BEE-1AB2-4A9E-B40E-0368CF88E49D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries vendors in QuickBooks Online with optional filtering. Search matches part of the DisplayName; Display Name and Company Name match the whole name exactly, to find one vendor (e.g. a carrier) reliably. QuickBooks cannot filter vendors by tax ID, and masks it in responses. Results are paginated and sorted by DisplayName.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listVendors",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the carrier in QuickBooks Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listVendors",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listVendors",
          "methodName": "listVendors",
          "position": {
            "x": 1154,
            "y": 210
          }
        },
        "flowElementId": "1D410B7C-DC5C-4707-B252-D576DB7C1C36",
        "groupId": null,
        "id": "4F3692F2-A1BE-48E9-8738-D9E409297499",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod match",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "carrier",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D"
                  }
                ],
                "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": "displayName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "companyName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the carrier 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": "listVendors",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "QuickBooks carrier",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the carrier in QuickBooks",
        "nextElementIds": [
          "32970F2B-1978-4E5E-A8E2-4161ACBF93A6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the request Result"
          },
          "tools": {},
          "position": {
            "x": 481,
            "y": 49
          }
        },
        "flowElementId": "8E72641A-9B66-4C31-9931-0AF420E8DBF1",
        "groupId": null,
        "id": "A169A946-82EC-4BC8-B21E-8F479818137E",
        "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": "Request",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read emails that reach a freight broker's accounts payable inbox. Decide whether the email asks for quick pay: a carrier, or its dispatcher, asking to be paid early on an invoice in exchange for a quick pay fee. Reply with JSON only, with these fields:\nisQuickPay: true or false\ncarrierName: the carrier's company name, or empty text\nmcNumber: the carrier's MC number, or empty text\ninvoiceNumber: the carrier's invoice number, or empty text\nlookup: an object with three fields, orderNumber, proNumber and billOfLading. Fill only the first of these that the email gives, in this order: the broker's load or order number, then the PRO number, then the bill of lading number. Leave the other two as empty text.\namountRequested: the invoice amount the carrier wants paid, before any fee, as a number, or 0\nfeeOffered: the quick pay fee the carrier names, as written (for example 2% or $45), or empty text\nnewBankDetails: true if the email gives new or changed bank account, routing or remit-to details, otherwise false\nsummary: one plain sentence saying what the carrier asks for"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "address",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  },
                  {
                    "key": "content",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the request",
        "nextElementIds": [
          "10C6EDDC-9D87-426E-9A79-1AD8E6D4AD9D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends a reply to an existing email with the specified content and optional parameters.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::replyToMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the carrier it's declined Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::replyToMessage",
          "legacyElementId": "JS###v1###OutlookService###replyToMessage",
          "methodName": "replyToMessage",
          "position": {
            "x": 1163,
            "y": 810
          }
        },
        "flowElementId": "AF45EE55-4205-495B-969D-C62A8E8932B2",
        "groupId": null,
        "id": "64F3C158-D143-4F1A-AD47-AF8C23F319EF",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "HTML"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "declinedHtml",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Tell the carrier it's declined', 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": "replyToMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Decline reply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "outlook",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the carrier it's declined",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends a message to a team channel as the signed-in user. Supports plain text or HTML content and an optional subject line.",
          "elementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendChannelMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell AP the load isn't in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendChannelMessage",
          "legacyElementId": "JS###v1###MicrosoftTeamsService###sendChannelMessage",
          "methodName": "sendChannelMessage",
          "position": {
            "x": 1845,
            "y": 40
          }
        },
        "flowElementId": "ED290450-65BF-47D9-9B65-54C0005AD480",
        "groupId": null,
        "id": "3EB8249B-9918-44A7-9C38-19BBED2E9184",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams team ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams team ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams channel ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams channel ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "html"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "content",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "<p>"
                  },
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " ("
                  },
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "address",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ") asked for quick pay on invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "invoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", but no McLeod load matches "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "billOfLading",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ".</p><p>"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "</p><p>Check the number and answer the carrier from the AP inbox. The email's subject is: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "</p>"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Quick pay request: load not found in McLeod"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Tell AP the load isn't in McLeod', Error: The placeholder \"Teams team ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendChannelMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Not found note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "microsoft-teams",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell AP the load isn't in McLeod",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1165,
            "y": 689
          }
        },
        "flowElementId": "E807BD77-0298-420E-8D46-6E6ED59A2E66",
        "groupId": null,
        "id": "C10D1176-6424-478E-80C3-3E89C2B8D38C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "3ad7075b-c9f6-4102-92f3-f14d64491941",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Quick pay",
                      "subPathSegments": [
                        {
                          "key": "billMode",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "update"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "3ad7075b-c9f6-4102-92f3-f14d64491941"
            ]
          },
          "elseComponent": {
            "componentId": "6991807B-A0F1-4F31-98CB-982A89F6C598",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Bill exists",
          "storeResult": false,
          "thenComponent": {
            "componentId": "46122A93-A880-4C1A-9279-959214EC4967",
            "componentType": "ELEMENT"
          }
        },
        "name": "Bill already in QuickBooks?",
        "nextElementIds": [
          "6991807B-A0F1-4F31-98CB-982A89F6C598",
          "46122A93-A880-4C1A-9279-959214EC4967"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a load by its order number, PRO number, bill of lading, consignee reference or a stop reference number (McLeod order tracking search) and returns the first match in full, as Get Load does, with every match listed. Returns found: false instead of failing when nothing matches.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 1175,
            "y": 40
          }
        },
        "flowElementId": "9A014A24-CFF8-4FBE-8C91-7C0541713EDD",
        "groupId": null,
        "id": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lookup",
                        "optional": false
                      },
                      {
                        "key": "billOfLading",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  }
                ],
                "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
              }
            },
            {
              "name": "includeCustomerContacts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "McLeod match",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "1F4F4B8F-9F8A-469C-B8C4-30BD4A74B1F5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries bills in QuickBooks Online with optional filtering. You can filter by vendor, bill number (exact or containing a text) and total amount range. Results are paginated and sorted by transaction date in descending order.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listBills",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Look for the carrier's bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listBills",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listBills",
          "methodName": "listBills",
          "position": {
            "x": 820,
            "y": 210
          }
        },
        "flowElementId": "2E25F8F3-0C5F-4E13-99E8-3EABAF22BEDB",
        "groupId": null,
        "id": "32970F2B-1978-4E5E-A8E2-4161ACBF93A6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vendorId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 10
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "invoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "minAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Look for the carrier's bill', 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": "listBills",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Existing bills",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Look for the carrier's bill",
        "nextElementIds": [
          "751F5999-8601-46D5-A3FC-645E0C3D3FC2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates an existing bill in QuickBooks Online using a sparse update. Only the fields you provide will be changed.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::updateBill",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Take the fee off the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::updateBill",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###updateBill",
          "methodName": "updateBill",
          "position": {
            "x": 824,
            "y": 680
          }
        },
        "flowElementId": "B613AC2D-FA1E-4BF0-A063-1F38F58FBE2E",
        "groupId": null,
        "id": "46122A93-A880-4C1A-9279-959214EC4967",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vendorId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "updateLines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "dueDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "privateNote",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "note",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Take the fee off the bill', 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": "updateBill",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Updated bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Take the fee off the bill",
        "nextElementIds": [
          "B325B029-6009-4335-9415-2B5A861C5150"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries the chart of accounts in QuickBooks Online with optional filtering by name and account type. Results are paginated and sorted by name.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listAccounts",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the QuickBooks accounts Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listAccounts",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listAccounts",
          "methodName": "listAccounts",
          "position": {
            "x": 447,
            "y": 210
          }
        },
        "flowElementId": "98F5C623-296D-46FA-9E87-4942FBEE2EEB",
        "groupId": null,
        "id": "751F5999-8601-46D5-A3FC-645E0C3D3FC2",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accountType",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1000
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the QuickBooks accounts', 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": "listAccounts",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "QuickBooks accounts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the QuickBooks accounts",
        "nextElementIds": [
          "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1533,
            "y": 49
          }
        },
        "flowElementId": "0E3A59BE-BB2A-438A-A835-8CF0BBDEE4B8",
        "groupId": null,
        "id": "1F4F4B8F-9F8A-469C-B8C4-30BD4A74B1F5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "e747138e-e144-4c6b-8675-23503aec129b",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "McLeod match",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "e747138e-e144-4c6b-8675-23503aec129b"
            ]
          },
          "elseComponent": {
            "componentId": "3EB8249B-9918-44A7-9C38-19BBED2E9184",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "85609366-21D8-437A-BC8B-1883DC503DE3",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load found?",
        "nextElementIds": [
          "85609366-21D8-437A-BC8B-1883DC503DE3",
          "3EB8249B-9918-44A7-9C38-19BBED2E9184"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": "Check the POD is on file Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::listLoadDocuments",
          "legacyElementId": null,
          "methodName": "listLoadDocuments",
          "position": {
            "x": 1520,
            "y": 210
          }
        },
        "flowElementId": "78095326-FD1F-4BCF-A43C-FA575891E861",
        "groupId": null,
        "id": "85609366-21D8-437A-BC8B-1883DC503DE3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod match",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D"
                  }
                ],
                "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": "Check the POD is on file",
        "nextElementIds": [
          "4F3692F2-A1BE-48E9-8738-D9E409297499"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 834,
            "y": 389
          }
        },
        "flowElementId": "496B07AF-3408-4740-B320-5CE479284585",
        "groupId": null,
        "id": "AD324E52-3CD6-4A1B-9A53-3C955CA2C736",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "670c6441-31a3-44a1-8ec3-ce8b756b364b",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Quick pay",
                      "subPathSegments": [
                        {
                          "key": "outcome",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "ask"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "670c6441-31a3-44a1-8ec3-ce8b756b364b"
            ]
          },
          "elseComponent": {
            "componentId": "5FDD7399-1646-47CD-927D-91AC5FB321C1",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Bookable",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0821043C-0D18-4BE8-8E1A-3E1D8CA2ABE7",
            "componentType": "ELEMENT"
          }
        },
        "name": "Can it be booked?",
        "nextElementIds": [
          "5FDD7399-1646-47CD-927D-91AC5FB321C1",
          "0821043C-0D18-4BE8-8E1A-3E1D8CA2ABE7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 834,
            "y": 49
          }
        },
        "flowElementId": "C010A58A-2F03-4C64-8097-F5EAB3C99F07",
        "groupId": null,
        "id": "10C6EDDC-9D87-426E-9A79-1AD8E6D4AD9D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "6c787c01-7a10-453f-893b-c2152ef7af38",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Request",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "isQuickPay",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "A169A946-82EC-4BC8-B21E-8F479818137E"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "6c787c01-7a10-453f-893b-c2152ef7af38"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Is quick pay",
          "storeResult": false,
          "thenComponent": {
            "componentId": "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D",
            "componentType": "ELEMENT"
          }
        },
        "name": "Quick pay request?",
        "nextElementIds": [
          "DB7E89C3-CD52-4FFB-A0C1-47EC7306987D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1530,
            "y": 689
          }
        },
        "flowElementId": "8E267614-F9C9-4925-A19F-6D4E4E7A9869",
        "groupId": null,
        "id": "930D0DDA-B773-4044-B75F-6577721AECC9",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f8d6f27d-a48b-42f1-8a28-efddb48bba9a",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "AP decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "5F529F67-18FD-42F9-AD3D-65D3C3BB59AA"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "approve"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "f8d6f27d-a48b-42f1-8a28-efddb48bba9a"
            ]
          },
          "elseComponent": {
            "componentId": "64F3C158-D143-4F1A-AD47-AF8C23F319EF",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Approved",
          "storeResult": false,
          "thenComponent": {
            "componentId": "C10D1176-6424-478E-80C3-3E89C2B8D38C",
            "componentType": "ELEMENT"
          }
        },
        "name": "Quick pay approved?",
        "nextElementIds": [
          "64F3C158-D143-4F1A-AD47-AF8C23F319EF",
          "C10D1176-6424-478E-80C3-3E89C2B8D38C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new bill in QuickBooks Online to record an amount owed to a vendor. Give the lines either as Lines (one row per line: an Account and Amount, or an Item with Quantity and Unit Price, no JSON needed) or as Line Items in QuickBooks JSON; when both are given, the Line Items come first.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createBill",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the bill less the fee Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createBill",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###createBill",
          "methodName": "createBill",
          "position": {
            "x": 814,
            "y": 810
          }
        },
        "flowElementId": "7326D53E-6B2B-47B5-ACE1-082F0643F212",
        "groupId": null,
        "id": "6991807B-A0F1-4F31-98CB-982A89F6C598",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vendorId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "vendorId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "createLines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "dueDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "txnDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "privateNote",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "note",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "docNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lines",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the bill less the fee', 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": "createBill",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the bill less the fee",
        "nextElementIds": [
          "B325B029-6009-4335-9415-2B5A861C5150"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends a message to a team channel as the signed-in user. Supports plain text or HTML content and an optional subject line.",
          "elementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendChannelMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell AP why it can't be booked Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendChannelMessage",
          "legacyElementId": "JS###v1###MicrosoftTeamsService###sendChannelMessage",
          "methodName": "sendChannelMessage",
          "position": {
            "x": 1153,
            "y": 510
          }
        },
        "flowElementId": "3688A275-2A6D-4432-802D-0E1FA3A08021",
        "groupId": null,
        "id": "5FDD7399-1646-47CD-927D-91AC5FB321C1",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams team ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams team ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams channel ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams channel ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "html"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "content",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "noticeHtml",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Tell AP why it can't be booked', Error: The placeholder \"Teams team ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendChannelMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Not bookable note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "microsoft-teams",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell AP why it can't be booked",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Posts an Adaptive Card to a team channel as the signed-in user, with optional text above it and an optional subject line. Use it for actionable notices such as an invoice exception card with Approve and Dispute buttons. Buttons must be Action.OpenUrl: Microsoft Graph supports only that action on a card a user posts, and other actions need a bot. Uses the same ChannelMessage.Send permission as Send Channel Message.",
          "elementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendAdaptiveCardToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask AP in Teams Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendAdaptiveCardToChannel",
          "legacyElementId": "JS###v1###MicrosoftTeamsService###sendAdaptiveCardToChannel",
          "methodName": "sendAdaptiveCardToChannel",
          "position": {
            "x": 1187,
            "y": 380
          }
        },
        "flowElementId": "ABFF54CA-F909-425F-A116-CC9D0A258F11",
        "groupId": null,
        "id": "0821043C-0D18-4BE8-8E1A-3E1D8CA2ABE7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams team ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams team ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams channel ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams channel ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "card",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "card",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Ask AP in Teams', Error: The placeholder \"Teams team ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendAdaptiveCardToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "AP card",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "microsoft-teams",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask AP in Teams",
        "nextElementIds": [
          "5F529F67-18FD-42F9-AD3D-65D3C3BB59AA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends a reply to an existing message in a team channel as the signed-in user. Supports plain text or HTML content.",
          "elementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::replyToChannelMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm in the Teams thread Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::replyToChannelMessage",
          "legacyElementId": "JS###v1###MicrosoftTeamsService###replyToChannelMessage",
          "methodName": "replyToChannelMessage",
          "position": {
            "x": 453,
            "y": 980
          }
        },
        "flowElementId": "E900E65B-9090-4213-991B-5DA956DE3696",
        "groupId": null,
        "id": "CB970BEE-1AB2-4A9E-B40E-0368CF88E49D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams team ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams team ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Teams channel ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Teams channel ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "AP card",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0821043C-0D18-4BE8-8E1A-3E1D8CA2ABE7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "text"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "content",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quick pay",
                    "subPathSegments": [
                      {
                        "key": "confirmText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AE1B2AB-BD63-497E-B581-0C3FF51BC844"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Confirm in the Teams thread', Error: The placeholder \"Teams team ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "replyToChannelMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "microsoft-teams",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm in the Teams thread",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "6212452E-8E3E-42DD-AB07-AC4EF16A65C0",
    "groups": [],
    "id": "337EA4E8-A125-4A7B-A46B-EC8071628915",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Block 'Work out the quick pay' has an invalid configuration. Code Argument 'feePercent' has invalid value. Placeholder Data 'Quick pay fee percent': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, for the block Read the request.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for AP's answer. The Teams card buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The ID of the Microsoft Teams team that holds the AP channel (groupId in the channel's link).",
          "error": null,
          "name": "Teams team ID",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The ID of the AP channel, 19:...@thread.tacv2 (in the channel's link).",
          "error": null,
          "name": "Teams channel ID",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Your quick pay fee as a percent of the carrier pay, for example 3.",
          "error": "Placeholder Data 'Quick pay fee percent': value is required",
          "name": "Quick pay fee percent",
          "type": "DOUBLE",
          "value": ""
        },
        {
          "description": "The QuickBooks Online account carrier pay is booked to, by its exact name.",
          "error": null,
          "name": "Carrier pay account",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The QuickBooks Online account the quick pay fee is booked to, by its exact name.",
          "error": null,
          "name": "Quick pay fee account",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The McLeod Imaging document type for proofs of delivery.",
          "error": null,
          "name": "POD document type",
          "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-29T02:51:02.306Z"
}
