Architecture overview
Kwala’s architecture consists of interconnected components that work together to enable stateless, decentralized workflow execution:
| Component | Description |
|---|---|
| Stateless automation layer | Processes workflows off-chain while retaining cryptographic guarantees |
| Kwala Virtual Machine (KVM) | Deterministic runtime that interprets and executes workflow definitions |
| Event trigger engine | Monitors blockchain activity and detects workflow activation conditions |
| Cross-chain action engine | Executes on-chain operations across multiple networks |
| Web2 integration layer | Connects workflows to external APIs and enterprise systems |
Stateless automation layer
Kwala shifts workflow logic off-chain while retaining cryptographic guarantees and verifiable execution on-chain. By separating automation logic from state transitions, Kwala enables scalable, cost-effective workflow execution without compromising decentralization. The stateless automation layer processes workflows using four key components:- Deterministic workflow virtual machine: Interprets workflow definitions consistently across all nodes
- Decentralized task runners: Execute workflows across a distributed network
- Event-driven triggers: Monitor blockchain activity for activation conditions
- Cross-chain action executors: Perform operations across multiple blockchain networks
Kwala Virtual Machine (KVM)
The Kwala Virtual Machine (KVM) is the execution engine that interprets and processes workflow definitions. It functions as a deterministic runtime environment where YAML-based workflows are parsed, validated, and prepared for execution across the decentralized network.KVM capabilities
| Capability | Description |
|---|---|
| YAML parsing | Parses workflow definitions for consistent interpretation across all nodes |
| Event extraction | Extracts event arguments using the re.event(n) syntax for simplified parameter access |
| Workflow validation | Validates workflow structure and logic before execution |
| Trigger scheduling | Schedules triggers based on defined conditions |
| Sequence orchestration | Orchestrates multi-step workflow sequences |
| Web2 interactions | Enables API calls and external service integrations |
Event trigger engine
The event trigger engine monitors blockchain activity across multiple networks, detecting state changes that initiate workflow execution.Supported trigger types
- Smart contract events: Listen for specific events emitted by contracts
- Price changes: React to token price movements (coming soon)
- Time-based intervals: Schedule automation using cron expressions
- Webhook inputs: Receive triggers from external systems
- Wallet activity: Monitor transactions and balance changes
Simplified event parameter extraction
Extracting event parameters typically requires complex regex patterns and custom parsing logic. Kwala simplifies this with there.event(index) syntax—a zero-configuration approach that extracts event parameters by their index position.
Instead of writing ABI parsing code or regex patterns, reference event data directly:
Cross-chain action engine
The cross-chain action engine executes on-chain operations in response to workflow triggers.Capabilities
- Smart contract calls: Initiate contract interactions on any supported blockchain
- Token operations: Process transfers, approvals, and swaps
- Multi-network coordination: Coordinate actions across multiple networks simultaneously
- Multi-step pipelines: Orchestrate complex sequences of operations
Web2 integration layer
The Web2 integration layer enables workflows to interact with existing infrastructure, bridging the gap between blockchain operations and enterprise systems.Integration capabilities
| Integration | Description |
|---|---|
| REST APIs | Call any HTTP endpoint with custom headers and payloads |
| Webhooks | Trigger external services when workflow events occur |
| Database queries | Read from and write to external data sources |
| Cloud functions | Invoke serverless functions on AWS, GCP, or Azure |
| External services | Integrate with any service that exposes an API |
