{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "19101D02-F761-4BED-9115-D3D924EE556F",
    "name": "Holded: paid Shopify order to invoice"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 89.26900301624164,
        "y": -90.4082518479454,
        "zoom": 0.5555543643275472
      },
      "autoSave": true,
      "descriptions": {
        "flow": "When a Shopify order is paid, finds the buyer in Holded by tax number (adding them if new), raises the invoice unapproved with the order's lines, tax rates and sales channel, checks the totals and records the payment on your bank account in Holded.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a Shopify order is paid, finds the buyer in Holded by tax number (adding them if new), raises the invoice unapproved with the order's lines, tax rates and sales channel, attaches an order confirmation, checks the totals and records the payment on your bank account in Holded.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Triggers when a new order is created in your Shopify store. Polling interval can be customized (minimum 30 seconds). Each cycle inspects the 50 most recent orders, so bursts of more than 50 new orders between polls may be missed.",
          "elementId": "EXTENSION:::SHARED:::default:::shopify:::onNewOrder",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::shopify:::onNewOrder",
          "newElementId": "EXTENSION:::SHARED:::default:::shopify:::onNewOrder",
          "legacyElementId": "JS###v1###Shopify###onNewOrder",
          "methodName": "onNewOrder",
          "position": {
            "x": 110,
            "y": 220
          }
        },
        "flowElementId": "FCD64860-3B76-47D1-B39A-BB221152D521",
        "groupId": null,
        "id": "03F5F546-8FB0-45BA-AD3C-548C9D9EE277",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New Shopify order', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewOrder",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Shopify order",
          "serviceId": "shopify",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New Shopify order",
        "nextElementIds": [
          "8770C365-427E-46E9-94A8-F07EB2D0CD0F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Records a payment against a Holded document, which is what settles an invoice.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::payDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Record the Shopify payment Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::payDocument",
          "legacyElementId": "JS###v1###HoldedService###payDocument",
          "methodName": "payDocument",
          "position": {
            "x": 1493.793018007076,
            "y": 1148.802377505606
          }
        },
        "flowElementId": "F3485C35-BE02-4A1E-B4E4-2D044B97739C",
        "groupId": null,
        "id": "7E7B24FC-4CC0-4154-B54E-BDA365209830",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C84683AD-7731-439A-B92B-219CD381B45A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "amount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Holded invoice",
                    "subPathSegments": [
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A9845A61-2C54-46E3-87B5-7F276E841A1E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "invoice"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "treasuryId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Buyer match",
                    "subPathSegments": [
                      {
                        "key": "treasuryId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice prep",
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "description",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  }
                ],
                "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": "payDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Payment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Record the Shopify payment",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the bank and cash accounts of a Holded account, which is where a payment's treasury identifier comes from.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::listTreasuryAccounts",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List bank accounts Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::listTreasuryAccounts",
          "legacyElementId": "JS###v1###HoldedService###listTreasuryAccounts",
          "methodName": "listTreasuryAccounts",
          "position": {
            "x": 161.59823230914367,
            "y": 428.79898106902596
          }
        },
        "flowElementId": "D6B292D0-E31C-4F6D-9E15-F034519CEB0A",
        "groupId": null,
        "id": "0F749F02-A9E8-4B24-BC98-BA1CA9BAECF1",
        "metaInfo": {
          "bodyParams": [],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listTreasuryAccounts",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Bank accounts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List bank accounts",
        "nextElementIds": [
          "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single order by its ID with full details including line items, customer, and addresses.",
          "elementId": "EXTENSION:::SHARED:::default:::shopify:::getOrder",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the full order Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shopify:::getOrder",
          "legacyElementId": "JS###v1###Shopify###getOrder",
          "methodName": "getOrder",
          "position": {
            "x": 732,
            "y": 220
          }
        },
        "flowElementId": "3DA5F7AD-699F-4A0C-84C9-84EA03581F82",
        "groupId": null,
        "id": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Shopify order",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "03F5F546-8FB0-45BA-AD3C-548C9D9EE277"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the full order', 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": "getOrder",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Full order",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shopify",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the full order",
        "nextElementIds": [
          "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
        ],
        "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 invoice lines Result"
          },
          "position": {
            "x": 668.1968312790541,
            "y": 857.1998996507374
          }
        },
        "flowElementId": "4290CA0D-756B-40DE-A3B1-C89B1941870A",
        "groupId": null,
        "id": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "order",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const parse = (v) => {\n  if (typeof v === 'string') {\n    try { return JSON.parse(v); } catch (e) { return v; }\n  }\n  return v;\n};\nconst o = parse(order) || {};\nconst r = parse(reading) || {};\nconst num = (v) => {\n  const n = Number(v);\n  return Number.isFinite(n) ? n : 0;\n};\nconst items = (Array.isArray(r.items) ? r.items : []).map((i) => ({\n  name: String(i.name || 'Item'),\n  desc: String(i.desc || ''),\n  sku: String(i.sku || ''),\n  units: num(i.units) || 1,\n  subtotal: Math.round(num(i.subtotal) * 10000) / 10000,\n  tax: num(i.tax),\n  discount: num(i.discount),\n}));\nif (!items.length) throw new Error(`No invoice lines could be read from Shopify order ${o.name}.`);\nconst orderTotal = Math.round(num(o.totalPrice) * 100) / 100;\nconst orderNumber = String(o.name || '').replace('#', '');\nreturn {\n  items,\n  date: String(o.processedAt || o.createdAt || new Date().toISOString()).slice(0, 10),\n  orderNumber,\n  orderTotal,\n  totalLow: Math.round((orderTotal - 0.01) * 100) / 100,\n  totalHigh: Math.round((orderTotal + 0.01) * 100) / 100,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Invoice prep",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Prepare the invoice lines",
        "nextElementIds": [
          "C84683AD-7731-439A-B92B-219CD381B45A"
        ],
        "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": "Flag the invoice to finance Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1126.5922306513232,
            "y": 1159.602014704426
          }
        },
        "flowElementId": "90EA0D5B-4498-417E-A623-88D5594B2F89",
        "groupId": null,
        "id": "5EFEDD44-FD76-4E51-8438-5121B4C47A51",
        "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": "The invoice for Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " ("
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "buyerName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ") is in Holded, unapproved, but its total of "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Holded invoice",
                    "subPathSegments": [
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A9845A61-2C54-46E3-87B5-7F276E841A1E"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " does not match the order total of "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice prep",
                    "subPathSegments": [
                      {
                        "key": "orderTotal",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "currency",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". No payment was recorded. Check the lines and tax rates before you approve it."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Mismatch notice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Flag the invoice to finance",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 416,
            "y": 230
          }
        },
        "flowElementId": "EA95A8E6-847B-4D4B-B2FF-A23FB5623C11",
        "groupId": null,
        "id": "8770C365-427E-46E9-94A8-F07EB2D0CD0F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "3cbc84eb-98ad-430e-b728-d5bf42869ad2",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Shopify order",
                      "subPathSegments": [
                        {
                          "key": "financialStatus",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "03F5F546-8FB0-45BA-AD3C-548C9D9EE277"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "PAID"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "3cbc84eb-98ad-430e-b728-d5bf42869ad2"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Order paid",
          "storeResult": false,
          "thenComponent": {
            "componentId": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3",
            "componentType": "ELEMENT"
          }
        },
        "name": "Order paid?",
        "nextElementIds": [
          "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the contacts on a Holded account: clients, suppliers, debtors, creditors and leads.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::listContacts",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List Holded contacts Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::listContacts",
          "legacyElementId": "JS###v1###HoldedService###listContacts",
          "methodName": "listContacts",
          "position": {
            "x": 742.6007217427733,
            "y": 430.59898492861305
          }
        },
        "flowElementId": "F02101FF-766E-4B0D-AAC4-EA8FBFCD7FE3",
        "groupId": null,
        "id": "223244F1-B43F-4FF0-AC54-CAB5EC5C0E33",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phone",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mobile",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "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": "listContacts",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Holded contacts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List Holded contacts",
        "nextElementIds": [
          "273C1FAC-6198-42FF-927E-54CDDB4175BB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a contact on a Holded account, as a client, supplier, debtor, creditor or lead.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::createContact",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add the buyer to Holded Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::createContact",
          "legacyElementId": "JS###v1###HoldedService###createContact",
          "methodName": "createContact",
          "position": {
            "x": 320.59670777226944,
            "y": 846.600027017109
          }
        },
        "flowElementId": "1A450011-D505-498F-AB14-D09797B9C964",
        "groupId": null,
        "id": "473D2901-A59A-4FFC-AF18-FFCC0F7091FA",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "buyerName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "client"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "code",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Buyer match",
                    "subPathSegments": [
                      {
                        "key": "contactCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phone",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mobile",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "isPerson",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "isPerson",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "iban",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "swift",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "taxOperation",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "shippingAddresses",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "customId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "note",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Added from Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billAddress",
              "type": "OBJECT",
              "value": [
                {
                  "name": "address",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Order reading",
                        "subPathSegments": [
                          {
                            "key": "output",
                            "optional": false
                          },
                          {
                            "key": "billAddress",
                            "optional": false
                          },
                          {
                            "key": "address",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "city",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Order reading",
                        "subPathSegments": [
                          {
                            "key": "output",
                            "optional": false
                          },
                          {
                            "key": "billAddress",
                            "optional": false
                          },
                          {
                            "key": "city",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "postalCode",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Order reading",
                        "subPathSegments": [
                          {
                            "key": "output",
                            "optional": false
                          },
                          {
                            "key": "billAddress",
                            "optional": false
                          },
                          {
                            "key": "postalCode",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "province",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Order reading",
                        "subPathSegments": [
                          {
                            "key": "output",
                            "optional": false
                          },
                          {
                            "key": "billAddress",
                            "optional": false
                          },
                          {
                            "key": "province",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "country",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Order reading",
                        "subPathSegments": [
                          {
                            "key": "output",
                            "optional": false
                          },
                          {
                            "key": "billAddress",
                            "optional": false
                          },
                          {
                            "key": "country",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                      }
                    ],
                    "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": "createContact",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New contact",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add the buyer to Holded",
        "nextElementIds": [
          "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 482.39767652861224,
            "y": 615.9993824660764
          }
        },
        "flowElementId": "F5058D50-5AE2-420D-A2BC-A18B8E08B781",
        "groupId": null,
        "id": "52C2A3E6-0EBD-4C92-BCD5-788B3CC5A361",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "3ecf7ca9-c2b8-44fe-b99e-636cab87702d",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Buyer match",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "3ecf7ca9-c2b8-44fe-b99e-636cab87702d"
            ]
          },
          "elseComponent": {
            "componentId": "473D2901-A59A-4FFC-AF18-FFCC0F7091FA",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Buyer found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7",
            "componentType": "ELEMENT"
          }
        },
        "name": "Buyer already in Holded?",
        "nextElementIds": [
          "473D2901-A59A-4FFC-AF18-FFCC0F7091FA",
          "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1284.793191688492,
            "y": 992.201848742184
          }
        },
        "flowElementId": "FA472658-F141-434B-BA74-47CE65065971",
        "groupId": null,
        "id": "201145BE-0DAA-4C40-8D16-4D0C31FF0C10",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "ee62dbf2-b6ad-4807-8bc7-cfa8494bd48c",
                "nestedOperation": null,
                "operation": ">=",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Holded invoice",
                      "subPathSegments": [
                        {
                          "key": "total",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "A9845A61-2C54-46E3-87B5-7F276E841A1E"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "DOUBLE",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Invoice prep",
                        "subPathSegments": [
                          {
                            "key": "totalLow",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              },
              {
                "id": "90e7fd38-d279-4fe6-aef9-a8dbc2d5b028",
                "nestedOperation": null,
                "operation": "<=",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Holded invoice",
                      "subPathSegments": [
                        {
                          "key": "total",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "A9845A61-2C54-46E3-87B5-7F276E841A1E"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "DOUBLE",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "ELEMENT_RESULT",
                        "label": "Invoice prep",
                        "subPathSegments": [
                          {
                            "key": "totalHigh",
                            "optional": false
                          }
                        ],
                        "type": "ELEMENT_LINK",
                        "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "ee62dbf2-b6ad-4807-8bc7-cfa8494bd48c",
              "AND",
              "90e7fd38-d279-4fe6-aef9-a8dbc2d5b028"
            ]
          },
          "elseComponent": {
            "componentId": "5EFEDD44-FD76-4E51-8438-5121B4C47A51",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Totals match",
          "storeResult": false,
          "thenComponent": {
            "componentId": "7E7B24FC-4CC0-4154-B54E-BDA365209830",
            "componentType": "ELEMENT"
          }
        },
        "name": "Invoice matches the order?",
        "nextElementIds": [
          "7E7B24FC-4CC0-4154-B54E-BDA365209830",
          "5EFEDD44-FD76-4E51-8438-5121B4C47A51"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the sales channels of a Holded account.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::listSalesChannels",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List sales channels Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::listSalesChannels",
          "legacyElementId": "JS###v1###HoldedService###listSalesChannels",
          "methodName": "listSalesChannels",
          "position": {
            "x": 461.99949825368697,
            "y": 432.39898878820003
          }
        },
        "flowElementId": "4066C9BE-9EC8-4673-8E69-F41FCB5BBA92",
        "groupId": null,
        "id": "273C1FAC-6198-42FF-927E-54CDDB4175BB",
        "metaInfo": {
          "bodyParams": [],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listSalesChannels",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sales channels",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List sales channels",
        "nextElementIds": [
          "0F749F02-A9E8-4B24-BC98-BA1CA9BAECF1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1072,
            "y": 430
          }
        },
        "flowElementId": "63B51A73-6ECD-42A4-B532-252A0A278AEC",
        "groupId": null,
        "id": "52F05F2B-8E84-4E69-8454-A317D060AB95",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f727a60d-82de-4139-bc13-0f150a3d7cdb",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Order reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "taxNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "f727a60d-82de-4139-bc13-0f150a3d7cdb"
            ]
          },
          "elseComponent": {
            "componentId": "9874F8AD-CD00-4520-9798-B307C3ACCB87",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has tax number",
          "storeResult": false,
          "thenComponent": {
            "componentId": "223244F1-B43F-4FF0-AC54-CAB5EC5C0E33",
            "componentType": "ELEMENT"
          }
        },
        "name": "Tax number on the order?",
        "nextElementIds": [
          "223244F1-B43F-4FF0-AC54-CAB5EC5C0E33",
          "9874F8AD-CD00-4520-9798-B307C3ACCB87"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Match the buyer by tax number Result"
          },
          "position": {
            "x": 125.79753372389243,
            "y": 614.1993786064893
          }
        },
        "flowElementId": "A3D30575-A6E2-4731-94AD-BEAD5E6BE0F1",
        "groupId": null,
        "id": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "taxNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "taxNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contacts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Holded contacts",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "223244F1-B43F-4FF0-AC54-CAB5EC5C0E33"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channels",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sales channels",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "273C1FAC-6198-42FF-927E-54CDDB4175BB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bank accounts",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "0F749F02-A9E8-4B24-BC98-BA1CA9BAECF1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Holded sales channel",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Holded sales channel"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accountName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Holded bank account",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Holded bank account"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const arr = (v) => {\n  if (typeof v === 'string') {\n    try { v = JSON.parse(v); } catch (e) { return []; }\n  }\n  return Array.isArray(v) ? v : [];\n};\nconst norm = (v) => String(v || '').toUpperCase().replace(/[^A-Z0-9]/g, '');\n// Compare tax numbers without spaces, dashes or a leading country prefix such as ES\nconst bare = (v) => {\n  const n = norm(v);\n  return /^[A-Z]{2}/.test(n) && n.length > 9 ? n.slice(2) : n;\n};\nconst wanted = bare(taxNumber);\nconst match = arr(contacts).find((c) => c && c.code && bare(c.code) === wanted);\nconst pick = (rows, name, what) => {\n  const key = String(name || '').trim().toLowerCase();\n  const hit = arr(rows).find((r) => String(r.name || '').trim().toLowerCase() === key);\n  if (!hit) throw new Error(`No Holded ${what} named \"${name}\". Fix the flow setting or create it in Holded.`);\n  return hit.id;\n};\nreturn {\n  found: Boolean(match),\n  contactId: match ? match.id : '',\n  contactCode: match ? match.code : norm(taxNumber),\n  salesChannelId: pick(channels, channelName, 'sales channel'),\n  treasuryId: pick(accounts, accountName, 'bank account'),\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Buyer match",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Match the buyer by tax number",
        "nextElementIds": [
          "52C2A3E6-0EBD-4C92-BCD5-788B3CC5A361"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Reads one Holded document with its lines and totals.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::getDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoice back Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::getDocument",
          "legacyElementId": "JS###v1###HoldedService###getDocument",
          "methodName": "getDocument",
          "position": {
            "x": 1010.993226424775,
            "y": 983.2018294442489
          }
        },
        "flowElementId": "CFF12C44-6400-47EF-96A4-A051E56B336A",
        "groupId": null,
        "id": "A9845A61-2C54-46E3-87B5-7F276E841A1E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C84683AD-7731-439A-B92B-219CD381B45A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "invoice"
                  }
                ],
                "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": "getDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Holded invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the invoice back",
        "nextElementIds": [
          "201145BE-0DAA-4C40-8D16-4D0C31FF0C10"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the buyer and lines Result"
          },
          "tools": {},
          "position": {
            "x": 1032,
            "y": 220
          }
        },
        "flowElementId": "C8125DA7-B1AF-4F95-AD05-C52AD18A3850",
        "groupId": null,
        "id": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Order reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read a paid Shopify order so it can be invoiced in Holded, the Spanish accounting system. Reply with JSON only, with these fields:\ntaxNumber: the buyer's tax number (a Spanish NIF, CIF or NIE, or an EU VAT number) exactly as written on the order. Look in the order's custom attributes first (a checkout field such as \"VAT number\" or \"NIF\"), then the order note, then the tags. Empty text if the order has none. Never guess or invent one.\nbuyerName: the name to invoice: the billing company if there is one, otherwise the company named next to the tax number, otherwise the billing name, otherwise the customer's name.\nisPerson: true when the buyer is a private person, false when it is a company.\nemail: the buyer's email address.\nbillAddress: an object with address, city, postalCode, province and country (the two letter country code), taken from the billing address. Empty text for any part the order does not have.\nitems: the invoice lines, one per order line, plus one line named Shipping when shipping was charged. Each line is an object with name, desc (the variant title, or empty text), sku (or empty text), units (a number), subtotal (the unit price before tax and after any discount on that line, as a number), tax (the VAT rate in percent as a number, for example 21) and discount (0).\n\nEach order line has quantity, price (the product's list price), discountedPrice (what the buyer paid for the whole line) and taxLines, the tax Shopify charged on it. A line's tax rate is the sum of ratePercentage over its taxLines; 0 when it has none. Shipping takes the rate of the order lines, the highest when they differ. Work out whether the shop's prices include tax: when subtotal plus shipping already equals the total, prices include tax and you must take the tax out of each unit price; when the total equals subtotal plus shipping plus tax, prices exclude tax. With tax, the lines must add up to the order total."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Shopify order "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", placed "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "createdAt",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", currency "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "currency",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nCustom attributes: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "customAttributes",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nOrder note: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "note",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nTags: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "tags",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nEmail: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "email",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nCustomer: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "customer",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nBilling address: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "billingAddress",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nLines:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "lineItems",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nSubtotal: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "subtotalPrice",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nShipping: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "totalShipping",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nDiscounts: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "totalDiscounts",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nTax: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "totalTax",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nTotal: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Full order",
                "subPathSegments": [
                  {
                    "key": "totalPrice",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the buyer and lines",
        "nextElementIds": [
          "52F05F2B-8E84-4E69-8454-A317D060AB95"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a Holded invoice, sales receipt, credit note, sales order, proforma, waybill, estimate, purchase invoice, purchase order or purchase refund.",
          "elementId": "EXTENSION:::SHARED:::default:::holded:::createDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Raise the invoice unapproved Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::holded:::createDocument",
          "legacyElementId": "JS###v1###HoldedService###createDocument",
          "methodName": "createDocument",
          "position": {
            "x": 661.1961944471955,
            "y": 983.2001698218289
          }
        },
        "flowElementId": "3CF671D7-451D-4C30-AAC3-10EDE028B555",
        "groupId": null,
        "id": "C84683AD-7731-439A-B92B-219CD381B45A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice prep",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "invoice"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contactId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contactCode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Buyer match",
                    "subPathSegments": [
                      {
                        "key": "contactCode",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contactName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contactEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice prep",
                    "subPathSegments": [
                      {
                        "key": "date",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF6F2C1D-5DFA-441E-88ED-68CFD946C1E7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoiceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "numberingSeriesId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "description",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "notes",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "currency",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "currency",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "currencyChange",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "language",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paymentMethodId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "salesChannelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Buyer match",
                    "subPathSegments": [
                      {
                        "key": "salesChannelId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "972948C1-DA65-4BE0-B0F7-CD4E5A44BBAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "warehouseId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "designId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFields",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "applyContactDefaults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "approve",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "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": "createDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "holded",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Raise the invoice unapproved",
        "nextElementIds": [
          "A9845A61-2C54-46E3-87B5-7F276E841A1E"
        ],
        "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": "Send the order to finance Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1078,
            "y": 608
          }
        },
        "flowElementId": "714324A2-E91C-4C2E-8CE9-D39D29834838",
        "groupId": null,
        "id": "9874F8AD-CD00-4520-9798-B307C3ACCB87",
        "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": "Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " from "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "buyerName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " ("
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2C1D4602-8C02-4C19-9D92-BAD6AA22B149"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ") is paid, but it carries no tax number, so no invoice was raised in Holded. Ask the buyer for their NIF or VAT number, or invoice it by hand. Total: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "totalPrice",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Full order",
                    "subPathSegments": [
                      {
                        "key": "currency",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6BF243E-0358-4361-8148-8EA4CAF8A1E3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "No tax number notice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the order to finance",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "03F5F546-8FB0-45BA-AD3C-548C9D9EE277",
    "groups": [],
    "id": "F2D0DB3C-EF20-408E-BB10-58CAE3059494",
    "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": "Your Anthropic key, used by the AI step that reads the order.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The name of the Holded sales channel your Shopify invoices belong to, exactly as it appears in Holded.",
          "error": null,
          "name": "Holded sales channel",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The name of the Holded treasury account your Shopify payouts land in, exactly as it appears in Holded.",
          "error": null,
          "name": "Holded bank account",
          "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-17T10:03:35.928Z"
}
