{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "B686EBB5-C6B8-42C2-84EE-3BE93A594AE2",
    "name": "Abstract API: EU billing details checked"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -54.07452657299939,
        "y": 5.7910812461820385,
        "zoom": 0.86
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Checks a new customer's billing record in Airtable every 5 minutes. Validates the EU VAT number and the IBAN with Abstract API. When the VAT number is valid, registered to the customer's name and the IBAN is valid, marks the record ready for reverse charge. Otherwise gets the country's VAT rates and the VAT at the standard rate, asks the finance controller in Slack (reverse charge, charge VAT, or ask the customer), and writes the answer and the evidence back to the record.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a new customer's billing record lands in Airtable, validates the VAT number and IBAN with Abstract API. A valid number registered to the customer marks the record ready for reverse charge; anything else goes to the finance controller in Slack with the VAT options, and the answer is written back to the record.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 985,
            "y": 519
          }
        },
        "flowElementId": "C4C15B44-3600-4B8C-BF19-5616365AB12A",
        "groupId": null,
        "id": "E6FC9CAC-8AAC-49E6-A83E-A1520FCC0E11",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Finance decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the controller's answer",
        "nextElementIds": [
          "B63F8D42-8E77-4579-B653-9C5A385A5712"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Compare the registered name Result"
          },
          "position": {
            "x": 1401,
            "y": 219
          }
        },
        "flowElementId": "1E73E91A-EED8-4FC0-A972-347DA36D286C",
        "groupId": null,
        "id": "B04DA3E7-A061-456B-9D42-F21B379AC103",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "VAT check",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "04CC0250-9A62-4271-8A54-0B1DFDEF1020"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "iban",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "IBAN check",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "87CBF2E9-0A36-4BEF-8368-7155C339C01A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const legal = /\\b(gmbh|ag|ug|kg|ohg|gbr|e\\.?k\\.?|ltd|limited|llc|inc|corp|plc|bv|b\\.v\\.|nv|n\\.v\\.|sa|s\\.a\\.|sas|sarl|sl|s\\.l\\.|srl|s\\.r\\.l\\.|spa|s\\.p\\.a\\.|ab|oy|oyj|as|aps|a\\/s|sp\\.? z\\.? ?o\\.? ?o\\.?|s\\.? ?r\\.? ?o\\.?|kft|zrt|sia|uab|the|co|company|holding|group)\\b/g;\nconst clean = s => String(s || '').toLowerCase().replace(legal, ' ').replace(/[^a-z0-9]+/g, ' ').trim();\nconst valid = !!(vat && vat.valid === true);\nconst registeredName = (vat && vat.company && vat.company.name) || '';\nconst registeredAddress = ((vat && vat.company && vat.company.address) || '').replace(/\\s*\\n\\s*/g, ', ');\nconst registeredCountry = (vat && vat.country && vat.country.name) || '';\nconst a = clean(company);\nconst b = clean(registeredName);\nconst nameMatches = valid && a.length >= 3 && b.length >= 3 && (a === b || a.includes(b) || b.includes(a));\nconst ibanValid = !!(iban && iban.is_valid === true);\nconst today = new Date().toISOString().slice(0, 10);\nreturn {\n  valid,\n  registeredName,\n  registeredAddress,\n  registeredCountry,\n  nameMatches,\n  ibanValid,\n  clear: nameMatches && ibanValid,\n  readyFields: {\n    'Billing check': 'Ready for reverse charge',\n    'Registered name': registeredName,\n    'Registered address': registeredAddress,\n    'VAT number valid': 'Yes',\n    'IBAN valid': 'Yes',\n    'Checked on': today,\n  },\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Billing check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Compare the registered name",
        "nextElementIds": [
          "334BB1A7-EA26-4368-8A44-AFC9A99E0555"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Prepare the record update Result"
          },
          "position": {
            "x": 1412,
            "y": 519
          }
        },
        "flowElementId": "BEF1F1FC-96ED-45D0-99E4-D6B34B5C8B43",
        "groupId": null,
        "id": "B63F8D42-8E77-4579-B653-9C5A385A5712",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "decision",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Finance decision",
                    "subPathSegments": [
                      {
                        "key": "decision",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "E6FC9CAC-8AAC-49E6-A83E-A1520FCC0E11"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "countryCode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "countryCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "check",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing check",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "B04DA3E7-A061-456B-9D42-F21B379AC103"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "calc",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "VAT amount",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "14651BA7-BEDF-45E0-98A8-AFE93B447782"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const c = check || {};\nconst yesNo = v => (v ? 'Yes' : 'No');\nconst money = n => Number(n).toFixed(2);\nconst pct = r => (Number(r) * 100).toFixed(Number(r) * 100 % 1 ? 1 : 0) + '%';\nconst today = new Date().toISOString().slice(0, 10);\nlet status;\nlet note;\nif (decision === 'reverse') {\n  status = c.registeredName ? `Reverse charge, invoice to ${c.registeredName}` : 'Reverse charge';\n  note = `Finance decided: reverse charge${c.registeredName ? ', invoiced to ' + c.registeredName : ''}. The record is updated.`;\n} else if (decision === 'vat') {\n  status = calc && calc.vat_rate != null ? `Charge ${countryCode} VAT at ${pct(calc.vat_rate)}` : `Charge ${countryCode} VAT at the standard rate`;\n  note = calc && calc.vat_amount != null\n    ? `Finance decided: charge ${countryCode} VAT at ${pct(calc.vat_rate)}: ${money(calc.vat_amount)} VAT on ${money(calc.amount_excluding_vat)}, ${money(calc.amount_including_vat)} gross. The record is updated.`\n    : `Finance decided: charge ${countryCode} VAT at the standard rate. The record is updated.`;\n} else {\n  status = 'Ask the customer which entity is buying';\n  note = `Finance decided: ask ${company || 'the customer'} which entity is buying before the first invoice. The record is updated.`;\n}\nconst fields = {\n  'Billing check': status,\n  'Registered name': c.registeredName || '',\n  'Registered address': c.registeredAddress || '',\n  'VAT number valid': yesNo(c.valid),\n  'IBAN valid': yesNo(c.ibanValid),\n  'Checked on': today,\n};\nif (decision === 'vat' && calc && calc.vat_amount != null) {\n  fields['VAT amount'] = Number(calc.vat_amount);\n  fields['Gross amount'] = Number(calc.amount_including_vat);\n}\nreturn { fields, note, status };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Record update",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Prepare the record update",
        "nextElementIds": [
          "186C56C7-307F-456D-819E-7BFE24D70E2F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates specific fields in an existing Airtable record while preserving other field values. Perfect for AI agents to modify data based on processed information or user interactions.",
          "elementId": "EXTENSION:::SHARED:::default:::airtable:::updateRecord",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Mark the record ready for reverse charge Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::airtable:::updateRecord",
          "legacyElementId": "JS###v1###Airtable###updateRecord",
          "methodName": "updateRecord",
          "position": {
            "x": 505,
            "y": 340
          }
        },
        "flowElementId": "9F3F041C-3C02-41A9-A9E6-B661102A914E",
        "groupId": null,
        "id": "46D23069-762E-4D78-97C7-E1B7576BFAC8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "baseId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Airtable base",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Airtable base"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tableIdOrName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Billing table",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Billing table"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "recordId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "recordId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fields",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing check",
                    "subPathSegments": [
                      {
                        "key": "readyFields",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B04DA3E7-A061-456B-9D42-F21B379AC103"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "typecast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Mark the record ready for reverse charge', Error: The placeholder \"Airtable base\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "updateRecord",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ready record",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "airtable",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Mark the record ready for reverse charge",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Checks whether an EU VAT number is valid with the VAT Validation API and, when it is, returns the registered company name, address and country. Uses the VAT Validation API key.",
          "elementId": "EXTENSION:::SHARED:::default:::abstract-api:::validateVatNumber",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Validate the VAT number with Abstract API Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::abstract-api:::validateVatNumber",
          "legacyElementId": null,
          "methodName": "validateVatNumber",
          "position": {
            "x": 946,
            "y": 40
          }
        },
        "flowElementId": "14921323-F9AD-41C3-919D-FDD72859B320",
        "groupId": null,
        "id": "04CC0250-9A62-4271-8A54-0B1DFDEF1020",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vatNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "vatNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "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": "validateVatNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "VAT check",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "abstract-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Validate the VAT number with Abstract API",
        "nextElementIds": [
          "87CBF2E9-0A36-4BEF-8368-7155C339C01A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Checks whether an International Bank Account Number (IBAN) is valid, with the IBAN Validation API. Uses the IBAN Validation API key.",
          "elementId": "EXTENSION:::SHARED:::default:::abstract-api:::validateIban",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Validate the IBAN Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::abstract-api:::validateIban",
          "legacyElementId": null,
          "methodName": "validateIban",
          "position": {
            "x": 1433,
            "y": 40
          }
        },
        "flowElementId": "A2F760F8-21AE-48C9-89CF-40C4949CEA07",
        "groupId": null,
        "id": "87CBF2E9-0A36-4BEF-8368-7155C339C01A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "iban",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "iban",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "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": "validateIban",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "IBAN check",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "abstract-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Validate the IBAN",
        "nextElementIds": [
          "B04DA3E7-A061-456B-9D42-F21B379AC103"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the billing record Result"
          },
          "position": {
            "x": 568,
            "y": 49
          }
        },
        "flowElementId": "81805D04-41A0-44D5-A266-DAA288117D86",
        "groupId": null,
        "id": "634A394A-21C0-4725-9971-EF046BD4ABCF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "record",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Billing record",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "8AC5D0D6-719C-4A01-8CDC-410B0B7D3E8A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const fields = (record && record.fields) || {};\nconst str = v => (v == null ? '' : Array.isArray(v) ? v.join(', ') : String(v)).trim();\nconst norm = s => String(s).toLowerCase().replace(/[^a-z0-9]/g, '');\nconst pick = (...names) => {\n  const wanted = names.map(norm);\n  const key = Object.keys(fields).find(k => wanted.includes(norm(k)));\n  return key ? str(fields[key]) : '';\n};\nconst company = pick('Company', 'Company name', 'Customer', 'Customer name', 'Name', 'Legal name');\nconst vatNumber = pick('VAT number', 'VAT', 'VAT ID', 'VAT no', 'Tax ID').replace(/[\\s.-]/g, '').toUpperCase();\nconst iban = pick('IBAN', 'Bank account', 'Account number').replace(/\\s/g, '').toUpperCase();\nconst amountText = pick('Net amount', 'Amount', 'Invoice amount', 'First invoice', 'Net').replace(/[^0-9.,-]/g, '').replace(/,(?=\\d{3}(\\D|$))/g, '').replace(',', '.');\nconst netAmount = amountText ? Number(amountText) : 0;\nconst countries = { austria: 'AT', belgium: 'BE', bulgaria: 'BG', cyprus: 'CY', czechia: 'CZ', 'czech republic': 'CZ', germany: 'DE', denmark: 'DK', estonia: 'EE', greece: 'EL', spain: 'ES', finland: 'FI', france: 'FR', croatia: 'HR', hungary: 'HU', ireland: 'IE', italy: 'IT', lithuania: 'LT', luxembourg: 'LU', latvia: 'LV', malta: 'MT', netherlands: 'NL', 'the netherlands': 'NL', poland: 'PL', portugal: 'PT', romania: 'RO', sweden: 'SE', slovenia: 'SI', slovakia: 'SK', 'northern ireland': 'XI' };\nlet countryCode = pick('Country code', 'Country', 'Billing country');\nif (countries[countryCode.toLowerCase()]) countryCode = countries[countryCode.toLowerCase()];\ncountryCode = countryCode.toUpperCase().slice(0, 2);\nif (countryCode === 'GR') countryCode = 'EL';\nif (!/^[A-Z]{2}$/.test(countryCode) && /^[A-Z]{2}/.test(vatNumber)) countryCode = vatNumber.slice(0, 2);\nreturn { recordId: record && record.id, company, countryCode, vatNumber, iban, netAmount: Number.isFinite(netAmount) ? netAmount : 0 };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Billing details",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the billing record",
        "nextElementIds": [
          "04CC0250-9A62-4271-8A54-0B1DFDEF1020"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the finance controller Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 558,
            "y": 510
          }
        },
        "flowElementId": "7120184D-5E0C-4688-963A-B0E4EE7DDA5F",
        "groupId": null,
        "id": "7A9FD619-59E5-4913-8794-068AFA7FE293",
        "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": "Finance question",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3CB7861F-E8A9-40C6-8316-7182233AA834"
                  }
                ],
                "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": "Finance question",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3CB7861F-E8A9-40C6-8316-7182233AA834"
                  }
                ],
                "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": "Finance message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the finance controller",
        "nextElementIds": [
          "E6FC9CAC-8AAC-49E6-A83E-A1520FCC0E11"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Calculates the VAT on an amount for a country with the VAT Validation API: the amount excluding and including VAT, the VAT amount and the rate applied. Can split VAT out of an amount that already includes it, and apply a reduced rate for a category of goods. Uses the VAT Validation API key.",
          "elementId": "EXTENSION:::SHARED:::default:::abstract-api:::calculateVat",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Calculate VAT at the standard rate Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::abstract-api:::calculateVat",
          "legacyElementId": null,
          "methodName": "calculateVat",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "A4AFFC30-E00A-4C4D-98A3-992BF22884F4",
        "groupId": null,
        "id": "14651BA7-BEDF-45E0-98A8-AFE93B447782",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "amount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "netAmount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "countryCode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "countryCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "isVatIncl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vatCategory",
              "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": "calculateVat",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "VAT amount",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "abstract-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Calculate VAT at the standard rate",
        "nextElementIds": [
          "3CB7861F-E8A9-40C6-8316-7182233AA834"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for finance Result"
          },
          "position": {
            "x": 126,
            "y": 519
          }
        },
        "flowElementId": "3BEE8DD7-F9BC-4632-B368-BDB4D25B84C6",
        "groupId": null,
        "id": "3CB7861F-E8A9-40C6-8316-7182233AA834",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "countryCode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "countryCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vatNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "vatNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "iban",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "iban",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "netAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "netAmount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "check",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing check",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "B04DA3E7-A061-456B-9D42-F21B379AC103"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rates",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "VAT rates",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "457C8C6A-1B7F-447A-8CAE-F011C9CD1E5D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "calc",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "VAT amount",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "14651BA7-BEDF-45E0-98A8-AFE93B447782"
                  }
                ],
                "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 c = check || {};\nconst pct = r => (Number(r) * 100).toFixed(Number(r) * 100 % 1 ? 1 : 0) + '%';\nconst money = n => Number(n).toFixed(2);\nconst link = decision => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst reasons = [];\nif (!c.valid) reasons.push(`The VAT number ${vatNumber || '(none given)'} is not valid.`);\nelse if (!c.nameMatches) reasons.push(`The VAT number ${vatNumber} is valid, but it is registered to ${c.registeredName}${c.registeredAddress ? ' (' + c.registeredAddress + ')' : ''}, not the name on the order.`);\nelse reasons.push(`The VAT number ${vatNumber} is valid and registered to ${c.registeredName}.`);\nreasons.push(c.ibanValid ? `The IBAN ${iban} is valid.` : `The IBAN ${iban || '(none given)'} is not valid.`);\nconst list = Array.isArray(rates) ? rates : [];\nconst standard = list.find(r => r.category === 'standard');\nconst reduced = list.filter(r => r.category !== 'standard').map(r => `${r.category} ${pct(r.rate)}`);\nconst vatLine = calc && calc.vat_amount != null\n  ? `German-style domestic invoice at the standard rate ${pct(calc.vat_rate)}: ${money(calc.amount_excluding_vat)} net, ${money(calc.vat_amount)} VAT, ${money(calc.amount_including_vat)} gross.`.replace('German-style domestic', 'Domestic')\n  : (standard ? `Standard rate in ${countryCode}: ${pct(standard.rate)}.` : '');\nconst lines = [\n  `*Billing check: ${company || 'new customer'}${countryCode ? ', ' + countryCode : ''}*`,\n  ...reasons,\n  vatLine,\n  reduced.length ? `Reduced rates in ${countryCode}: ${reduced.join(', ')}.` : null,\n  `First invoice net ${money(netAmount)}. Reverse charge${c.registeredName ? ' as a ' + c.registeredName + ' invoice' : ''}, charge ${countryCode} VAT at the standard rate, or ask the customer which entity is buying?`,\n].filter(Boolean);\nreturn {\n  text: `Billing check for ${company || 'a new customer'} needs a decision`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Reverse charge' }, url: link('reverse') },\n      { type: 'button', text: { type: 'plain_text', text: 'Charge VAT at the standard rate' }, url: link('vat') },\n      { type: 'button', text: { type: 'plain_text', text: 'Ask the customer' }, url: link('ask') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Finance question",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for finance",
        "nextElementIds": [
          "7A9FD619-59E5-4913-8794-068AFA7FE293"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm in the thread Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1019,
            "y": 680
          }
        },
        "flowElementId": "2D363600-7B11-48F0-B62D-AC917CCEC119",
        "groupId": null,
        "id": "DB5DEC55-E4F3-45CB-A163-E135833F5E43",
        "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": "Record update",
                    "subPathSegments": [
                      {
                        "key": "note",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B63F8D42-8E77-4579-B653-9C5A385A5712"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Finance message",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7A9FD619-59E5-4913-8794-068AFA7FE293"
                  }
                ],
                "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": [],
                "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": "Confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm in the thread",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the current VAT rates of a country with the VAT Validation API: the standard rate and each reduced rate with the category of goods it applies to. Uses the VAT Validation API key.",
          "elementId": "EXTENSION:::SHARED:::default:::abstract-api:::getVatCategories",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the country's VAT rates Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::abstract-api:::getVatCategories",
          "legacyElementId": null,
          "methodName": "getVatCategories",
          "position": {
            "x": 551,
            "y": 210
          }
        },
        "flowElementId": "FAF2ABAC-62D3-442F-B325-C4D980514C52",
        "groupId": null,
        "id": "457C8C6A-1B7F-447A-8CAE-F011C9CD1E5D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "countryCode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "countryCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "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": "getVatCategories",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "VAT rates",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "abstract-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the country's VAT rates",
        "nextElementIds": [
          "14651BA7-BEDF-45E0-98A8-AFE93B447782"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates specific fields in an existing Airtable record while preserving other field values. Perfect for AI agents to modify data based on processed information or user interactions.",
          "elementId": "EXTENSION:::SHARED:::default:::airtable:::updateRecord",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the answer to the record Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::airtable:::updateRecord",
          "legacyElementId": "JS###v1###Airtable###updateRecord",
          "methodName": "updateRecord",
          "position": {
            "x": 1398,
            "y": 680
          }
        },
        "flowElementId": "A596429A-CE0A-42D9-B63C-38DB35E6EC68",
        "groupId": null,
        "id": "186C56C7-307F-456D-819E-7BFE24D70E2F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "baseId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Airtable base",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Airtable base"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tableIdOrName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Billing table",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Billing table"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "recordId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Billing details",
                    "subPathSegments": [
                      {
                        "key": "recordId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "634A394A-21C0-4725-9971-EF046BD4ABCF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fields",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Record update",
                    "subPathSegments": [
                      {
                        "key": "fields",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B63F8D42-8E77-4579-B653-9C5A385A5712"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "typecast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Write the answer to the record', Error: The placeholder \"Airtable base\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "updateRecord",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Answered record",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "airtable",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Write the answer to the record",
        "nextElementIds": [
          "DB5DEC55-E4F3-45CB-A163-E135833F5E43"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Monitors an Airtable table for newly created records using configurable polling intervals. Perfect for triggering workflows when fresh data is added. The table needs a field of type \"Created time\" (Add field, then choose Created time): Airtable sorts records only by a field, and the trigger sorts by that one, newest first. Each poll keeps reading pages of 100 while they still hold new records, up to 1,000 records per poll. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::airtable:::onNewRecord",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::airtable:::onNewRecord",
          "newElementId": "EXTENSION:::SHARED:::default:::airtable:::onNewRecord",
          "legacyElementId": "JS###v1###Airtable###onNewRecord",
          "methodName": "onNewRecord",
          "position": {
            "x": 158,
            "y": 40
          }
        },
        "flowElementId": "C99BF2C5-BA1B-43F8-BD8B-E22B503D920B",
        "groupId": null,
        "id": "8AC5D0D6-719C-4A01-8CDC-410B0B7D3E8A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New billing record', Error: Base ID is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewRecord",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Billing record",
          "serviceId": "airtable",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New billing record",
        "nextElementIds": [
          "634A394A-21C0-4725-9971-EF046BD4ABCF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1016,
            "y": 219
          }
        },
        "flowElementId": "403DB04F-E9F1-4467-B341-48502FADD4A5",
        "groupId": null,
        "id": "334BB1A7-EA26-4368-8A44-AFC9A99E0555",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "afbd7a33-2fb5-4529-87dd-7460ea75590d",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Billing check",
                      "subPathSegments": [
                        {
                          "key": "clear",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "B04DA3E7-A061-456B-9D42-F21B379AC103"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "afbd7a33-2fb5-4529-87dd-7460ea75590d"
            ]
          },
          "elseComponent": {
            "componentId": "457C8C6A-1B7F-447A-8CAE-F011C9CD1E5D",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Reverse charge clear",
          "storeResult": false,
          "thenComponent": {
            "componentId": "46D23069-762E-4D78-97C7-E1B7576BFAC8",
            "componentType": "ELEMENT"
          }
        },
        "name": "Reverse charge clear?",
        "nextElementIds": [
          "46D23069-762E-4D78-97C7-E1B7576BFAC8",
          "457C8C6A-1B7F-447A-8CAE-F011C9CD1E5D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "8AC5D0D6-719C-4A01-8CDC-410B0B7D3E8A",
    "groups": [],
    "id": "D07AF37A-08A9-44B5-9CC4-CDDEB6E85864",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "The URL of the block Wait for the controller's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The ID of the Airtable base that holds the billing table (starts with app). The same base as in New billing record.",
          "error": null,
          "name": "Airtable base",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The name or ID of the billing table. The same table as in New billing record.",
          "error": null,
          "name": "Billing table",
          "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-12-02T08:42:43.618Z"
}
