Skip to main content
The Token Transfer Alert template helps you monitor specific token transfers and receive instant notifications when transfers occur. This guide walks you through using the template to create a workflow that combines on-chain event monitoring with off-chain notifications.

Prerequisites

Before you begin, ensure you have:
  • A connected Web3 wallet (MetaMask, Rainbow, Coinbase Wallet, or WalletConnect)
  • Kwala credits in your account
  • The contract address you want to monitor
  • A webhook endpoint for receiving notifications

Use cases

This template is ideal for the following scenarios:
  • Monitoring token transfers in real-time
  • Tracking reward point additions in loyalty programs
  • Sending alerts when specific on-chain events occur
  • Logging blockchain activity to external systems

Step 1: Access the template

  1. Navigate to the Kwala dashboard and select My workflows
  2. Select Templates from the navigation menu
  3. Find and select Token Transfer Alert
  4. Select View Details to open the template
Token transfer alert template overview

Step 2: Provide a workflow name

In the template overview, select Deploy Template or Edit Template to open it in the Workflow Editor. On the YAML editor, give your workflow a descriptive name:
Name: token_transfer_alert
When you update the name in the YAML editor, it also reflects in the workflow information pane.

Step 3: Configure triggers

The template is pre-configured with trigger settings that you can customize: Execute after Set to event to trigger when the specified event occurs:
Trigger:
  ExecuteAfter: event
Repeat after Set to event to repeat every time the event occurs:
  RepeatEvery: event
Contract monitoring Update the contract address and chain ID to match the contract you want to monitor:
  TriggerChainID: 1  # 1 for Ethereum mainnet
  TriggerSourceContract: 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
  TriggerEventName: AddPoints(string,uint256)
ABI configuration The template includes a base64-encoded ABI. You can replace this by:
  1. Uploading your contract’s .sol file in the Workflow Builder
  2. Pasting the contract ABI directly
  TriggerSourceContractABI: W3siaW5wdXRzIjpbXSwic3RhdGVNdXRhYmlsaXR5...
Expiry date Set when the workflow should stop monitoring:
  ExpiresIn: 1791796603  # Unix timestamp

Step 4: Configure recurring triggers

For repeated execution, configure the recurring source:
  RecurringChainID: 1
  RecurringSourceContract: 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
  RecurringEventName: AddPoints(string,uint256)
  RecurringSourceContractABI: W3siaW5wdXRzIjpbXSwic3RhdGVNdXRhYmlsaXR5...
  RecurringEventFilter: NA

Step 5: Configure notification actions

The template includes two notification actions that you can customize:

Action 1: Primary notification

This action sends the main notification when a transfer is detected:
Actions:
  - Name: action_notify
    Type: post
    APIEndpoint: https://workflow-notification-test.kalp.network/push_notification
    APIPayload:
      message: "Transfer detected"
      token: "ETH"
      threshold: 2000
    RetriesUntilSuccess: 2
Customization options:
  • APIEndpoint: Replace with your webhook URL
  • message: Customize the notification message
  • token: Specify the token being monitored
  • threshold: Set alert threshold if applicable

Action 2: Log notification

This action logs the transfer to another endpoint:
  - Name: action_log
    Type: post
    APIEndpoint: https://workflow-notification-test.kalp.network/push_notification
    APIPayload:
      TargetContract: "0x65B2B850FEe0E0C13D956aB5D64271164fa6589D"
      chainId: 1
    RetriesUntilSuccess: 2

Step 6: Set execution mode

The template uses sequential execution, meaning actions run one after another:
Execution:
  Mode: sequential
You can change this to parallel if you want both notifications to be sent simultaneously.

Step 7: Add notification settings (optional)

Configure status notifications to receive updates about workflow execution:
Trigger:
  ActionStatusNotificationPOSTURL: https://workflow-notification-test.kalp.network/push_notification
  ActionStatusNotificationAPIKey: NA

Add more actions

You can update the template to include additional actions like sending emails, updating databases, or triggering other smart contracts:
- Name: action_email
  Type: post
  APIEndpoint: https://api.sendgrid.com/v3/mail/send
  APIPayload:
    to: "admin@example.com"
    subject: "Transfer Alert"

Step 8: Compile and validate

Before deploying:
  1. Select Compile to validate your configuration
  2. Check the Console Logs for any errors
  3. Review the Validation pane for real-time feedback

Step 9: Deploy and activate

Once your workflow is configured:
  1. Select Save Workflow
  2. Approve the transaction in your wallet
  3. Select Deploy to submit to the Kwala network
  4. Select Activate to start monitoring

Complete workflow example

Here’s the complete YAML for reference:
Name: token_transfer_alert
Trigger:
  ExecuteAfter: event
  RepeatEvery: event
  ExpiresIn: 1791796603
  ActionStatusNotificationPOSTURL: https://workflow-notification-test.kalp.network/push_notification
  ActionStatusNotificationAPIKey: NA
  TriggerChainID: 1
  TriggerSourceContract: 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
  TriggerEventName: AddPoints(string,uint256)
  TriggerEventFilter: NA
  RecurringChainID: 1
  RecurringSourceContract: 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
  RecurringEventName: AddPoints(string,uint256)
  RecurringEventFilter: NA
Actions:
  - Name: action_notify
    Type: post
    APIEndpoint: https://workflow-notification-test.kalp.network/push_notification
    APIPayload:
      message: "Transfer detected"
      token: "ETH"
      threshold: 2000
    RetriesUntilSuccess: 2
  - Name: action_log
    Type: post
    APIEndpoint: https://workflow-notification-test.kalp.network/push_notification
    APIPayload:
      TargetContract: "0x65B2B850FEe0E0C13D956aB5D64271164fa6589D"
      chainId: 1
    RetriesUntilSuccess: 2
Execution:
  Mode: sequential

How it works

The workflow uses a recurring event-based trigger that continuously monitors a smart contract on Ethereum mainnet. When the contract emits an AddPoints event (indicating points were added to a user), the workflow executes two sequential API calls: one to send a notification and another to log the event details.

Next steps