{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "DE220227-8858-44AF-B509-BF52C25144D6",
    "name": "easybill: project time and stock to invoice"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 123.94346209564196,
        "y": 1.2262514490876129,
        "zoom": 0.6096275470381516
      },
      "autoSave": true,
      "descriptions": {
        "flow": "At the end of each billing period, rebuilds every project's draft invoice in easybill from its unbilled hours and the stock drawn against it, then asks the project manager in Slack before completing the invoices.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "At the end of each billing period, rebuilds every project's draft invoice in easybill from its unbilled hours and the stock drawn against it, then asks the project manager in Slack before completing the invoices.",
    "elements": [
      {
        "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 drafts stay open Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 507.77752043284113,
            "y": 704.0783862856731
          }
        },
        "flowElementId": "06D217D4-9567-4148-8A79-933E94620615",
        "groupId": null,
        "id": "97F1D34A-510F-41BB-BAA6-A594FAA03204",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Left as drafts. Complete them in easybill when they are ready. The next run rebuilds their lines from the hours and stock recorded by then."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to project manager",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D7BB44A1-C341-498D-A1ED-68C8473CF682"
                  }
                ],
                "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": "Held confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the drafts stay open",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns a page of time entries. ⚠️ Timer Value is in MINUTES and Hourly Rate is in CENTS. An entry with a `cleared_at` has already been invoiced.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listTimeTrackings",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the hours Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listTimeTrackings",
          "legacyElementId": "JS###v1###EasybillService###listTimeTrackings",
          "methodName": "listTimeTrackings",
          "position": {
            "x": 696.5613832895738,
            "y": 123.4386167104262
          }
        },
        "flowElementId": "DC8B5E6F-343D-4872-B7F5-FFF68DC2CB14",
        "groupId": null,
        "id": "B72CCCC1-5288-4012-848A-195B1B1A6C72",
        "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": [],
                "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": "listTimeTrackings",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Hours",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the hours",
        "nextElementIds": [
          "67D9FC5F-232C-4AB5-91CD-91295F0D6689"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Build each invoice's lines Result"
          },
          "position": {
            "x": 652.5348703629185,
            "y": 313.45706032439165
          }
        },
        "flowElementId": "89F89102-41EA-43C1-866C-2F99BEF3445E",
        "groupId": null,
        "id": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "invoices",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoices",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "17B7C479-2399-4D25-9735-BE0068241B72"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "projects",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Projects",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "37AA60EF-C57B-4051-9FC7-BCA55CF8ADB7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "timeEntries",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Hours",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B72CCCC1-5288-4012-848A-195B1B1A6C72"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "stock",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Stock drawn",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "67D9FC5F-232C-4AB5-91CD-91295F0D6689"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "positions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Price list",
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DC3EA83F-B6B9-4C82-A6FE-FC472FA2694C"
                  }
                ],
                "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 day = (value) => String(value || '').slice(0, 10);\nconst periodEnd = new Date(Date.now() - 86400000).toISOString().slice(0, 10);\nconst nextDay = (d) => new Date(Date.parse(`${d}T00:00:00Z`) + 86400000).toISOString().slice(0, 10);\nconst german = (d) => d.split('-').reverse().join('.');\nconst money = (cents) => (cents / 100).toLocaleString('de-DE', { style: 'currency', currency: 'EUR' });\nconst round2 = (n) => Math.round(n * 100) / 100;\nconst positionsById = new Map((positions || []).map((p) => [String(p.id), p]));\nconst projectsById = new Map((projects || []).map((p) => [String(p.id), p]));\nconst all = invoices || [];\n\n// The last day already billed for a project: the end of the service period on its latest completed invoice.\nconst billedThrough = (projectId) => all\n  .filter((d) => !d.is_draft && String(d.project_id) === String(projectId))\n  .map((d) => day(d.service_date && d.service_date.date_to))\n  .filter(Boolean)\n  .sort()\n  .pop() || '';\n\nconst drafts = [];\nfor (const draft of all.filter((d) => d.is_draft && d.project_id)) {\n  const since = billedThrough(draft.project_id);\n  const hours = (timeEntries || []).filter((t) => String(t.project_id) === String(draft.project_id)\n    && !t.cleared_at && day(t.date_from_at) > since && day(t.date_from_at) <= periodEnd);\n  const drawn = (stock || []).filter((s) => String(s.document_id) === String(draft.id) && Number(s.stock_count) < 0);\n  if (!hours.length && !drawn.length) continue;\n\n  const items = [];\n  let net = 0;\n  let minutes = 0;\n  for (const t of hours) {\n    const pos = positionsById.get(String(t.position_id));\n    const rate = Number(t.hourly_rate || (pos && pos.sale_price) || 0);\n    const qty = round2(Number(t.timer_value || 0) / 60);\n    minutes += Number(t.timer_value || 0);\n    net += rate * qty;\n    items.push({\n      type: 'POSITION',\n      number: pos ? pos.number : undefined,\n      description: `${german(day(t.date_from_at))} ${t.description}`,\n      quantity: qty,\n      unit: (pos && pos.unit) || 'Std.',\n      single_price_net: rate,\n      vat_percent: pos ? pos.vat_percent : undefined,\n      itemType: 'SERVICE',\n    });\n  }\n  let materials = 0;\n  for (const s of drawn) {\n    const pos = positionsById.get(String(s.position_id));\n    if (!pos) continue;\n    const qty = -Number(s.stock_count);\n    const vat = Number(pos.vat_percent || 0);\n    const price = pos.price_type === 'BRUTTO' ? round2(Number(pos.sale_price || 0) / (1 + vat / 100)) : Number(pos.sale_price || 0);\n    net += price * qty;\n    materials += 1;\n    items.push({\n      type: 'POSITION',\n      number: pos.number,\n      description: pos.description,\n      quantity: qty,\n      unit: pos.unit,\n      single_price_net: price,\n      vat_percent: pos.vat_percent,\n      itemType: 'PRODUCT',\n    });\n  }\n\n  const firstDay = since ? nextDay(since) : (hours.map((t) => day(t.date_from_at)).sort()[0] || periodEnd);\n  const project = projectsById.get(String(draft.project_id));\n  drafts.push({\n    documentId: String(draft.id),\n    items,\n    properties: { service_date: { type: 'SERVICE', date_from: firstDay, date_to: periodEnd } },\n    summary: `*${project ? project.name : `Project ${draft.project_id}`}*`\n      + `${draft.customer_snapshot && draft.customer_snapshot.company_name ? ` (${draft.customer_snapshot.company_name})` : ''}: `\n      + `${round2(minutes / 60)} h, ${materials} material line${materials === 1 ? '' : 's'}, ${money(net)} net, `\n      + `service ${german(firstDay)} to ${german(periodEnd)}`,\n  });\n}\n\nconst link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst title = `${drafts.length} draft invoice${drafts.length === 1 ? ' is' : 's are'} ready for your review`;\nreturn {\n  any: drafts.length > 0,\n  count: drafts.length,\n  drafts,\n  text: title,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: [`*${title}*`, ...drafts.map((d) => d.summary), 'Check or edit them in easybill first. Completing gives each invoice its number and locks it.'].join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Complete the invoices' }, url: link('complete') },\n      { type: 'button', text: { type: 'plain_text', text: 'Leave them as drafts' }, url: link('hold') },\n    ] },\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": "Invoice lines",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Build each invoice's lines",
        "nextElementIds": [
          "F1CB2195-91EF-4DAA-8195-042E5B2ACEFF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 352.01037430127553,
            "y": 321.6587894363589
          }
        },
        "flowElementId": "8292B197-37CF-4A1F-B648-D30A5C817336",
        "groupId": null,
        "id": "F1CB2195-91EF-4DAA-8195-042E5B2ACEFF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "93e476dd-645c-4a41-ba50-5d5915d7f024",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice lines",
                      "subPathSegments": [
                        {
                          "key": "any",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "93e476dd-645c-4a41-ba50-5d5915d7f024"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Anything to bill",
          "storeResult": false,
          "thenComponent": {
            "componentId": "EDF44A87-25FD-438F-8B43-D18E1AD0430B",
            "componentType": "GROUP"
          }
        },
        "name": "Anything to bill?",
        "nextElementIds": [],
        "nextGroupIds": [
          "EDF44A87-25FD-438F-8B43-D18E1AD0430B"
        ],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Returns a page of documents of every kind. Filter by Types to get only invoices, only offers and so on. ⚠️ Each filter accepts several values separated by commas, and the request line is capped at 4094 bytes, so a very long number list must be split across calls.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listDocuments",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the project invoices Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listDocuments",
          "legacyElementId": "JS###v1###EasybillService###listDocuments",
          "methodName": "listDocuments",
          "position": {
            "x": 96.87723342085238,
            "y": 113.59654177606546
          }
        },
        "flowElementId": "B3EC5D39-FF69-49C2-8997-0FB37E062D50",
        "groupId": null,
        "id": "17B7C479-2399-4D25-9735-BE0068241B72",
        "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": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "INVOICE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "number",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "projectId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "externalId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "isDraft",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "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": "listDocuments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoices",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the project invoices",
        "nextElementIds": [
          "37AA60EF-C57B-4051-9FC7-BCA55CF8ADB7"
        ],
        "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 project manager Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": -2.986744462992391,
            "y": 487.3337174980977
          }
        },
        "flowElementId": "43A9148B-3B91-4182-8078-1AB0DA3C1541",
        "groupId": null,
        "id": "D7BB44A1-C341-498D-A1ED-68C8473CF682",
        "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": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
                  }
                ],
                "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": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
                  }
                ],
                "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 project manager",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the project manager",
        "nextElementIds": [
          "DAB802D4-DE86-4EF0-9D32-174FDEE64E1B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns a page of projects with their budgets and consumption. ⚠️ Budget Amount and Hourly Rate are in CENTS and Budget Time is in MINUTES.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listProjects",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the projects Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listProjects",
          "legacyElementId": "JS###v1###EasybillService###listProjects",
          "methodName": "listProjects",
          "position": {
            "x": 404.9210374671804,
            "y": 118.51757924324585
          }
        },
        "flowElementId": "A7D36780-E527-46B2-B052-A02C67B4C7A1",
        "groupId": null,
        "id": "37AA60EF-C57B-4051-9FC7-BCA55CF8ADB7",
        "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": [],
                "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": "listProjects",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Projects",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the projects",
        "nextElementIds": [
          "B72CCCC1-5288-4012-848A-195B1B1A6C72"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 349.3463967879586,
            "y": 505.37752154442546
          }
        },
        "flowElementId": "D475D054-4F81-4E62-A594-9E901EB42723",
        "groupId": null,
        "id": "DAB802D4-DE86-4EF0-9D32-174FDEE64E1B",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Project manager decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the project manager's answer",
        "nextElementIds": [
          "60F1BF6D-2FF7-4DA9-8996-9898478F3DE7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Returns a page of the position catalogue, easybill's articles and services. ⚠️ Every price here is in CENTS, and each position can carry ten price levels for the customer groups.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listPositions",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the price list Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listPositions",
          "legacyElementId": "JS###v1###EasybillService###listPositions",
          "methodName": "listPositions",
          "position": {
            "x": 978,
            "y": 296
          }
        },
        "flowElementId": "D5EFF4F4-CCA4-4A92-9FD5-8AF731332ADB",
        "groupId": null,
        "id": "DC3EA83F-B6B9-4C82-A6FE-FC472FA2694C",
        "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": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "number",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "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": "listPositions",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Price list",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the price list",
        "nextElementIds": [
          "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 793.5389040929431,
            "y": 508.65821318921235
          }
        },
        "flowElementId": "B3CADD6A-4464-4095-AE9E-2AA76CB954C0",
        "groupId": null,
        "id": "60F1BF6D-2FF7-4DA9-8996-9898478F3DE7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "29b6e854-26f6-4791-a81c-37c3ec6c3fd6",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Project manager decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "DAB802D4-DE86-4EF0-9D32-174FDEE64E1B"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "complete"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "29b6e854-26f6-4791-a81c-37c3ec6c3fd6"
            ]
          },
          "elseComponent": {
            "componentId": "97F1D34A-510F-41BB-BAA6-A594FAA03204",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Complete them",
          "storeResult": false,
          "thenComponent": {
            "componentId": "FF00B27E-6B49-478D-B43A-40844E639606",
            "componentType": "GROUP"
          }
        },
        "name": "Complete the invoices?",
        "nextElementIds": [
          "97F1D34A-510F-41BB-BAA6-A594FAA03204"
        ],
        "nextGroupIds": [
          "FF00B27E-6B49-478D-B43A-40844E639606"
        ],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Finalizes a draft, which assigns the document number and locks it against editing. ⚠️ This is the step that makes an invoice real; `is_draft` is read only and cannot be turned off any other way. Reason For Change is recorded in the version history.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::completeDocument",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Complete the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::completeDocument",
          "legacyElementId": "JS###v1###EasybillService###completeDocument",
          "methodName": "completeDocument",
          "position": {
            "x": 110,
            "y": 310
          }
        },
        "flowElementId": "C407234F-9972-4149-996D-7785B07C070F",
        "groupId": "FF00B27E-6B49-478D-B43A-40844E639606",
        "id": "87FBA98A-B4FD-4835-9225-498E24397C13",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "documentId",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "FF00B27E-6B49-478D-B43A-40844E639606"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reasonForChange",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Reviewed and approved by the project manager"
                  }
                ],
                "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": "completeDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Completed invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Complete the 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": "Confirm the invoices are completed Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1017.9377504870656,
            "y": 851.5331416214793
          }
        },
        "flowElementId": "6F569578-B979-491A-A395-7CC76A3098E5",
        "groupId": null,
        "id": "528EC991-46C0-4EDB-9EA5-9864456BEF06",
        "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": "Done. "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "count",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " invoices are completed and numbered in easybill."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to project manager",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D7BB44A1-C341-498D-A1ED-68C8473CF682"
                  }
                ],
                "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": "Completed confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the invoices are completed",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns the stock movements recorded against positions, which is the audit trail behind a position's stock count.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::listStockEntries",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the stock drawn Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::listStockEntries",
          "legacyElementId": "JS###v1###EasybillService###listStockEntries",
          "methodName": "listStockEntries",
          "position": {
            "x": 980,
            "y": 130
          }
        },
        "flowElementId": "CB0409D7-D7C7-4C31-9D15-BD59504D6B06",
        "groupId": null,
        "id": "67D9FC5F-232C-4AB5-91CD-91295F0D6689",
        "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": [],
                "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": "listStockEntries",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Stock drawn",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the stock drawn",
        "nextElementIds": [
          "DC3EA83F-B6B9-4C82-A6FE-FC472FA2694C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates a draft document. ⚠️ Items REPLACE the existing lines when supplied, so send the whole set. ⚠️ Type cannot be changed. Refresh Customer Data re-copies the address from the customer record, which is what to use after fixing a customer's address. Reason For Change is recorded in the document's version history.",
          "elementId": "EXTENSION:::SHARED:::default:::easybill:::updateDocument",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Replace the draft's lines Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::easybill:::updateDocument",
          "legacyElementId": "JS###v1###EasybillService###updateDocument",
          "methodName": "updateDocument",
          "position": {
            "x": 110,
            "y": 490
          }
        },
        "flowElementId": "BC60D933-3B3F-4D1F-B04B-4821D7DCB77C",
        "groupId": "EDF44A87-25FD-438F-8B43-D18E1AD0430B",
        "id": "8B7967C8-A019-4C34-9953-63863B1A930B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "documentId",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "EDF44A87-25FD-438F-8B43-D18E1AD0430B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "items",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "EDF44A87-25FD-438F-8B43-D18E1AD0430B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "title",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueInDays",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "textPrefix",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "projectId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "externalId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "orderNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "isArchive",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "refreshCustomerData",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reasonForChange",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Lines rebuilt from project hours and stock drawn"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "properties",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "properties",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "EDF44A87-25FD-438F-8B43-D18E1AD0430B"
                  }
                ],
                "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": "updateDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Updated draft",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "easybill",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Replace the draft's lines",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "17B7C479-2399-4D25-9735-BE0068241B72",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": 0,
            "y": 0,
            "zoom": 0.8
          },
          "position": {
            "x": 1049.0916418226805,
            "y": 705.2806916447868
          }
        },
        "flowElementId": "E620959A-23B6-4C52-8205-6EBBA4D09DFF",
        "groupId": null,
        "id": "FF00B27E-6B49-478D-B43A-40844E639606",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "87FBA98A-B4FD-4835-9225-498E24397C13",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice lines",
                "subPathSegments": [
                  {
                    "key": "drafts",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "Each reviewed draft",
          "storeResult": true
        },
        "name": "For each reviewed draft",
        "nextElementIds": [
          "528EC991-46C0-4EDB-9EA5-9864456BEF06"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": 0,
            "y": 0,
            "zoom": 0.8
          },
          "position": {
            "x": 3.9158493902224194,
            "y": 328.22017272593274
          }
        },
        "flowElementId": "B45B2BF7-CAF5-47E6-89E0-0294A7C59378",
        "groupId": null,
        "id": "EDF44A87-25FD-438F-8B43-D18E1AD0430B",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "8B7967C8-A019-4C34-9953-63863B1A930B",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice lines",
                "subPathSegments": [
                  {
                    "key": "drafts",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "D6EE5357-D552-42AC-9EA4-E28C6BB100E7"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "Each draft",
          "storeResult": true
        },
        "name": "For each draft invoice",
        "nextElementIds": [
          "D7BB44A1-C341-498D-A1ED-68C8473CF682"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "2EA6D5A0-3FAA-4B41-98F3-4FE1DB2CA138",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "The URL of the block Wait for the project manager'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-17T05:54:13.332Z"
}
