What are Web3 Actions?
Web3 Actions allow you to:- Execute custom code when specific blockchain events occur
- Monitor smart contracts and respond to state changes
- Automate workflows based on transaction patterns
- Build event-driven applications
- Integrate blockchain data with external services
Actions Workflow
The typical workflow for working with Actions involves three main commands:Initialize
Set up a new Actions project with
tenderly actions init. This creates the project structure, configuration files, and example code.Build
Validate and build your Actions with
tenderly actions build. This compiles TypeScript, validates configurations, and checks for errors.Quick Start
Action Components
Action Function
Every Action consists of a function that receives context and event data:- TypeScript
- JavaScript
Action Specification
Actions are configured in yourtenderly.yaml file:
Trigger Types
Actions support multiple trigger types:Block
Trigger on new blocks with configurable frequency
Transaction
Monitor specific transactions or transaction patterns
Webhook
Trigger via HTTP webhook calls
Periodic
Execute on a schedule using cron or intervals
Alert
Respond to Tenderly Alert triggers
Execution Types
Actions support two execution types:parallel: Executes the action asynchronously (ASYNC invocation). Multiple instances can run simultaneously.sequential: Executes the action synchronously (SYNC invocation). Only one instance runs at a time, subsequent triggers queue up.
If
execution_type is not specified, the action defaults to parallel execution.Runtime Configuration
Actions support two runtime versions:v1: Legacy runtime (deprecated)v2: Current runtime with improved performance and features (recommended)
Dependencies
For TypeScript/JavaScript Actions, you must include the@tenderly/actions package:
package.json
Project Structure
A typical Actions project structure:Available Commands
init
Initialize a new Actions project
build
Build and validate Actions locally
publish
Publish Actions to the dashboard
deploy
Publish and deploy Actions with active triggers
Global Flags
--project flag to specify which project to use without being prompted:
Next Steps
Initialize Your First Action
Learn how to set up a new Actions project
Publish Your Actions
Deploy your Actions to production