{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "8F880048-5584-4621-A553-7B60DC2FBED1",
    "name": "Xero: short-paid freight invoice"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -59.322799097065456,
        "y": 3.882618510158011,
        "zoom": 0.9
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a customer payment in Xero leaves a freight invoice partly open, looks up the load in McLeod and asks the billing lead in Slack whether to ask the customer for the balance, write it off with a credit note, or leave it open.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a customer payment in Xero leaves a freight invoice partly open, looks up the load in McLeod and asks the billing lead in Slack whether to ask the customer for the balance, write it off with a credit note, or leave it open.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for billing Result"
          },
          "position": {
            "x": 885,
            "y": 219
          }
        },
        "flowElementId": "E9650347-FE5D-4CA2-A00C-7A7CAEB3EC1F",
        "groupId": null,
        "id": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the question for billing', Error: The placeholder \"Answer link\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "invoice",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "payment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Payment",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "5E43DB13-372E-4416-A204-CFC15E965C30"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "538A31CB-0F61-44C6-AD65-8CAC1FD96F11"
                  }
                ],
                "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 inv = invoice || {};\nconst pay = payment || {};\nconst L = load && typeof load === 'object' && load.orderId ? load : null;\nconst money = (n) => '$' + Number(n || 0).toFixed(2);\nconst cents = (n) => Math.round(Number(n || 0) * 100);\nconst asDate = (v) => {\n  const m = /Date\\((\\d+)/.exec(String(v || ''));\n  if (m) return new Date(Number(m[1])).toISOString().slice(0, 10);\n  return String(v || '').slice(0, 10);\n};\nconst due = Number(inv.AmountDue || 0);\nconst customer = (inv.Contact && inv.Contact.Name) || 'The customer';\nconst loadNo = String(inv.Reference || '').trim();\nconst items = Array.isArray(inv.LineItems) ? inv.LineItems : [];\nconst lineAmount = (l) => (l.LineAmount != null ? Number(l.LineAmount) : Number(l.UnitAmount || 0) * Number(l.Quantity || 1));\nconst lines = items.map((l) => `- ${l.Description || 'Line'}: ${money(lineAmount(l))}`);\nconst sameAs = items.filter((l) => cents(lineAmount(l)) === cents(due)).map((l) => l.Description || 'a line');\nconst accessorials = L && Array.isArray(L.accessorials) ? L.accessorials.map((a) => `- ${a.description || a.chargeCode}: ${money(a.amount)}`) : [];\nconst link = (d) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${d}`;\nconst heading = `${customer} paid invoice ${inv.InvoiceNumber} short by ${money(due)}`;\nconst body = [\n  `*${heading}*`,\n  `Load: ${loadNo || 'no load number in the invoice reference'}${L ? `, ${L.statusDescription || L.status || ''} in McLeod` : (loadNo ? ', not found in McLeod' : '')}`,\n  `Invoice total ${money(inv.Total)}. This payment ${money(pay.Amount)} on ${asDate(pay.Date)}. Still open ${money(due)}`,\n  '*Invoice lines*',\n  ...lines,\n  sameAs.length ? `The open amount equals: ${sameAs.join(', ')}` : null,\n  accessorials.length ? '*Accessorials on the load in McLeod*' : null,\n  ...accessorials,\n].filter(Boolean).join('\\n');\nconst emailBody = [\n  'Hello,',\n  '',\n  `We received your payment of ${money(pay.Amount)} on ${asDate(pay.Date)} for invoice ${inv.InvoiceNumber}${loadNo ? ' (load ' + loadNo + ')' : ''}. The invoice total is ${money(inv.Total)}, which leaves ${money(due)} open.`,\n  '',\n  'Invoice lines:',\n  ...lines,\n  '',\n  `Please send the remaining ${money(due)}, or tell us which charge you are disputing and why, so we can settle it.`,\n  '',\n  'Accounts receivable',\n].join('\\n');\nreturn {\n  dueText: money(due),\n  text: heading,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: body } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Ask the customer' }, url: link('chase') },\n      { type: 'button', text: { type: 'plain_text', text: 'Write it off' }, url: link('writeoff') },\n      { type: 'button', text: { type: 'plain_text', text: 'Leave it open' }, url: link('open') },\n    ] },\n  ],\n  emailSubject: `Balance open on invoice ${inv.InvoiceNumber}${loadNo ? ', load ' + loadNo : ''}`,\n  emailBody,\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Short pay card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for billing",
        "nextElementIds": [
          "81843514-24E9-4DBF-A1C6-567BF5736A21"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 531,
            "y": 49
          }
        },
        "flowElementId": "FAEA7C47-5B9B-43EE-AAD4-3E1BE158DD68",
        "groupId": null,
        "id": "54EDAA90-21DB-4D26-BF8D-B421C5104887",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "32c28581-9f55-4e55-a2ad-6f3aeae03442",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Payment",
                      "subPathSegments": [
                        {
                          "key": "Invoice",
                          "optional": false
                        },
                        {
                          "key": "Type",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "5E43DB13-372E-4416-A204-CFC15E965C30"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "ACCREC"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "32c28581-9f55-4e55-a2ad-6f3aeae03442"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Customer payment",
          "storeResult": false,
          "thenComponent": {
            "componentId": "06583465-AE81-424E-AE7E-DB264E8FA99A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Customer payment?",
        "nextElementIds": [
          "06583465-AE81-424E-AE7E-DB264E8FA99A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the billing lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 531,
            "y": 210
          }
        },
        "flowElementId": "9874098D-B1EB-45E5-A649-B1677AC7D021",
        "groupId": null,
        "id": "81843514-24E9-4DBF-A1C6-567BF5736A21",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to billing lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the billing lead",
        "nextElementIds": [
          "5D96EAC7-0127-4975-9EC1-FE2B348082DA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the customer for the balance Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 869,
            "y": 510
          }
        },
        "flowElementId": "64CEEE26-4D02-42EF-B14C-9F78114BC03F",
        "groupId": null,
        "id": "BD65E6D7-FF96-448E-AD70-8E1550EFDCE1",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer",
                    "subPathSegments": [
                      {
                        "key": "EmailAddress",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "02F8516C-1044-4E0F-93AF-7E078E4A1F5F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "emailSubject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "emailBody",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Balance request",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the customer for the balance",
        "nextElementIds": [
          "80FB8CDD-5895-442A-9B85-1F50A12D33D5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the customer was asked Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1255,
            "y": 510
          }
        },
        "flowElementId": "7FA2ADEC-5362-4D31-8F0F-1DF315BA3634",
        "groupId": null,
        "id": "80FB8CDD-5895-442A-9B85-1F50A12D33D5",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Asked "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer",
                    "subPathSegments": [
                      {
                        "key": "EmailAddress",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "02F8516C-1044-4E0F-93AF-7E078E4A1F5F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for the open "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "dueText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " on invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "InvoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". The invoice stays open in Xero."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "81843514-24E9-4DBF-A1C6-567BF5736A21"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Chase confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the customer was asked",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "No load number on the invoice Result"
          },
          "position": {
            "x": 878,
            "y": 349
          }
        },
        "flowElementId": "0D911030-B162-414F-847D-84BAA455684C",
        "groupId": null,
        "id": "C0487E83-B801-400D-BDC6-ADCD0D8EE568",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load search error",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "No load number on the invoice",
        "nextElementIds": [
          "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the balance stays open Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 493,
            "y": 770
          }
        },
        "flowElementId": "799A1B38-FB10-4729-900E-50C747EC9528",
        "groupId": null,
        "id": "60516D7B-15AE-410D-9AE6-2E0000933FEA",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Left open. Invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "InvoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " still shows "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "dueText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " due in Xero."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "81843514-24E9-4DBF-A1C6-567BF5736A21"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Open confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the balance stays open",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "9c64578d-c023-4b07-817a-10930fce170a": "SIMPLE",
            "b290ebc1-59b2-42b8-a827-f48ec508b2eb": "SIMPLE"
          },
          "position": {
            "x": 140,
            "y": 649
          }
        },
        "flowElementId": "97EDCB4C-949F-4A61-987C-D2D412185C6E",
        "groupId": null,
        "id": "0B2E5AD0-CD9B-4A78-8EE7-878629FEAB62",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Billing choice",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "9c64578d-c023-4b07-817a-10930fce170a",
              "label": "Ask the customer",
              "nextComponents": [
                {
                  "componentId": "02F8516C-1044-4E0F-93AF-7E078E4A1F5F",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "chase"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "b290ebc1-59b2-42b8-a827-f48ec508b2eb",
              "label": "Write it off",
              "nextComponents": [
                {
                  "componentId": "F7DDFE19-5BFF-47AB-997E-7CECF93446D9",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "writeoff"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "d06daa5a-1369-45cf-84dc-a5801d5c2bb3",
              "label": "Everything Else",
              "nextComponents": [
                {
                  "componentId": "60516D7B-15AE-410D-9AE6-2E0000933FEA",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "RESULT",
                "label": "Billing decision",
                "subPathSegments": [
                  {
                    "key": "decision",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "5D96EAC7-0127-4975-9EC1-FE2B348082DA"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "What did billing decide?",
        "nextElementIds": [
          "F7DDFE19-5BFF-47AB-997E-7CECF93446D9",
          "60516D7B-15AE-410D-9AE6-2E0000933FEA",
          "02F8516C-1044-4E0F-93AF-7E078E4A1F5F"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "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": 1286,
            "y": 210
          }
        },
        "flowElementId": "11C7FC82-1173-4BB7-B420-07BF23F28083",
        "groupId": null,
        "id": "538A31CB-0F61-44C6-AD65-8CAC1FD96F11",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Reference",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findLoadByNumber",
          "onFailElemId": "C0487E83-B801-400D-BDC6-ADCD0D8EE568",
          "packageId": "default",
          "resultAlias": "McLeod load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 110,
            "y": 219
          }
        },
        "flowElementId": "94FCBEB9-15CB-4B0E-AF18-7D19A876A123",
        "groupId": null,
        "id": "5D96EAC7-0127-4975-9EC1-FE2B348082DA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Billing decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the billing lead's answer",
        "nextElementIds": [
          "0B2E5AD0-CD9B-4A78-8EE7-878629FEAB62"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a new payment is received. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::onNewPayment",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::xero:::onNewPayment",
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::onNewPayment",
          "legacyElementId": "JS###v1###XeroService###onNewPayment",
          "methodName": "onNewPayment",
          "position": {
            "x": 148,
            "y": 40
          }
        },
        "flowElementId": "7C76B5CB-3B73-472B-81AC-2D1F7F5D9F65",
        "groupId": null,
        "id": "5E43DB13-372E-4416-A204-CFC15E965C30",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New payment in Xero', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewPayment",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Payment",
          "serviceId": "xero",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New payment in Xero",
        "nextElementIds": [
          "54EDAA90-21DB-4D26-BF8D-B421C5104887"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Creates a credit note to refund or credit a customer/supplier.",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::createCreditNote",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the credit note Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::createCreditNote",
          "legacyElementId": "JS###v1###XeroService###createCreditNote",
          "methodName": "createCreditNote",
          "position": {
            "x": 526,
            "y": 640
          }
        },
        "flowElementId": "DF800C2A-04DE-406A-88B4-2D260DA5901E",
        "groupId": null,
        "id": "F7DDFE19-5BFF-47AB-997E-7CECF93446D9",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "contactId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Contact",
                        "optional": false
                      },
                      {
                        "key": "ContactID",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "ACCRECCREDIT"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "creditNoteNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reference",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Short pay on "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "InvoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "AUTHORISED"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineItems",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lines",
              "type": "COMPLEX_LIST",
              "value": [
                {
                  "type": "OBJECT",
                  "value": [
                    {
                      "name": "description",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [
                          {
                            "id": "TEXT",
                            "label": null,
                            "type": "INPUT",
                            "value": "Short pay written off on invoice "
                          },
                          {
                            "id": "ELEMENT_RESULT",
                            "label": "Invoice",
                            "subPathSegments": [
                              {
                                "key": "InvoiceNumber",
                                "optional": false
                              }
                            ],
                            "type": "ELEMENT_LINK",
                            "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                          }
                        ],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "quantity",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [
                          {
                            "id": "NUMBER",
                            "label": null,
                            "type": "INPUT",
                            "value": 1
                          }
                        ],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "unitAmount",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [
                          {
                            "id": "ELEMENT_RESULT",
                            "label": "Invoice",
                            "subPathSegments": [
                              {
                                "key": "AmountDue",
                                "optional": false
                              }
                            ],
                            "type": "ELEMENT_LINK",
                            "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                          }
                        ],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "lineAmount",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "accountCode",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [
                          {
                            "id": "PLACEHOLDER_DATA",
                            "label": "Write-off account code",
                            "subPathSegments": null,
                            "type": "EXECUTION_CONTEXT_STATIC_DATA",
                            "value": "Write-off account code"
                          }
                        ],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "itemCode",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    },
                    {
                      "name": "taxType",
                      "type": "SIMPLE",
                      "value": {
                        "expression": [],
                        "mode": "EXPRESSION",
                        "parseJsonString": false,
                        "resultType": null
                      }
                    }
                  ]
                }
              ]
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the credit note', Error: The placeholder \"Write-off account code\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createCreditNote",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Credit note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xero",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the credit note",
        "nextElementIds": [
          "CB846A9C-0532-473D-A70C-AD9AD302BBC7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Allocates a credit note to an invoice to reduce the amount due.",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::allocateCreditNote",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Apply the credit to the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::allocateCreditNote",
          "legacyElementId": "JS###v1###XeroService###allocateCreditNote",
          "methodName": "allocateCreditNote",
          "position": {
            "x": 880,
            "y": 640
          }
        },
        "flowElementId": "39B3A860-2AC9-4DF1-BFFB-049FC7738831",
        "groupId": null,
        "id": "CB846A9C-0532-473D-A70C-AD9AD302BBC7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "creditNoteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Credit note",
                    "subPathSegments": [
                      {
                        "key": "CreditNoteID",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F7DDFE19-5BFF-47AB-997E-7CECF93446D9"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoiceId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "InvoiceID",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "amount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "AmountDue",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Apply the credit to the invoice', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "allocateCreditNote",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Credit applied",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xero",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Apply the credit to the invoice",
        "nextElementIds": [
          "C363A7F8-CF5E-4F75-A31F-0723E979E282"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the write-off Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1295,
            "y": 640
          }
        },
        "flowElementId": "62A4FF0F-EBF0-486C-9833-FD2B65CDAD33",
        "groupId": null,
        "id": "C363A7F8-CF5E-4F75-A31F-0723E979E282",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Written off. Credit note "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Credit note",
                    "subPathSegments": [
                      {
                        "key": "CreditNoteNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F7DDFE19-5BFF-47AB-997E-7CECF93446D9"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Short pay card",
                    "subPathSegments": [
                      {
                        "key": "dueText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6B75C217-72B6-47BE-B6B2-EA82CE382CFC"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is applied to invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "InvoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", which is now paid in Xero."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "81843514-24E9-4DBF-A1C6-567BF5736A21"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Write-off confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the write-off",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single invoice by ID with full details including line items and payments.",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::getInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::getInvoice",
          "legacyElementId": "JS###v1###XeroService###getInvoice",
          "methodName": "getInvoice",
          "position": {
            "x": 912,
            "y": 40
          }
        },
        "flowElementId": "4A4C8B1B-9CA5-406D-80A4-90554ABD432B",
        "groupId": null,
        "id": "06583465-AE81-424E-AE7E-DB264E8FA99A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "invoiceId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Payment",
                    "subPathSegments": [
                      {
                        "key": "Invoice",
                        "optional": false
                      },
                      {
                        "key": "InvoiceID",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "5E43DB13-372E-4416-A204-CFC15E965C30"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Get the invoice', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getInvoice",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xero",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the invoice",
        "nextElementIds": [
          "117CC127-F57B-4737-A404-BC62601EFCB2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single contact by ID with full details including addresses and phone numbers.",
          "elementId": "EXTENSION:::SHARED:::default:::xero:::getContact",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the customer's email Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xero:::getContact",
          "legacyElementId": "JS###v1###XeroService###getContact",
          "methodName": "getContact",
          "position": {
            "x": 515,
            "y": 510
          }
        },
        "flowElementId": "AFE63D80-481C-45EA-B573-E7B2D2FD8BDA",
        "groupId": null,
        "id": "02F8516C-1044-4E0F-93AF-7E078E4A1F5F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "contactId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Contact",
                        "optional": false
                      },
                      {
                        "key": "ContactID",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Get the customer's email', 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": "getContact",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Customer",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xero",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the customer's email",
        "nextElementIds": [
          "BD65E6D7-FF96-448E-AD70-8E1550EFDCE1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1298,
            "y": 49
          }
        },
        "flowElementId": "524FDD58-2119-4D5B-93B7-226BBE60987E",
        "groupId": null,
        "id": "117CC127-F57B-4737-A404-BC62601EFCB2",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "34c8fae8-93a8-4310-a906-973021b0b607",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice",
                      "subPathSegments": [
                        {
                          "key": "AmountDue",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "DOUBLE",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 0
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              },
              {
                "id": "02ccd03e-eb14-48db-a731-e8b0aa1eecb0",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice",
                      "subPathSegments": [
                        {
                          "key": "Status",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "06583465-AE81-424E-AE7E-DB264E8FA99A"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "AUTHORISED"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "34c8fae8-93a8-4310-a906-973021b0b607",
              "AND",
              "02ccd03e-eb14-48db-a731-e8b0aa1eecb0"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Paid short",
          "storeResult": false,
          "thenComponent": {
            "componentId": "538A31CB-0F61-44C6-AD65-8CAC1FD96F11",
            "componentType": "ELEMENT"
          }
        },
        "name": "Paid short?",
        "nextElementIds": [
          "538A31CB-0F61-44C6-AD65-8CAC1FD96F11"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "5E43DB13-372E-4416-A204-CFC15E965C30",
    "groups": [],
    "id": "9D7E4ED5-38CD-4859-83C9-0834C378D14E",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Block 'Write the question for billing' has an invalid configuration. Code Argument 'answerLink' has invalid value. Placeholder Data 'Answer link': value is required",
      "executionStaticData": [
        {
          "description": "The URL of the block Wait for the billing lead's answer. The Slack buttons open it.",
          "error": "Placeholder Data 'Answer link': value is required",
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The Xero account code a written-off short pay is booked to.",
          "error": null,
          "name": "Write-off account code",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-26T05:48:50.348Z"
}
