{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "CC76D48E-F338-49FF-B316-E84A3F077DB4",
    "name": "Fatture in Cloud: Shopify order to filed invoice"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 23.5,
        "y": -145.875,
        "zoom": 0.5
      },
      "autoSave": true,
      "descriptions": {
        "flow": "When a Shopify order comes in, finds the client in Fatture in Cloud, checks it can receive an e-invoice, prices and creates the invoice with a payment schedule, checks it against the schema and asks finance in Slack before filing it.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a Shopify order comes in, finds the client in Fatture in Cloud, checks it can receive an e-invoice, prices and creates the invoice with a payment schedule, checks it against the schema and asks finance in Slack before filing it.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for finance Result"
          },
          "position": {
            "x": 564,
            "y": 1420
          }
        },
        "flowElementId": "A88C0AA6-A5BC-454C-B148-98D6F50DAAB9",
        "groupId": null,
        "id": "26176730-5A3A-490F-B45C-9AC2D2A2B4E6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "number",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "numeration",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "numeration",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "client",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "net",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Totals",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "amount_net",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Totals",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "amount_vat",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "gross",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Totals",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "amount_gross",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "due",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Schedule",
                    "subPathSegments": [
                      {
                        "key": "amount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2BE93211-EE80-49A9-91E2-F54D25B266BF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paid",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "paid",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "dueDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "notes",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "notes",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = d => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${d}`;\nconst ref = `${number}${numeration || ''}`;\nconst isPaid = paid === true || paid === 'true';\nconst hasDue = due !== undefined && due !== null && due !== '' && String(due) !== String(gross);\nconst lines = [\n  '*Invoice ready to file with the exchange system*',\n  `Invoice ${ref} for ${client}, from Shopify order ${orderName}.`,\n  `Net ${net} EUR, VAT ${vat} EUR, gross ${gross} EUR` + (hasDue ? `, amount due ${due} EUR.` : '.'),\n  isPaid ? 'Paid in Shopify.' : `Due ${dueDate}.`,\n  'The schema check passed. Filing cannot be recalled, and a mistake after filing needs a credit note.',\n  notes || null,\n].filter(Boolean);\nreturn {\n  text: `Invoice ${ref} for ${client} is ready to file`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'File it' }, url: link('file') },\n      { type: 'button', text: { type: 'plain_text', text: 'Leave it with me' }, url: link('hold') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for finance",
        "nextElementIds": [
          "F163F5BF-BB27-4BC1-80F3-059EF50FA528"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the finance owner Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 926,
            "y": 1418
          }
        },
        "flowElementId": "D926D044-329E-4992-B734-66ADFDD09B50",
        "groupId": null,
        "id": "F163F5BF-BB27-4BC1-80F3-059EF50FA528",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "26176730-5A3A-490F-B45C-9AC2D2A2B4E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "26176730-5A3A-490F-B45C-9AC2D2A2B4E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to finance",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the finance owner",
        "nextElementIds": [
          "E48AEF43-8F9B-4CD1-BAA0-8E3BA1693794"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Invoice step failed Result"
          },
          "position": {
            "x": 1204,
            "y": 948
          }
        },
        "flowElementId": "3905FCAC-AC62-4AC0-B6A6-8D50D0CF5CFB",
        "groupId": null,
        "id": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Check error",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Invoice step failed",
        "nextElementIds": [
          "F058910F-CA4A-4745-99E9-AC6F0C53D6F4"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1598,
            "y": 1418
          }
        },
        "flowElementId": "832C2D03-3182-4445-BCD6-11D68ED06734",
        "groupId": null,
        "id": "BFD76E07-7DAF-4E38-AE0E-68B30949C6C4",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "ca38d8b0-3ec7-4c52-9c68-e4f78c785b23",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Finance decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "E48AEF43-8F9B-4CD1-BAA0-8E3BA1693794"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "file"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "ca38d8b0-3ec7-4c52-9c68-e4f78c785b23"
            ]
          },
          "elseComponent": {
            "componentId": "35458A66-6FB3-4AB5-8E10-47EE56E6F1BD",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "File decision",
          "storeResult": false,
          "thenComponent": {
            "componentId": "15931252-9F68-4440-A6D7-696AD94723A3",
            "componentType": "ELEMENT"
          }
        },
        "name": "File it?",
        "nextElementIds": [
          "15931252-9F68-4440-A6D7-696AD94723A3",
          "35458A66-6FB3-4AB5-8E10-47EE56E6F1BD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 580,
            "y": 636
          }
        },
        "flowElementId": "4E725AD0-4048-4079-A8ED-B44761A85513",
        "groupId": null,
        "id": "E3AFA0B3-9E4A-466F-AA0C-6EFFF05E08BA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "d629df3d-acce-451f-a381-53fc18876d09",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice plan",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "clientReady",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "d629df3d-acce-451f-a381-53fc18876d09"
            ]
          },
          "elseComponent": {
            "componentId": "D85043DC-A15F-49DB-AADA-FC7C0CED4A7F",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Client ready",
          "storeResult": false,
          "thenComponent": {
            "componentId": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D",
            "componentType": "ELEMENT"
          }
        },
        "name": "Client ready for an e-invoice?",
        "nextElementIds": [
          "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D",
          "D85043DC-A15F-49DB-AADA-FC7C0CED4A7F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates an issued Fatture in Cloud document with its line items and payment schedule. Marking it as an electronic invoice does not send it.",
          "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::createIssuedDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::createIssuedDocument",
          "legacyElementId": "JS###v1###FattureInCloudService###createIssuedDocument",
          "methodName": "createIssuedDocument",
          "position": {
            "x": 596,
            "y": 1084
          }
        },
        "flowElementId": "20C7DC14-D557-4213-8953-867AAB496893",
        "groupId": null,
        "id": "B89D3BA6-829C-4F8F-90AA-FE442C988591",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "entityId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "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": "companyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "payments",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Schedule",
                    "subPathSegments": [
                      {
                        "key": "payments",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2BE93211-EE80-49A9-91E2-F54D25B266BF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "date",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "number",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "numeration",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "numeration",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Shopify order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "visibleSubject",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "notes",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "currency",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "language",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "useGrossPrices",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "useGrossPrices",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "eInvoice",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paymentMethodId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "paymentMethodId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "templateId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "properties",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "properties",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the invoice', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createIssuedDocument",
          "onFailElemId": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528",
          "packageId": "default",
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fatture-in-cloud",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the invoice",
        "nextElementIds": [
          "692A2CF8-3283-45F4-AEB6-7339012D3F4B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Computes the totals a Fatture in Cloud document would have, without creating it.",
          "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getIssuedDocumentTotals",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Price the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getIssuedDocumentTotals",
          "legacyElementId": "JS###v1###FattureInCloudService###getIssuedDocumentTotals",
          "methodName": "getIssuedDocumentTotals",
          "position": {
            "x": 608,
            "y": 812
          }
        },
        "flowElementId": "A5A6B839-B13C-4140-9D7B-68B31AF03FD3",
        "groupId": null,
        "id": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "companyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "entityId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "useGrossPrices",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "useGrossPrices",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "properties",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "properties",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Price the invoice', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getIssuedDocumentTotals",
          "onFailElemId": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528",
          "packageId": "default",
          "resultAlias": "Totals",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fatture-in-cloud",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Price the invoice",
        "nextElementIds": [
          "2BE93211-EE80-49A9-91E2-F54D25B266BF"
        ],
        "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": "Tell finance what's missing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 192,
            "y": 810
          }
        },
        "flowElementId": "75D9643A-F1D3-4A14-9B78-3B7F99C83B15",
        "groupId": null,
        "id": "D85043DC-A15F-49DB-AADA-FC7C0CED4A7F",
        "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": "Order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " from "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " ("
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "totalPrice",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": [
                      {
                        "key": "currency",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ") was not invoiced. "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "missing",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " Complete the client record in Fatture in Cloud, then invoice the order there."
                  }
                ],
                "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": "Missing note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell finance what's missing",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Checks a Fatture in Cloud electronic invoice against the Italian exchange system's schema without sending it.",
          "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::verifyEInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check it against the schema Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::verifyEInvoice",
          "legacyElementId": "JS###v1###FattureInCloudService###verifyEInvoice",
          "methodName": "verifyEInvoice",
          "position": {
            "x": 566,
            "y": 1242
          }
        },
        "flowElementId": "F0279A28-7E44-43EE-9A15-D2DCDC9A6A22",
        "groupId": null,
        "id": "692A2CF8-3283-45F4-AEB6-7339012D3F4B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "companyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Check it against the schema', 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": "verifyEInvoice",
          "onFailElemId": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528",
          "packageId": "default",
          "resultAlias": "Verification",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fatture-in-cloud",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check it against the schema",
        "nextElementIds": [
          "26176730-5A3A-490F-B45C-9AC2D2A2B4E6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 1216,
            "y": 1418
          }
        },
        "flowElementId": "27CD6756-7A9F-4FC7-A59A-737057B6DC90",
        "groupId": null,
        "id": "E48AEF43-8F9B-4CD1-BAA0-8E3BA1693794",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Finance decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the finance owner's answer",
        "nextElementIds": [
          "BFD76E07-7DAF-4E38-AE0E-68B30949C6C4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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": 430
          }
        },
        "flowElementId": "3EE9E2AF-5EDE-4FD2-9601-0E7E7CC7C1EB",
        "groupId": null,
        "id": "33DBDDBE-334F-4F77-A9C7-698FA29859E8",
        "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": "New order",
          "serviceId": "shopify",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New Shopify order",
        "nextElementIds": [
          "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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 order Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::shopify:::getOrder",
          "legacyElementId": "JS###v1###Shopify###getOrder",
          "methodName": "getOrder",
          "position": {
            "x": 400,
            "y": 430
          }
        },
        "flowElementId": "C8BF51BD-4DA6-4A29-87F0-F5D9896590BA",
        "groupId": null,
        "id": "202A5E32-C29D-4FB1-81A7-3B95A20C831A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "orderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New order",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "33DBDDBE-334F-4F77-A9C7-698FA29859E8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the 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": "Order",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "shopify",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the order",
        "nextElementIds": [
          "04E14C8C-323B-4AB1-BB48-CD11580BAB0B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write up the order Result"
          },
          "position": {
            "x": 980,
            "y": 430
          }
        },
        "flowElementId": "8FD107EB-02A6-4526-A1CB-DECDE2DA4E1F",
        "groupId": null,
        "id": "24335D3A-5AEC-43AC-9BB7-B8FB74FC14D3",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "order",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Order",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "settings",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice settings",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "04E14C8C-323B-4AB1-BB48-CD11580BAB0B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const o = order || {};\nconst slim = {\n  name: o.name,\n  createdAt: o.createdAt,\n  email: o.email,\n  phone: o.phone,\n  customer: o.customer,\n  billingAddress: o.billingAddress,\n  checkoutFields: o.customAttributes,\n  financialStatus: o.financialStatus,\n  currency: o.currency,\n  subtotal: o.subtotalPrice,\n  shipping: o.totalShipping,\n  tax: o.totalTax,\n  discounts: o.totalDiscounts,\n  refunded: o.totalRefunded,\n  total: o.totalPrice,\n  lines: o.lineItems,\n  payments: o.transactions,\n};\nconst s = Object.assign({}, (settings && settings.data) ? settings.data : (settings || {}));\n['countries_list', 'currencies_list', 'languages_list'].forEach(k => delete s[k]);\nreturn { order: JSON.stringify(slim, null, 1), settings: JSON.stringify(s, null, 1) };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Order text",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write up the order",
        "nextElementIds": [
          "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Prepare the invoice Result"
          },
          "tools": {
            "EXTENSION:::SHARED:::default:::fatture-in-cloud:::listEntities": {
              "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::listEntities",
              "dynamicOptionsLabels": {}
            },
            "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getEntity": {
              "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getEntity",
              "dynamicOptionsLabels": {}
            }
          },
          "position": {
            "x": 926,
            "y": 590
          }
        },
        "flowElementId": "13A4B769-E0CB-40FF-9C49-D5ECE6A7737A",
        "groupId": null,
        "id": "E15C6BF7-5757-4D0F-88C8-47DA5247834F",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": "Block: 'Prepare the invoice', Error: [List Entities] connectionId: OAuth Connection is required",
            "valid": false
          },
          "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": "Invoice plan",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You prepare a Fatture in Cloud electronic invoice for a Shopify order. You never create or change anything; you only read and decide.\nUse the tools:\n1. Find the client among the company's clients with List Entities. Search by the order email first (filter email = 'the address'), then by the VAT number or tax code in the order's checkout fields, then by the billing company or customer name. When you have the client's id, read the full record with Get Entity.\n2. Decide whether the client can receive an electronic invoice. A business (type company) needs a VAT number and either a recipient code (ei_code) or a certified email address (certified_email). A public administration (type pa) needs a six-character recipient code. A private person (type person) needs a tax code (tax_code). A client that is not on file is not ready.\n3. Build the invoice lines from the order: one line per order line with name (the title, plus the variant title when there is one) and qty, and a line for shipping when the order has a shipping charge. Decide whether the Shopify prices include VAT: if the total equals subtotal plus shipping, they do, so set useGrossPrices to true and give each line a gross_price; if the total equals subtotal plus shipping plus tax, set useGrossPrices to false and give each line a net_price. A line's unit price is its discounted total divided by its quantity. Each order line carries taxLines, the VAT Shopify charged on it; its rate is the sum of ratePercentage. Give every line a vat object holding the id of the VAT type from the invoice settings with that rate. Shipping takes the rate of the goods, the highest when the lines differ. A line with no tax lines takes the VAT type the client record names, otherwise the standard 22 percent.\n4. From the invoice settings pick the numbering series (the company default), the payment method that matches the order's payment gateway or else the company default, and the payment account money from Shopify lands in.\nReply with JSON only, with these fields:\nclientReady: true only if the client is on file and has what an e-invoice needs\nclientId: the client's id as text, or empty text\nclientName: the client's name, or the order's billing company or customer name if not on file\nmissing: when clientReady is false, one plain sentence saying what is missing; otherwise empty text\nitems: the invoice lines, an array of objects with name, qty, gross_price or net_price, and vat\nuseGrossPrices: true or false\nnumeration: the numbering series as text\npaymentMethodId: the payment method id as a number\npaymentAccountId: the payment account id as a number, or null\nproperties: an object with ei_data holding payment_method (the e-invoice payment code MP01 to MP23 for the chosen payment method, for example MP08 for a card payment) and use_split_payment (true only when the client is a public administration subject to split payment)\npaid: true when the order's financial status is PAID\ndueDate: YYYY-MM-DD. For a paid order, the order date. Otherwise the order date plus the client's default payment terms in days, or the order date when it has none.\nnotes: one sentence for the finance owner on anything worth a look before filing, such as a first invoice to this client, split payment, a VAT rate with no matching VAT type in the settings, a currency other than EUR, or a refund on the order; otherwise empty text"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [
            {
              "connectionId": null,
              "definition": {},
              "enabled": true,
              "hostType": "SHARED",
              "methodName": "listEntities",
              "name": "List Entities",
              "notes": "Lists the clients or suppliers of a Fatture in Cloud company, with filtering, sorting and paging.",
              "packageId": "default",
              "params": [
                {
                  "name": "entityKind",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "companyId",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "filter",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "sort",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "page",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "perPage",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "fields",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "fieldset",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                }
              ],
              "serviceId": "fatture-in-cloud",
              "type": "FR_FUNCTION"
            },
            {
              "connectionId": null,
              "definition": {},
              "enabled": true,
              "hostType": "SHARED",
              "methodName": "getEntity",
              "name": "Get Entity",
              "notes": "Reads one Fatture in Cloud client or supplier by its identifier.",
              "packageId": "default",
              "params": [
                {
                  "name": "entityId",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "entityKind",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "companyId",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "fields",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "fieldset",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                }
              ],
              "serviceId": "fatture-in-cloud",
              "type": "FR_FUNCTION"
            }
          ],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "A Shopify order needs an invoice in Fatture in Cloud. Today is "
              },
              {
                "id": "GET_CURRENT_DATE",
                "label": null,
                "type": "GET_CURRENT_DATE_TIME",
                "value": null
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ".\n\nThe order:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order text",
                "subPathSegments": [
                  {
                    "key": "order",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "24335D3A-5AEC-43AC-9BB7-B8FB74FC14D3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nThe company's invoice settings from Fatture in Cloud (numbering series, payment methods, payment accounts, VAT types):\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Order text",
                "subPathSegments": [
                  {
                    "key": "settings",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "24335D3A-5AEC-43AC-9BB7-B8FB74FC14D3"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Prepare the invoice",
        "nextElementIds": [
          "E3AFA0B3-9E4A-466F-AA0C-6EFFF05E08BA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Files a Fatture in Cloud document with the Italian exchange system as an electronic invoice. This is final and cannot be recalled.",
          "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::sendEInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "File the e-invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::sendEInvoice",
          "legacyElementId": "JS###v1###FattureInCloudService###sendEInvoice",
          "methodName": "sendEInvoice",
          "position": {
            "x": 1904,
            "y": 1400
          }
        },
        "flowElementId": "5C118F37-8239-4A37-812E-7FF9F03677A7",
        "groupId": null,
        "id": "15931252-9F68-4440-A6D7-696AD94723A3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "companyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'File the e-invoice', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendEInvoice",
          "onFailElemId": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528",
          "packageId": "default",
          "resultAlias": "Filed",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fatture-in-cloud",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "File the e-invoice",
        "nextElementIds": [],
        "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": "Tell finance it needs a look Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1538,
            "y": 942
          }
        },
        "flowElementId": "9A0F161E-8630-4B37-98EF-85BFD3C2527E",
        "groupId": null,
        "id": "F058910F-CA4A-4745-99E9-AC6F0C53D6F4",
        "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": "Order",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "202A5E32-C29D-4FB1-81A7-3B95A20C831A"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " stopped at "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check error",
                    "subPathSegments": [
                      {
                        "key": "source",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ": "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check error",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "30EBD145-6EFF-4B35-94FB-1A4C6FA3A528"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " Nothing was filed with the exchange system. If the invoice was already created, it is in Fatture in Cloud waiting for a fix."
                  }
                ],
                "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": "Failure note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell finance it needs a look",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the payment schedule Result"
          },
          "position": {
            "x": 584,
            "y": 964
          }
        },
        "flowElementId": "0E79FA0B-BF84-45EC-989D-AC518583C581",
        "groupId": null,
        "id": "2BE93211-EE80-49A9-91E2-F54D25B266BF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "amountDue",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Totals",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "amount_due",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "amountGross",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Totals",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "amount_gross",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D0FDDE92-B079-4CEE-ABC7-D8A6D372624D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paid",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "paid",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "dueDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paymentAccountId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "paymentAccountId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const n = v => (v === null || v === undefined || v === '') ? null : Number(v);\nconst amount = n(amountDue) !== null ? n(amountDue) : n(amountGross);\nif (amount === null || Number.isNaN(amount)) throw new Error('Fatture in Cloud returned no total to schedule.');\nconst isPaid = paid === true || paid === 'true';\nconst payment = { amount: Math.round(amount * 100) / 100, due_date: dueDate, status: isPaid ? 'paid' : 'not_paid' };\nif (isPaid) {\n  payment.paid_date = dueDate;\n  if (n(paymentAccountId)) payment.payment_account = { id: n(paymentAccountId) };\n}\nreturn { payments: [payment], amount: payment.amount };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Schedule",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the payment schedule",
        "nextElementIds": [
          "B89D3BA6-829C-4F8F-90AA-FE442C988591"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the invoice is held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1578,
            "y": 1568
          }
        },
        "flowElementId": "039BAFAF-E0C4-4A96-92EE-23FDB29C5BF8",
        "groupId": null,
        "id": "35458A66-6FB3-4AB5-8E10-47EE56E6F1BD",
        "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": "Held. Invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      },
                      {
                        "key": "numeration",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B89D3BA6-829C-4F8F-90AA-FE442C988591"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice plan",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "clientName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E15C6BF7-5757-4D0F-88C8-47DA5247834F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is in Fatture in Cloud and has not been filed. File it from Fatture in Cloud when you are ready."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to finance",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F163F5BF-BB27-4BC1-80F3-059EF50FA528"
                  }
                ],
                "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": "Hold note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the invoice is held",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Reports the numbering series, payment methods, payment accounts, VAT types and templates a Fatture in Cloud company has, which is what a new document must reference.",
          "elementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getPreCreateInfo",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoice settings Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fatture-in-cloud:::getPreCreateInfo",
          "legacyElementId": "JS###v1###FattureInCloudService###getPreCreateInfo",
          "methodName": "getPreCreateInfo",
          "position": {
            "x": 690,
            "y": 430
          }
        },
        "flowElementId": "E630819F-6183-4FC9-A793-C0A0689B2405",
        "groupId": null,
        "id": "04E14C8C-323B-4AB1-BB48-CD11580BAB0B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "invoice"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "companyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the invoice settings', 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": "getPreCreateInfo",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice settings",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fatture-in-cloud",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the invoice settings",
        "nextElementIds": [
          "24335D3A-5AEC-43AC-9BB7-B8FB74FC14D3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "33DBDDBE-334F-4F77-A9C7-698FA29859E8",
    "groups": [],
    "id": "B239D730-1D7B-48A8-8E44-C85FDC8E8E75",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "The Anthropic key the AI agent uses.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for the finance owner's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "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:00:00.574Z"
}
