{
  "name": "Monitor company budgets with Bexio, Google Sheets and Gmail alerts",
  "nodes": [
    {
      "id": "9d0bc3d2-3f08-4c12-a423-360f8d1d5b0e",
      "name": "Set Offset",
      "type": "n8n-nodes-base.set",
      "position": [
        1232,
        160
      ]
    },
    {
      "id": "7c5f7c4a-25d9-4098-9804-e767f60c1468",
      "name": "Add Offset",
      "type": "n8n-nodes-base.set",
      "position": [
        2000,
        160
      ]
    },
    {
      "id": "bf4aa503-c994-4704-a073-8d8051392328",
      "name": "Update Records",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1664,
        160
      ]
    },
    {
      "id": "e1378ea8-6d9d-4133-89c8-84be927c0845",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        0
      ],
      "parameters": {
        "width": 416,
        "height": 464,
        "content": "## Initial settings"
      }
    },
    {
      "id": "37b9dee9-5c1b-412d-b1a7-c90ee4bd977d",
      "name": "Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        1840,
        160
      ]
    },
    {
      "id": "1348be14-dcb8-45fe-a9f4-84eec811ee73",
      "name": "Get Records",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        160
      ]
    },
    {
      "id": "7ba55437-f07f-4532-ac7c-d090b6cfaf8d",
      "name": "Batch Size",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        160
      ]
    },
    {
      "id": "3ba9d765-3124-4c7f-9f34-686e60a45b1d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        0
      ],
      "parameters": {
        "width": 1440,
        "height": 464,
        "content": "## Update accounting records Bexio to Google Sheets"
      }
    },
    {
      "id": "6ceb6bf9-822a-4b64-8c41-936d3f4a4388",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        0
      ],
      "parameters": {
        "width": 640,
        "height": 1088,
        "content": "**This n8n template allows you to automatically monitor your company's budget by comparing live Bexio accounting data against targets defined in Google Sheets, sending automated weekly email reports.*"
      }
    },
    {
      "id": "b6ed1653-a432-4d09-9ede-51a50fb7c89f",
      "name": "Read Budgets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        656,
        880
      ]
    },
    {
      "id": "735a28d8-530d-4874-9df6-5b1a1ccf803e",
      "name": "Get Debits",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1200,
        1280
      ]
    },
    {
      "id": "14df45e7-63d2-49dc-a320-2b29e54a8b23",
      "name": "Get Credits",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1200,
        1456
      ]
    },
    {
      "id": "003f5228-4279-45bb-92fb-4dffcb17bee9",
      "name": "Calculate Credits",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        1280
      ]
    },
    {
      "id": "216b8051-60c8-4b8a-8ccb-aa73d294d8d0",
      "name": "Calculate debit",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        1456
      ]
    },
    {
      "id": "5ef10109-0ad8-41aa-aa24-3c5b4bd35af2",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        912,
        880
      ]
    },
    {
      "id": "0b90b1b0-ff9c-4dec-bb75-7fb5fd2f2ec7",
      "name": "Merge Credits/Debits",
      "type": "n8n-nodes-base.merge",
      "position": [
        1568,
        1296
      ]
    },
    {
      "id": "4d9c877c-8219-4527-b1e1-ccc9d99fb49c",
      "name": "Calculate Costs",
      "type": "n8n-nodes-base.code",
      "position": [
        1712,
        1296
      ]
    },
    {
      "id": "a10b7090-106b-4368-87f6-d7c26e492bf9",
      "name": "Add Budgets",
      "type": "n8n-nodes-base.merge",
      "position": [
        1904,
        912
      ]
    },
    {
      "id": "57d20597-f0b1-482e-95f8-6a9e1a9a519d",
      "name": "Check Budgets",
      "type": "n8n-nodes-base.code",
      "position": [
        2064,
        912
      ]
    },
    {
      "id": "187500f9-204f-439f-a489-eb74f6ba5ba0",
      "name": "Compose Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        544
      ]
    },
    {
      "id": "1f8f1484-d9e0-409b-881d-edbb189246e8",
      "name": "Send Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1360,
        544
      ]
    },
    {
      "id": "0d8d55ea-7c9c-4765-8c7f-ba70df930756",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        1200
      ],
      "parameters": {
        "width": 1872,
        "height": 464,
        "content": "## Calculate costs for each period based on accounting records"
      }
    },
    {
      "id": "6e98e233-a25c-498c-848a-954e335ce469",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        480
      ],
      "parameters": {
        "width": 1872,
        "height": 272,
        "content": "## Send final reports"
      }
    },
    {
      "id": "01b2caf9-8ec9-45a5-bf36-cb86834e71b9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        784
      ],
      "parameters": {
        "width": 1872,
        "height": 384,
        "content": "## Compare budgets to actual costs"
      }
    },
    {
      "id": "a823f709-c1ef-45c6-a766-e7d829ddafc5",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        576,
        160
      ]
    },
    {
      "id": "87f7206e-cfc5-4c2e-b4f5-6d646b830b5f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        1120
      ],
      "parameters": {
        "width": 640,
        "height": 544,
        "content": "## Example report\n\nBudget Report:\n\nIT costs:\n- Budget exceeded in 04 2025 - budget: 200, actual: 420\n\n\nRentals:\n- All costs within the budget\n\n\nYour custom metric\n- Report if budget exceeded any month"
      }
    }
  ],
  "connections": {
    "Delay": {
      "main": [
        [
          {
            "node": "Add Offset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Offset": {
      "main": [
        [
          {
            "node": "Set Offset",
            "type": "main",
            "index": 0
          },
          {
            "node": "Read Budgets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Size": {
      "main": [
        [
          {
            "node": "Set Offset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Debits": {
      "main": [
        [
          {
            "node": "Calculate Credits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Offset": {
      "main": [
        [
          {
            "node": "Get Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Budgets": {
      "main": [
        [
          {
            "node": "Check Budgets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Credits": {
      "main": [
        [
          {
            "node": "Calculate debit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Records": {
      "main": [
        [
          {
            "node": "Update Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Budgets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Budgets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose Report": {
      "main": [
        [
          {
            "node": "Send Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Records": {
      "main": [
        [
          {
            "node": "Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Costs": {
      "main": [
        [
          {
            "node": "Add Budgets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Calculate debit": {
      "main": [
        [
          {
            "node": "Merge Credits/Debits",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Compose Report",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Budgets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Debits",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Credits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Batch Size",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Credits": {
      "main": [
        [
          {
            "node": "Merge Credits/Debits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Credits/Debits": {
      "main": [
        [
          {
            "node": "Calculate Costs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}