Actions
Business operations callable from HTTP, CLI, workflows, or other actions.
Actions are the primary unit of business logic in Chimpbase. They are typed, validated operations that can be called from HTTP endpoints, CLI commands, workflows, or other actions.
Defining an Action
Input Validation
Actions use the built-in v validator for input schemas:
Registering Actions
Actions are registered by name. When passed as a named export or object property, the key becomes the action name:
Calling Actions from Other Actions
Actions can invoke other registered actions through the context:
Transaction Behavior
Actions run inside runtime-managed transactions. You do not need to wrap your queries in ctx.db().transaction() — in fact, it is intentionally unsupported.
Using Decorators
If you prefer a class-based style, use the @Action decorator:
Collect decorator-based registrations with registrationsFrom(...).