Objective
Build a workflow that:- Listens to a smart contract event on-chain. Here, the Polygon chain, Amoy Testnet, is used.
- Sends an instant Telegram message when the event is triggered.
Step 1: Smart contract setup
Let’s begin with a simple Solidity smart contract that emits an event each time its counter is increased. File name:TestIncValue.sol
(You can give any name to your Solidity file with a .sol extension.)
You must have POL Faucet to deploy the smart contract.
https://amoy.polygonscan.com/ to check the deployed smart contract and related transactions.)
Step 2: Setting up the Telegram bot
Before configuring the Kwala workflow, set up your Telegram bot:- Open Telegram and search @BotFather.
- Run
/newbotto create a new bot and get a bot token. - Use @userinfobot to get your chat ID.
- Bot Token to access the HTTP API, for example,
7754368882:AAHS4KbbOkl5rEHoBBIR8eljgwq2PARYLyY - Chat ID, for example,
968602918
Step 3: Setting up the Kwala workflow
Now that the contract and Telegram bot are ready, let’s move to Kwala and create the automation.Step 3.1: Create a new workflow
- Navigate to your Kwala Dashboard.
- Select Create New Workflow.
- Give it a Name, for example:
Telegram_Notifier1.
Step 3.2: Configure the trigger
This is the event that will activate your workflow.- Execute After: Set to
event: executes the action after an event is emitted. - Repeat Every:
eventtriggered after the event occurs. - Expires: timestamp for expiry, for example:
17-09-2025 16:00in IST. - Trigger Chain ID:
80002here: Polygon Amoy Testnet. - Source Contract Address: for example,
0x8ff6dEe7e8860146E51029E6116096239D8006edthe address of the deployed smart contract, available on the Amoy Polygonscan website. - Recurring Event Name:
ValueIncreased(address, uint256) - Event Filter:
NA - Smart contract (optional): Here, you can simply copy and paste the Solidity code or upload the same
.solfile. - Recurring source contract ABI: This will be automatically fetched from your deployed smart contract.
Step 3.3: Add the action (Telegram notification)
This defines what happens when the event occurs.- Action Name: for example,
Telegram_notification - Action Type:
POST API CALL - API Endpoint: for example,
https://api.telegram.org/bot<YOUR_BOT>/sendMessage - API Payload:
- Retries Until Success:
5 - Execution Mode:
Sequentialactions run one after another
YAML workflow configuration
Step 4: Deploy and test the workflow
Activate your workflow in Kwala, and you’ll get your workflow address. Wait for its status to showclaimed.
Then go to Remix and call the increase() function in your deployed contract.
Each time the function runs, it emits the ValueIncreased event.
Within seconds, you’ll receive a Telegram message automatically.
Your Telegram should display: "Hi! You have a new notification, check your polscan."
Step 5: Monitor workflow execution
In the Kwala Dashboard, navigate to:- Workflow Logs – to view event triggers and API calls
- Execution Status – to confirm successful Telegram notifications
- Retries and Failures – to debug if notifications didn’t reach
Conclusion
In this guide, we created a real-time blockchain-to-Telegram notification system using Kwala Workflows: no servers, no SDKs, just YAML automation. This setup shows how developers can easily integrate Web3 event triggers with Web APIs, enabling system alerts, user notifications, or smart contract monitors with minimal effort.Next steps
Monitor Your Workflows
Learn how to track and analyze your workflow executions in real-time
Best Practices
Discover tips and patterns for building robust Web3 automations
