Create real-time Telegram notification automations using Kwala Workflows
In this guide, we’ll walk you through how to build a Telegram notification automation using Kwala Workflows, a no-server, YAML-based Web3 automation platform.With Kwala, you can connect on-chain events to off-chain APIs like Telegram, Discord, or Slack without writing complex backend logic. Every time a smart contract emits an event, your Telegram bot will instantly send a message, all automated using Kwala.
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.)
Deploy the contract using the Remix IDE and connect your Metamask wallet to Polygon Amoy Testnet.
You must have POL Faucet to deploy the smart contract.
Once successfully deployed, copy your deployed smart contract address from the Amoy Polygon explorer.(Refer to https://amoy.polygonscan.com/ to check the deployed smart contract and related transactions.)
Bot Token to access the HTTP API, for example, 7754368882:AAHS4KbbOkl5rEHoBBIR8eljgwq2PARYLyY
Chat ID, for example, 968602918
Use these credentials inside the workflow to send notifications later.
Make sure to check your bot token on any API testing tool like ReqBin or Postman using a POST request. If your bot token is working, it will send a test notification message via Telegram.
Source Contract Address: for example, 0x8ff6dEe7e8860146E51029E6116096239D8006ed the address of the deployed smart contract, available on the Amoy Polygonscan website.
Name: Telegram_Notifier1Trigger: TriggerSourceContract: 0x8ff6dEe7e8860146E51029E6116096239D8006ed TriggerChainID: 80002 TriggerEventName: ValueIncreased(address,uint256) TriggerEventFilter: NA TriggerSourceContractABI: WwogIHsKICAgICJhbm9ueW1vdXMiOiBmYWxzZSwKICAgICJpbnB1dHMiOiBbCiAgICAgIHsKICAgICAgICAiaW5kZXhlZCI6IHRydWUsCiAgICAgICAgImludGVybmFsVHlwZSI6ICJhZGRyZXNzIiwKICAgICAgICAibmFtZSI6ICJjYWxsZXIiLAogICAgICAgICJ0eXBlIjogImFkZHJlc3MiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaW5kZXhlZCI6IGZhbHNlLAogICAgICAgICJpbnRlcm5hbFR5cGUiOiAidWludDI1NiIsCiAgICAgICAgIm5hbWUiOiAibmV3VmFsdWUiLAogICAgICAgICJ0eXBlIjogInVpbnQyNTYiCiAgICAgIH0KICAgIF0sCiAgICAibmFtZSI6ICJWYWx1ZUluY3JlYXNlZCIsCiAgICAidHlwZSI6ICJldmVudCIKICB9LAogIHsKICAgICJpbnB1dHMiOiBbXSwKICAgICJuYW1lIjogImluY3JlYXNlIiwKICAgICJvdXRwdXRzIjogWwogICAgICB7CiAgICAgICAgImludGVybmFsVHlwZSI6ICJ1aW50MjU2IiwKICAgICAgICAibmFtZSI6ICIiLAogICAgICAgICJ0eXBlIjogInVpbnQyNTYiCiAgICAgIH0KICAgIF0sCiAgICAic3RhdGVNdXRhYmlsaXR5IjogIm5vbnBheWFibGUiLAogICAgInR5cGUiOiAiZnVuY3Rpb24iCiAgfSwKICB7CiAgICAiaW5wdXRzIjogW10sCiAgICAibmFtZSI6ICJ2YWx1ZSIsCiAgICAib3V0cHV0cyI6IFsKICAgICAgewogICAgICAgICJpbnRlcm5hbFR5cGUiOiAidWludDI1NiIsCiAgICAgICAgIm5hbWUiOiAiIiwKICAgICAgICAidHlwZSI6ICJ1aW50MjU2IgogICAgICB9CiAgICBdLAogICAgInN0YXRlTXV0YWJpbGl0eSI6ICJ2aWV3IiwKICAgICJ0eXBlIjogImZ1bmN0aW9uIgogIH0KXQ== TriggerPrice: NA RecurringSourceContract: 0x8ff6dEe7e8860146E51029E6116096239D8006ed RecurringChainID: 80002 RecurringEventName: ValueIncreased(address,uint256) RecurringEventFilter: NA RecurringSourceContractABI: WwogIHsKICAgICJhbm9ueW1vdXMiOiBmYWxzZSwKICAgICJpbnB1dHMiOiBbCiAgICAgIHsKICAgICAgICAiaW5kZXhlZCI6IHRydWUsCiAgICAgICAgImludGVybmFsVHlwZSI6ICJhZGRyZXNzIiwKICAgICAgICAibmFtZSI6ICJjYWxsZXIiLAogICAgICAgICJ0eXBlIjogImFkZHJlc3MiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaW5kZXhlZCI6IGZhbHNlLAogICAgICAgICJpbnRlcm5hbFR5cGUiOiAidWludDI1NiIsCiAgICAgICAgIm5hbWUiOiAibmV3VmFsdWUiLAogICAgICAgICJ0eXBlIjogInVpbnQyNTYiCiAgICAgIH0KICAgIF0sCiAgICAibmFtZSI6ICJWYWx1ZUluY3JlYXNlZCIsCiAgICAidHlwZSI6ICJldmVudCIKICB9LAogIHsKICAgICJpbnB1dHMiOiBbXSwKICAgICJuYW1lIjogImluY3JlYXNlIiwKICAgICJvdXRwdXRzIjogWwogICAgICB7CiAgICAgICAgImludGVybmFsVHlwZSI6ICJ1aW50MjU2IiwKICAgICAgICAibmFtZSI6ICIiLAogICAgICAgICJ0eXBlIjogInVpbnQyNTYiCiAgICAgIH0KICAgIF0sCiAgICAic3RhdGVNdXRhYmlsaXR5IjogIm5vbnBheWFibGUiLAogICAgInR5cGUiOiAiZnVuY3Rpb24iCiAgfSwKICB7CiAgICAiaW5wdXRzIjogW10sCiAgICAibmFtZSI6ICJ2YWx1ZSIsCiAgICAib3V0cHV0cyI6IFsKICAgICAgewogICAgICAgICJpbnRlcm5hbFR5cGUiOiAidWludDI1NiIsCiAgICAgICAgIm5hbWUiOiAiIiwKICAgICAgICAidHlwZSI6ICJ1aW50MjU2IgogICAgICB9CiAgICBdLAogICAgInN0YXRlTXV0YWJpbGl0eSI6ICJ2aWV3IiwKICAgICJ0eXBlIjogImZ1bmN0aW9uIgogIH0KXQ== RecurringPrice: NA RepeatEvery: event ExecuteAfter: event ExpiresIn: 1781796603 Meta: NA ActionStatusNotificationPOSTURL: ActionStatusNotificationAPIKey: Actions: - Name: Telegram_notification Type: post APIEndpoint: https://api.telegram.org/bot7754368882:AAHS4KbbOkl5rEHoBBIR8eljgwq2PARYLyY/sendMessage APIPayload: chat_id: 968602918, text: Hi ! You have a new notification, check your polscan. TargetContract: NA TargetFunction: NA TargetParams: ChainID: NA EncodedABI: NA Bytecode: NA EncodedGoContract: NA Metadata: NA RetriesUntilSuccess: 5Execution: Mode: sequential
You can now save and compile this YAML workflow code. Upon successful compilation, deploy it.
Make sure that you’re in the Kwala network (not Polygon Amoy Testnet) in your MetaMask to implement this.
Activate your workflow in Kwala, and you’ll get your workflow address. Wait for its status to show claimed.Then go to Remix and call the increase() function in your deployed contract.
Make sure you’re in the Polygon Amoy Testnet in your MetaMask when executing the contract via Remix IDE.
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."
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.