{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "FF503914-415D-4EA5-912E-B4963A5F4FEB",
    "name": "easybill: received e-invoices to bookkeeping"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 40.94500592981228,
        "y": -135.74606313402126,
        "zoom": 0.5929572497054744
      },
      "autoSave": true,
      "descriptions": {
        "flow": "Once a day, reads the supplier e-invoices easybill has received since the last run, has an AI agent pick the booking account for each, files the invoice files in Dropbox under that account, and posts a digest in Slack. An invoice the agent is not sure about is filed under To review and handed to the bookkeeper in Slack with both candidate accounts side by side.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Once a day, reads the supplier e-invoices easybill has received since the last run, has an AI agent pick the booking account for each, files the invoice files in Dropbox under that account, and posts a digest in Slack. An invoice the agent is not sure about is filed under To review and handed to the bookkeeper in Slack with both candidate accounts side by side.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "shared-memory-read",
          "isFirstElement": true,
          "blockDefinitionId": "shared-memory-read",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoices already filed Result"
          },
          "position": {
            "x": 110,
            "y": 400
          }
        },
        "flowElementId": "435E5A83-E6EB-4E91-83E9-34886FA52E02",
        "groupId": null,
        "id": "64191549-9EF7-4A53-A73C-5231EB9E1700",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "defaultValue": {
            "expression": [
              {
                "id": "JSON",
                "label": null,
                "parsedValue": {
                  "ids": []
                },
                "type": "INPUT",
                "value": "{\"ids\":[]}"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "key": "filedIncomingIds",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Filed before",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "READ",
          "type": "SHARED_MEMORY"
        },
        "name": "Read the invoices already filed",
        "nextElementIds": [
          "112D0E27-5C1E-491B-B453-0184A77F527F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 493.9547980636303,
            "y": 360.4422248030398
          }
        },
        "flowElementId": "9229609E-CD34-46DF-AAC7-EC2E58ACA4BE",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "95D6247C-725D-4DD6-83A3-3BEFA7FF9172",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f46c1714-3261-492b-aa09-e7e1c496914b",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Routing",
                      "subPathSegments": [
                        {
                          "key": "sure",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "f46c1714-3261-492b-aa09-e7e1c496914b"
            ]
          },
          "elseComponent": {
            "componentId": "BCBDDF38-9397-42EB-AD4F-796555E8D917",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Account sure",
          "storeResult": false,
          "thenComponent": null
        },
        "name": "Sure of the account?",
        "nextElementIds": [
          "BCBDDF38-9397-42EB-AD4F-796555E8D917"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1236,
            "y": 1124
          }
        },
        "flowElementId": "6B561BCC-E768-4C0B-A43B-EFFDA093AA94",
        "groupId": null,
        "id": "0675E971-B341-43BE-9C0D-95AE6FD43D09",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "c448e5b8-2156-408f-8012-6a7ce0757144",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Digest",
                      "subPathSegments": [
                        {
                          "key": "count",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "8B953668-83C2-42D9-8AA1-7F84D19336EA"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "INT",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 0
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "c448e5b8-2156-408f-8012-6a7ce0757144"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Anything filed",
          "storeResult": false,
          "thenComponent": {
            "componentId": "BD8B4358-5E05-471F-97AD-32270567A0F1",
            "componentType": "ELEMENT"
          }
        },
        "name": "Anything filed?",
        "nextElementIds": [
          "BD8B4358-5E05-471F-97AD-32270567A0F1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Fetches a file attached to a received supplier document and stores it in FlowRunner file storage.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::downloadIncomingDocumentFile",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Download the file Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::downloadIncomingDocumentFile",
          "legacyElementId": "JS###v1###EasybillService###downloadIncomingDocumentFile",
          "methodName": "downloadIncomingDocumentFile",
          "position": {
            "x": 110,
            "y": 220
          }
        },
        "flowElementId": "A8C46EFE-064C-452B-A0C5-4E5402128A4C",
        "groupId": "943E16D3-89EB-438A-B25A-EF6A4931FD4E",
        "id": "47CE8EA6-4E58-4A5A-A525-64061298B754",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "incomingDocumentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1AC2E634-2A27-4666-9C7B-305C4C73B060"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "943E16D3-89EB-438A-B25A-EF6A4931FD4E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filename",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "943E16D3-89EB-438A-B25A-EF6A4931FD4E"
                  }
                ],
                "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": "downloadIncomingDocumentFile",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Downloaded file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Download the file",
        "nextElementIds": [
          "5AABFC97-4FA3-422E-84DA-D32DE7D91D4C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "shared-memory-put",
          "isFirstElement": false,
          "blockDefinitionId": "shared-memory-put",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default"
          },
          "position": {
            "x": 1218,
            "y": 1000
          }
        },
        "flowElementId": "CD5144D4-BA11-42D9-A250-0BCB9C0554B0",
        "groupId": null,
        "id": "A7AF0752-628F-4ABB-8B94-D12AC4E3D7DC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "data": [
            {
              "name": "filedIncomingIds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "New invoices",
                    "subPathSegments": [
                      {
                        "key": "memory",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0063BAAF-E031-4EB6-A7E0-5CA195333232"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "override": true,
          "resultAlias": "Memory saved",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "PUT",
          "type": "SHARED_MEMORY"
        },
        "name": "Remember what was filed",
        "nextElementIds": [
          "0675E971-B341-43BE-9C0D-95AE6FD43D09"
        ],
        "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": "Post the digest Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1232,
            "y": 1288
          }
        },
        "flowElementId": "FDE6540D-0DEF-4EEC-BF4B-CA8D733A4F88",
        "groupId": null,
        "id": "BD8B4358-5E05-471F-97AD-32270567A0F1",
        "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": "Digest",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8B953668-83C2-42D9-8AA1-7F84D19336EA"
                  }
                ],
                "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": "EXPRESSION",
                "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": "EXPRESSION",
                "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": "Digest message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the digest",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Filed invoices": "7d45d9dd-b90a-4660-b5cb-0a9d26805ea5"
          },
          "position": {
            "x": 1228,
            "y": 616
          }
        },
        "flowElementId": "844A7733-E50A-42AC-BDB6-7E9071A022AA",
        "groupId": null,
        "id": "3DA6E327-B58E-49A4-8FAB-9D7D65367E78",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Filed invoices",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [],
                    "type": "INPUT",
                    "value": "[]"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "dstart",
          "storeResult": true
        },
        "name": "Start the digest",
        "nextElementIds": [],
        "nextGroupIds": [
          "8D6B312C-0275-4EB5-9D42-18A8F14BF806"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Downloads a file from a public URL and uploads its content to Dropbox at the specified location. Useful for archiving externally hosted files, capturing API responses, or pushing AI-generated assets into Dropbox. Limited to 150 MB per file; larger uploads require Dropbox upload sessions which are not supported in this version.",
          "elementId": "EXTENSION:::SHARED:::default:::dropbox-service:::uploadFile",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "File it in Dropbox Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::dropbox-service:::uploadFile",
          "legacyElementId": "JS###v1###DropboxService###uploadFile",
          "methodName": "uploadFile",
          "position": {
            "x": 400,
            "y": 220
          }
        },
        "flowElementId": "27C39D87-1A3D-4623-ABC3-433C00A59A07",
        "groupId": "943E16D3-89EB-438A-B25A-EF6A4931FD4E",
        "id": "5AABFC97-4FA3-422E-84DA-D32DE7D91D4C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "destinationPath",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "folder",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "prefix",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                  },
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "943E16D3-89EB-438A-B25A-EF6A4931FD4E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Downloaded file",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "47CE8EA6-4E58-4A5A-A525-64061298B754"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "conflictMode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "overwrite"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "autorename",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'File it in Dropbox', 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": "uploadFile",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Filed file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "dropbox-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "File it in Dropbox",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns the files attached to a received supplier document, each with its ID, file name, extension, size in bytes and upload time. Use a file's ID with Download Incoming Document File.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocumentFiles",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the invoice files Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocumentFiles",
          "legacyElementId": "JS###v1###EasybillService###listIncomingDocumentFiles",
          "methodName": "listIncomingDocumentFiles",
          "position": {
            "x": 1062.9217698206771,
            "y": 197.19807254488745
          }
        },
        "flowElementId": "49C7596C-E3FD-4D91-AB30-CE5F9EEFE79A",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "655E206C-F7F6-4983-8F13-2877A09C09DB",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "incomingDocumentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1AC2E634-2A27-4666-9C7B-305C4C73B060"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 100
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listIncomingDocumentFiles",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice files",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the invoice files",
        "nextElementIds": [],
        "nextGroupIds": [
          "943E16D3-89EB-438A-B25A-EF6A4931FD4E"
        ],
        "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": "Hand it to the bookkeeper Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 490.7199319702826,
            "y": 517.6402973479272
          }
        },
        "flowElementId": "05BB6A58-AE6E-4EAE-BB50-F3F9455A1063",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "BCBDDF38-9397-42EB-AD4F-796555E8D917",
        "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": "Routing",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                  }
                ],
                "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": "EXPRESSION",
                "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": "EXPRESSION",
                "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": "Routing",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                  }
                ],
                "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": "Bookkeeper message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Hand it to the bookkeeper",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Reads one received supplier document, with its supplier, amounts, accounting positions and payment details.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::getIncomingDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::getIncomingDocument",
          "legacyElementId": "JS###v1###EasybillService###getIncomingDocument",
          "methodName": "getIncomingDocument",
          "position": {
            "x": 407.55759964158113,
            "y": 36.97696014336755
          }
        },
        "flowElementId": "38A5705C-2B32-48A6-8C80-6C860C5D54FE",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "1AC2E634-2A27-4666-9C7B-305C4C73B060",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "incomingDocumentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "8D6B312C-0275-4EB5-9D42-18A8F14BF806"
                  }
                ],
                "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": "getIncomingDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the invoice",
        "nextElementIds": [
          "A2AD27C6-EC5F-4DDC-BDA6-CD5922CD0A10"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the booking account Result"
          },
          "tools": {},
          "position": {
            "x": 686.9769601433676,
            "y": 36.97696014336755
          }
        },
        "flowElementId": "37E9E987-1960-4583-B005-B7C028464754",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "A2AD27C6-EC5F-4DDC-BDA6-CD5922CD0A10",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Coding",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You code supplier invoices that a business received as electronic invoices in easybill. For each invoice, pick the booking account it belongs on, from this list only:\n"
              },
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Booking accounts",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Booking accounts"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nAmounts in the invoice data are in cents, so 14940 means 149.40. Read the supplier, the line descriptions, the VAT rates and the totals. A credit note from a supplier goes on the account of the invoice it corrects.\n\nReply with JSON only, with these fields:\naccount: the account from the list that fits best, written exactly as it appears in the list\nconfidence: a number from 0 to 100 for how sure you are that account is right\nreason: one sentence on why account fits\nalternative: the next most likely account from the list, written exactly as it appears in the list\nalternativeReason: one sentence on why alternative could fit\nsummary: what the invoice bills, in under 15 words"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Received e-invoice from easybill:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice",
                "subPathSegments": null,
                "type": "ELEMENT_LINK",
                "value": "1AC2E634-2A27-4666-9C7B-305C4C73B060"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Pick the booking account",
        "nextElementIds": [
          "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns supplier documents easybill has received, for example e-invoices arriving over the network. ⚠️ This collection is READ ONLY: easybill publishes no route to create or change an incoming document.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocuments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the newest page Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocuments",
          "legacyElementId": "JS###v1###EasybillService###listIncomingDocuments",
          "methodName": "listIncomingDocuments",
          "position": {
            "x": 582,
            "y": 602
          }
        },
        "flowElementId": "169CB243-EF78-4497-8B2B-D7F0E087EAE4",
        "groupId": null,
        "id": "8AFC9D8F-65E5-4567-B39F-FB642750707F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1000
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Received page one",
                    "subPathSegments": [
                      {
                        "key": "pages",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "112D0E27-5C1E-491B-B453-0184A77F527F"
                  }
                ],
                "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": "listIncomingDocuments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Received last page",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the newest page",
        "nextElementIds": [
          "0063BAAF-E031-4EB6-A7E0-5CA195333232"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Decide where it goes Result"
          },
          "position": {
            "x": 1064.6451159857088,
            "y": 41.51151992831623
          }
        },
        "flowElementId": "E6856640-FB05-4B87-B0A2-1D2C9C8C90F5",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "coding",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Coding",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A2AD27C6-EC5F-4DDC-BDA6-CD5922CD0A10"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoice",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "1AC2E634-2A27-4666-9C7B-305C4C73B060"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Booking accounts",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Booking accounts"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "minConfidence",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Minimum confidence",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Minimum confidence"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rootFolder",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Dropbox folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Dropbox folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "digest",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Filed invoices",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Filed invoices",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Filed invoices",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = String(accounts || '').split(/\\n|;/).map((s) => s.trim()).filter(Boolean);\nconst r = coding && typeof coding === 'object' ? coding : {};\nconst account = String(r.account || '').trim();\nconst alternative = String(r.alternative || '').trim();\nconst confidence = Number(r.confidence) || 0;\nconst sure = list.includes(account) && confidence >= (Number(minConfidence) || 80);\nconst clean = (s) => String(s == null ? '' : s).replace(/[\\\\/:*?\"<>|]+/g, ' ').replace(/\\s+/g, ' ').trim();\nconst doc = invoice && typeof invoice === 'object' ? invoice : {};\nconst date = String(doc.document_date || '').slice(0, 10);\nconst month = date ? date.slice(0, 7) : new Date().toISOString().slice(0, 7);\nconst root = '/' + String(rootFolder || '').replace(/^\\/+|\\/+$/g, '');\nconst folder = `${root === '/' ? '' : root}/${month}/${sure ? clean(account) : 'To review'}`;\nconst supplier = (doc.supplier && (doc.supplier.name || doc.supplier.company_name)) || 'Unknown supplier';\nconst number = doc.number || doc.document_number || doc.id;\nconst prefix = clean(`${date} ${supplier} ${number}`) + ' ';\nconst amount = Number(doc.amount);\nconst money = Number.isFinite(amount) ? `${(amount / 100).toFixed(2)} ${doc.currency || 'EUR'}` : 'no amount given';\nconst entry = { id: String(doc.id), date, supplier, number: String(number), money, account, alternative, sure, folder };\nconst text = `Received e-invoice from ${supplier} needs your call`;\nconst blocks = [\n  { type: 'section', text: { type: 'mrkdwn', text: `*${text}*\\nInvoice ${number}, dated ${date || 'with no date'}, ${money}.${r.summary ? `\\nWhat it bills: ${r.summary}` : ''}` } },\n  { type: 'section', fields: [\n    { type: 'mrkdwn', text: `*${account || 'No clear account'}*\\n${r.reason || ''}` },\n    { type: 'mrkdwn', text: `*${alternative || 'No second account'}*\\n${r.alternativeReason || ''}` },\n  ] },\n  { type: 'context', elements: [ { type: 'mrkdwn', text: `Filed in Dropbox under ${folder} until it is booked.` } ] },\n];\nreturn { sure, folder, prefix, account, alternative, text, blocks, digest: [...(Array.isArray(digest) ? digest : []), entry] };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Routing",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Decide where it goes",
        "nextElementIds": [
          "655E206C-F7F6-4983-8F13-2877A09C09DB"
        ],
        "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 digest Result"
          },
          "position": {
            "x": 1232,
            "y": 868
          }
        },
        "flowElementId": "4A80FBCB-3F0B-4823-ABD4-3C7AACDAD285",
        "groupId": null,
        "id": "8B953668-83C2-42D9-8AA1-7F84D19336EA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "filed",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Filed invoices",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Filed invoices",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Filed invoices",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const items = Array.isArray(filed) ? filed : [];\nconst coded = items.filter((i) => i.sure);\nconst review = items.filter((i) => !i.sure);\nconst lines = [`*${items.length} received e-invoice${items.length === 1 ? '' : 's'} from easybill filed in Dropbox*`];\nif (coded.length) {\n  lines.push('', '*Coded*');\n  coded.forEach((i) => lines.push(`• ${i.supplier}, ${i.number}, ${i.date}, ${i.money}: ${i.account}`));\n}\nif (review.length) {\n  lines.push('', '*Waiting for the bookkeeper* (filed under To review)');\n  review.forEach((i) => lines.push(`• ${i.supplier}, ${i.number}, ${i.date}, ${i.money}: ${i.account || 'unclear'} or ${i.alternative || 'unclear'}`));\n}\nreturn { count: items.length, coded: coded.length, review: review.length, text: lines.join('\\n') };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Digest",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the digest",
        "nextElementIds": [
          "A7AF0752-628F-4ABB-8B94-D12AC4E3D7DC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Filed invoices": "aba7e6ce-6921-493e-a8ca-47378324d965"
          },
          "position": {
            "x": 782.8669306087445,
            "y": 367.9998244446209
          }
        },
        "flowElementId": "E3F3F679-3DD9-43A3-A015-1E6AA711F73C",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "68F17382-07A7-4D37-B153-7CD47344652B",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Filed invoices",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Routing",
                    "subPathSegments": [
                      {
                        "key": "digest",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "20FCC4FC-77F1-4847-AC48-92C43A54D4D6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "dadd",
          "storeResult": true
        },
        "name": "Add it to the digest",
        "nextElementIds": [
          "95D6247C-725D-4DD6-83A3-3BEFA7FF9172"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Returns supplier documents easybill has received, for example e-invoices arriving over the network. ⚠️ This collection is READ ONLY: easybill publishes no route to create or change an incoming document.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocuments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List received e-invoices Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listIncomingDocuments",
          "legacyElementId": "JS###v1###EasybillService###listIncomingDocuments",
          "methodName": "listIncomingDocuments",
          "position": {
            "x": 446,
            "y": 392
          }
        },
        "flowElementId": "4873A6C1-B2A5-4318-8BA4-95C4D049E07D",
        "groupId": null,
        "id": "112D0E27-5C1E-491B-B453-0184A77F527F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1000
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "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": "listIncomingDocuments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Received page one",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List received e-invoices",
        "nextElementIds": [
          "D20F3A47-3084-4B60-9DC3-0D3C20646326"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "wait",
          "isFirstElement": true,
          "blockDefinitionId": "wait",
          "mode": "SIMPLE",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "725D7173-D71A-44F5-8B13-50D7126A68B5",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "9D2CE09C-7634-4B93-8356-3A8018689439",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "delay": {
            "expression": [
              {
                "id": "NUMBER",
                "label": null,
                "type": "INPUT",
                "value": 30
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": "DOUBLE"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "pace",
          "storeResult": true
        },
        "name": "Pace the easybill calls",
        "nextElementIds": [
          "1AC2E634-2A27-4666-9C7B-305C4C73B060"
        ],
        "nextGroupIds": [],
        "type": "WAIT"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the new invoices Result"
          },
          "position": {
            "x": 922,
            "y": 612
          }
        },
        "flowElementId": "132FB69F-4281-4E62-8D51-00AAD50B45A1",
        "groupId": null,
        "id": "0063BAAF-E031-4EB6-A7E0-5CA195333232",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "firstPage",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Received page one",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "112D0E27-5C1E-491B-B453-0184A77F527F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastPage",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Received last page",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8AFC9D8F-65E5-4567-B39F-FB642750707F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filed",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Filed before",
                    "subPathSegments": [
                      {
                        "key": "ids",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "64191549-9EF7-4A53-A73C-5231EB9E1700"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lookBackDays",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Look back days",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Look back days"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const filedIds = new Set((Array.isArray(filed) ? filed : []).map(String));\nconst byId = new Map();\nfor (const doc of [...(Array.isArray(firstPage) ? firstPage : []), ...(Array.isArray(lastPage) ? lastPage : [])]) {\n  if (doc && doc.id != null) byId.set(String(doc.id), doc);\n}\nconst days = Number(lookBackDays) > 0 ? Number(lookBackDays) : 30;\nconst from = new Date(Date.now() - days * 86400000).toISOString().slice(0, 10);\nconst inWindow = [...byId.values()].filter((d) => !d.document_date || String(d.document_date).slice(0, 10) >= from);\nconst newDocs = inWindow.filter((d) => !filedIds.has(String(d.id)));\nreturn { newDocs, count: newDocs.length, memory: { ids: inWindow.map((d) => String(d.id)) } };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "New invoices",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the new invoices",
        "nextElementIds": [
          "3DA6E327-B58E-49A4-8FAB-9D7D65367E78"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 744,
            "y": 400
          }
        },
        "flowElementId": "C88B4EF9-BAAA-4F4D-B206-0F443811D3BE",
        "groupId": null,
        "id": "D20F3A47-3084-4B60-9DC3-0D3C20646326",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "b006aef6-ebd0-4b31-b66c-a6df35dea535",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Received page one",
                      "subPathSegments": [
                        {
                          "key": "pages",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "112D0E27-5C1E-491B-B453-0184A77F527F"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "INT",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 1
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "b006aef6-ebd0-4b31-b66c-a6df35dea535"
            ]
          },
          "elseComponent": {
            "componentId": "0063BAAF-E031-4EB6-A7E0-5CA195333232",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "More pages",
          "storeResult": false,
          "thenComponent": {
            "componentId": "8AFC9D8F-65E5-4567-B39F-FB642750707F",
            "componentType": "ELEMENT"
          }
        },
        "name": "More than one page?",
        "nextElementIds": [
          "8AFC9D8F-65E5-4567-B39F-FB642750707F",
          "0063BAAF-E031-4EB6-A7E0-5CA195333232"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "64191549-9EF7-4A53-A73C-5231EB9E1700",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -233.02173604815243,
            "y": 99.74272368803565,
            "zoom": 0.6615857199540606
          },
          "position": {
            "x": 1228,
            "y": 742
          }
        },
        "flowElementId": "33944374-80B0-4037-9D7C-BA38EC44F6FF",
        "groupId": null,
        "id": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'For each new invoice', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "9D2CE09C-7634-4B93-8356-3A8018689439",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "New invoices",
                "subPathSegments": [
                  {
                    "key": "newDocs",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "0063BAAF-E031-4EB6-A7E0-5CA195333232"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "Invoice loop",
          "storeResult": true
        },
        "name": "For each new invoice",
        "nextElementIds": [
          "8B953668-83C2-42D9-8AA1-7F84D19336EA"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": 308.63706941630846,
            "y": 237.81088425185237,
            "zoom": 0.6615857199540606
          },
          "position": {
            "x": 1065.7329834405941,
            "y": 363.46526465967224
          }
        },
        "flowElementId": "D783DB18-5E66-45BA-BB80-C0F61466B9A6",
        "groupId": "8D6B312C-0275-4EB5-9D42-18A8F14BF806",
        "id": "943E16D3-89EB-438A-B25A-EF6A4931FD4E",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'For each file', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "47CE8EA6-4E58-4A5A-A525-64061298B754",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice files",
                "subPathSegments": [
                  {
                    "key": "items",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "655E206C-F7F6-4983-8F13-2877A09C09DB"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "File loop",
          "storeResult": true
        },
        "name": "For each file",
        "nextElementIds": [
          "68F17382-07A7-4D37-B153-7CD47344652B"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "0C2E9698-D2C5-418B-815B-B606BE2F7E1B",
    "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 to code each invoice.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The accounts the agent may choose from, one per line. Replace them with your own chart of accounts names. Each becomes a Dropbox folder.",
          "error": null,
          "name": "Booking accounts",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "How sure the agent must be, from 0 to 100, before an invoice is filed without the bookkeeper.",
          "error": null,
          "name": "Minimum confidence",
          "type": "INT",
          "value": ""
        },
        {
          "description": "The Dropbox folder the invoices are filed under, by month and account.",
          "error": null,
          "name": "Dropbox folder",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Only invoices dated within this many days are picked up. Older ones are left alone, which keeps the first run small.",
          "error": null,
          "name": "Look back days",
          "type": "INT",
          "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:05:23.900Z"
}
