Skip to main content

Automate water bill calculations with Telegram, Gemini AI, and Google Sheets

Workflow preview

Workflow preview
100%
Automate water bill calculations with Telegram, Gemini AI, and Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automate Water Bill Calculations with Telegram, Gemini AI, and Google Sheets This workflow automates the calculation of monthly water bills. Res...

Best for

  • File Management automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.switch, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Miftah Rahmat.

Original n8n.io source

1.1 Workflow description

Title
Automate water bill calculations with Telegram, Gemini AI, and Google Sheets
Workflow name
Automate water bill calculations with Telegram, Gemini AI, and Google Sheets

Automate Water Bill Calculations with Telegram, Gemini AI, and Google Sheets

This workflow automates the calculation of monthly water bills. Residents can send a photo of their water meter along with their name via Telegram. The workflow uses Gemini AI to extract the meter reading, calculates the usage difference compared to the previous month, and updates a Google Sheet with the billing details. Finally, the workflow sends a summary back via Telegram.

Don’t hesitate to reach out if you have any questions or run into issues! 🙌

Requirements

  • A Telegram bot token (created via BotFather).
  • A Google account with access to Google Sheets.
  • A Gemini API key ([](Google AI Studio)).
  • A pre-created Google Sheet with the required columns.

Google Sheet Setup Create a new Google Sheet with the following columns: Nama, Volume Sebelumnya, Volume Saat Ini, Harga/m³, Jumlah Bayar, Beban, Total Bayar, Tanggal Input

Workflow Setup Instructions

  1. Connect Google Sheets
  • Add your Google Sheets credentials in n8n.
  • Link the workflow to your sheet with the structure above.
  1. Set Up Telegram Bot
  • Create a Telegram bot via BotFather.
  • Copy your bot token into the Telegram Trigger node.
  1. Configure Gemini AI
  • Obtain a Gemini API key from Google AI Studio.
  • Add it to your n8n credentials.
  • The workflow will parse the meter reading from the uploaded image.

Example Calculation Previous Volume: 535 m³ Current Volume: 545 m³ Usage: 10 m³ Price per m³: Rp3.000 Fixed cost: Rp3.000 Total Bill: Rp33.000

How It Works

  • User sends a photo of the water meter with caption (name).
  • Telegram Trigger receives the message.
  • Gemini AI reads the meter number from the photo.
  • Workflow fetches previous volume from Google Sheets.
  • Usage and total bill are calculated.
  • Data is stored back into Google Sheets.
  • Bot replies in Telegram with detailed bill info.

Customization

  • Change Harga/m³ in the sheet to match your community’s water price.
  • Update Beban if your community uses a different fixed fee.
  • Edit the Telegram reply message node to adjust wording.

With this workflow, you can streamline water billing for residents, ensure accuracy, and save time on manual calculations.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - Redirect Message Types

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 3 - Get a file

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 4 - Image Explainer

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 5 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 6 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 7 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Find Latest Row

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Format Bill Message

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Send Bill to Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 14 - Prepare Data for Sheet

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Calculate Bill

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

3. Summary Table

Workflow Automate water bill calculations with Telegram, Gemini AI, and Google Sheets
Complexity advanced
Nodes 15
Categories File Management, AI Chatbot
Author Miftah Rahmat
Published 10 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8455/8455.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate water bill calculations with Telegram, Gemini AI, and Google Sheets do?

Automate Water Bill Calculations with Telegram, Gemini AI, and Google Sheets This workflow automates the calculation of monthly water bills. Res...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management, AI Chatbot use case.