Skip to main content
Tracking blockchain milestones like block counts usually requires backend scripts or continuous polling systems. Those approaches can be hard to maintain and aren’t ideal when you want a quick automation. With Kwala, you can automate blockchain monitoring and real-time alerting without writing backend code. This guide shows how to create a Telegram alert that automatically triggers when the blockchain reaches a specific block number using Kwala’s low-code workflow automation.

Objective

Create a Kwala workflow that sends a Telegram alert as soon as the Polygon network reaches a defined block number. This example demonstrates how a simple YAML configuration can monitor the chain and integrate with real-world notification systems.

Prerequisites

You’ll need:
  • Access to the Kwala Dashboard to create the workflow: Kwala Dashboard.
  • A Telegram bot created through @BotFather for notifications.
Test your bot token with an API tool like ReqBin or Postman using a POST request. If the token works, it will deliver a test notification to Telegram.
This use case does not require a Solidity smart contract. You only need a YAML configuration file for the workflow on Kwala.

Workflow setup on Kwala

Follow these steps to configure and deploy the workflow on Kwala:

Step 1: Create a new workflow

  1. Open your Kwala Dashboard.
  2. Select Create Workflow.
  3. In the Basic Info section, enter the workflow name, for example: blockno4.

Step 2: Configure the trigger

The trigger fires when the Polygon chain reaches your target block number.
  • Execute after: Block number, fires once the specified block is mined; for example, activates when block no. 76757000 is mined.
  • Expires in: Defines how long the workflow remains valid, for example, 22-09-2025 13:00 in IST.
  • Trigger source configuration:
    • Block no: 76,757,000 activates when block #76757000 is mined on Polygon.
    • Chain ID: 137 Polygon Mainnet.
  • Action status Notification POST URL:
This setup ensures the workflow activates automatically when the blockchain condition is met without manual intervention or backend service required.

Step 3: Configure the action

When the trigger fires, the workflow will send a Telegram message. Key settings:
  • Action name: Provide a name for your action. For example, telegram-message.
  • Action Type: POST request.
  • API Endpoint: Telegram Bot API.
  • API Payload:
{
  "chat_id": 968602918,
  "text": "Polygon has reached to the desired block number 76763500"
}
  • chat_id: Telegram user or group that receives the alert, for example: 968602918.
  • Retries Until Success: 5 Kwala will retry up to 5 times on failure.
Once you’ve set these parameters, save and deploy the workflow.

Step 4: Add the YAML configuration

Use the YAML below for your Kwala workflow. Save and compile this in the Kwala dashboard, then deploy it.
Name: blockno1
Trigger:
  TriggerSourceContract: NA
  TriggerChainID: 137
  TriggerEventName: NA
  TriggerEventFilter: NA
  TriggerSourceContractABI: NA
  TriggerPrice: NA
  RecurringSourceContract: NA
  RecurringChainID: NA
  RecurringEventName: NA
  RecurringEventFilter: NA
  RecurringSourceContractABI: NA
  RecurringPrice: NA
  RepeatEvery: NA
  ExecuteAfter: BL76763500
  ExpiresIn: 1789646400
  Meta: NA
  ActionStatusNotificationPOSTURL:  
  ActionStatusNotificationAPIKey: NA
Actions:
  - Name: telegram
    Type: post
    APIEndpoint: https://api.telegram.org/bot7754368882:AAHS4KbbOkl5rEHoBBIR8eljgwq2PARYLyY/sendMessage
    APIPayload:
      chat_id: '968602918'
      text: Polygon has reached to the desired block number 76763500
    TargetContract: NA
    TargetFunction: NA
    TargetParams: 
    ChainID: NA
    EncodedABI: NA
    Bytecode: NA
    EncodedGoContract: NA
    Metadata: NA
    RetriesUntilSuccess: 5
Execution:
  Mode: parallel

Step 5: Save and deploy

  1. Save and compile the YAML workflow.
  2. Deploy it.
  3. Activate the workflow in Kwala and wait for its status to show claimed.
Once deployed, Kwala starts monitoring the blockchain. When Polygon reaches block 76,757,000, the Telegram bot will send an instant notification.

Output

When the workflow executes, you’ll receive this Telegram alert:
Polygon has reached the desired block number 76,757,000
This confirms your automation is live and working.

Why Kwala?

Kwala Workflows let developers:
  • Eliminate backend polling systems for blockchain monitoring.
  • Integrate on-chain and off-chain systems using simple YAML.
  • Create event-driven automations in minutes.
  • Build scalable, reliable Web3 automations without heavy infrastructure.
Whether it’s notifications, API triggers, or contract interactions, Kwala makes Web3 automation simple, fast, and code-light.

Conclusion

In this guide, you built a real-time block number alert using Kwala Workflows. The workflow sends a Telegram message when a specific block is reached, all configured via a YAML file, with no backend servers or manual checks. Kwala bridges on-chain events and real-world systems so you can automate Web3 logic quickly and reliably.

Next steps