Prerequisites
- Completion of the steps in Create workflow.
Configuration steps
Configuring a workflow involves three steps:- Configure triggers: Define when and how your workflow activates
- Configure actions: Specify what your workflow does when triggered
- Configure execution mode: Choose how actions are processed
Step 1: Configure triggers
Triggers determine when your workflow activates. In the Workflow Builder, you’ll configure execution settings that control trigger behavior.Required trigger fields
The required fields for trigger configuration are Execute after, Repeat after, and Expires in.Execute after
Defines when the workflow should start executing. Choose from the following options:- Immediate: Workflow executes as soon as it is deployed and activated.
- Timestamp: Workflow executes at a specific date and time
- Event: Workflow executes when a specified on-chain event occurs
- Oracle price: Workflow executes when a token reaches a target price
- Block number: Workflow executes at a specific block height
Repeat after
Determines if and when the workflow should repeat. Choose from the following options:- Time interval: Workflow repeats at regular intervals (for example, every hour, daily)
- Oracle price: Workflow repeats when price conditions are met again
- Event: Workflow repeats each time the specified event occurs
- N/A: Workflow executes only once and does not repeat
- Recurring Source Contract: The smart contract address to monitor for recurring events (for example,
0x49e833337ece7afe375e44f4e3e8481029218e5c) - Recurring Chain ID: The blockchain network where the contract is deployed (for example,
1for Ethereum mainnet) - Smart Contract (Optional): Paste Solidity contract code or upload a
.solfile to automatically extract the ABI - Recurring Source Contract ABI: The contract’s ABI for parsing events. This is auto-populated if you upload a contract file
- Recurring Event Name: Select the event to listen for from the dropdown (for example,
Transfer(address,address,uint256)) - Recurring Event Filter: Filter criteria for the event. Use
NAif no filter is needed
Expires in
Sets when the trigger expires. Use the calendar icon to select the expiry date and time. The Workflow Builder automatically converts this into a Unix timestamp.Optional trigger fields
Meta
The Meta field is where you include additional metadata for your trigger. Use this field to store custom information that may be useful for tracking or debugging your workflow.Notification settings
You can configure notifications to receive updates about your workflow’s execution status by providing:- Action Status Notification POST URL: The webhook endpoint where Kwala sends execution status updates
- Action Status Notification API Key: API key for authenticating with your notification endpoint
Step 2: Configure actions
Actions define what your workflow does when the trigger activates. You can only add up to 10 actions per workflow.Required fields for all actions
Every action requires the following fields:- Action Name: A descriptive identifier for the action (for example,
transfer_fundsorsend_notification) - Action Type: The type of operation to perform. Kwala supports three action types:
- POST: Make an API call to an external endpoint
- CALL: Call a function on an existing smart contract
- Deploy: Deploy a new smart contract
POST API call
Use the POST action type to send HTTP requests to external APIs, webhooks, or notification services.- API Endpoint: The URL to send the request to (for example,
https://dev-api.kalp.network/webhook) - API Payload (JSON): The JSON data to include in the request body.
- Retries Until Success: Number of retry attempts if the request fails
Example POST configuration
Call smart contract function
Use the CALL action type to interact with an existing smart contract by calling one of its functions.- Target Contract: The address of the smart contract to interact with (for example,
0x65b2b850fee0e0c13d956ab5...) - Target Function: The function signature to call (for example,
function updateNFT(string memory userId, uint256 points)) - Chain ID: The blockchain network where the contract is deployed. Select from the dropdown
- Target Parameters (one per line): The parameters to pass to the function. Enter each parameter on a separate line. You can use
re.event(0),re.event(1), etc. to reference values from the triggering event - Retries Until Success: Number of retry attempts if the call fails
Example CALL configuration
re.event(0), re.event(1), re.event(2), or any other index to reference values from the triggering event.
Deploy smart contract
Use the Deploy action type to deploy a new smart contract to a blockchain network.- Chain ID: The blockchain network where the contract will be deployed. Select from the dropdown
- Smart Contract: Upload a
.solfile or paste your Solidity contract code directly. This is used to extract the bytecode and ABI - Bytecode: The compiled contract bytecode in hexadecimal format (for example,
0x608060405234801561001057600080fd5b50...). This is auto-populated if you upload a contract file - ABI Encoded: The contract’s ABI encoded in base64 format (for example,
W3siaW5wdXRzIjpbXSwibmFtZSI6ImV4YW1wbGUiLCJvdXRwdX...). This is auto-populated if you upload a contract file - Retries Until Success: Number of retry attempts if deployment fails.
Adding multiple actions
Select Add Action to include additional actions in your workflow. You can add up to 10 actions per workflow. Each action can be a different type, allowing you to combine contract calls, API requests, and deployments in a single workflow. Select Next when you’ve finished configuring all actions.For more detailed information about action types and advanced parameters, see Working with actions.
Step 3: Configure execution mode
Choose how your actions should be processed using the Execution Mode dropdown:- Sequential: Actions execute one after another in order. Use this when later actions depend on the results of earlier actions.
- Parallel: All actions execute simultaneously. Use this when actions are independent of each other and speed matters.
- Workflow Name: The name you assigned to your workflow
- Trigger Contract: The smart contract address being monitored
- Actions Count: The total number of actions configured
- Execution Mode: Whether actions run in parallel or sequential order
