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
- Time interval: Workflow repeats at regular intervals. For example, every hour or 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, such as
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 the contract is verified on the blockchain or 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.
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
- API Endpoint: The URL to send the request to. For example,
https://api.telegram.org/bot7754368882:AAHS4KbbOkl5rEHoBBIR8eljgwq2PARYLyY/sendMessage - API Payload (JSON): The JSON data to include in the request body. You can pass both fixed values and event parameters in a POST action.
- Retries Until Success: Number of retry attempts if the request fails.
re.event(0), re.event(1), re.event(2), or any other index to reference values from the triggering event.
Example POST configuration
The following example shows a POST action where both fixed values and event parameters can be used when calling web2 APIs.
- 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: The parameters to pass to the function. You can use fixed values or reference event data dynamically with re.event(0), re.event(1), etc. Enter each parameter on a separate line.
- Retries Until Success: Number of retry attempts if the call fails
- 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
