In modern software architecture, business logic is often a scattered, ephemeral thing. A piece of it lives in a frontend button's onClick handler. Another part is tucked away in a microservice endpoint. More is hidden in a scheduled cron job or a database trigger. This fragmentation is a developer's nightmare and a business's liability. It leads to inconsistency, makes auditing nearly impossible, and turns simple updates into complex cross-system projects.
What if we could change that? What if we treated every significant business action—not as a side effect of code, but as the central, first-class citizen it truly is?
This is the promise of Actions-as-Code, a paradigm shift that redefines how we build, manage, and automate business operations. It’s about translating your processes into powerful, executable Verbs that can be managed, tracked, and composed like any other piece of software.
Actions-as-Code is an approach where business actions are defined declaratively as code. Think Purchase Product, Follow User, or Approve Report. Instead of being implicitly coded into various parts of an application, each action becomes an explicit, version-controlled, and executable object.
If you're familiar with "Infrastructure-as-Code" (IaC), the concept will feel intuitive. Just as IaC brings the power of versioning, automation, and auditability to server management, Actions-as-Code brings those same benefits to your core Business Logic.
At the heart of this paradigm is the "Verb."
With a platform like Verbs.do, a business action is defined as a Verb. This isn't just semantics; it’s a structured, declarative object that codifies an entire interaction.
A Verb clearly defines:
Let's look at a concrete example of defining a Follow action in your system using Verbs.do.
import { Verb } from 'verbs.do';
// Define a 'Follow' action in your system
const follow = new Verb({
name: 'Follow',
subject: { type: 'User', description: 'The user who is following.' },
object: { type: 'User', description: 'The user being followed.' },
effects: [
{ type: 'createEdge', from: 'subject', to: 'object', label: 'follows' },
{ type: 'notify', user: 'object.id', message: '`{subject.name}` started following you.' }
]
});
// Now, any part of your system can execute this action
await follow.execute({ subjectId: 'user-123', objectId: 'user-456' });
In this single, declarative block, we've defined the entire Follow workflow. When executed, it automatically creates the relationship in our graph database and sends a notification. There's no ambiguity. The logic is centralized, readable, and self-contained.
Adopting this model isn't just about tidying up code; it's about fundamentally improving how your business operates.
The most immediate benefit is the end of fragmented logic. By codifying actions into Verbs, you create a single source of truth. The rules for what happens when a user follows another are defined once. Whether the action is triggered from your mobile app, web frontend, or an admin panel, the execution is identical and reliable. This ensures consistency and dramatically simplifies maintenance.
Verbs are designed to be composable building blocks. The effects of one Verb can easily trigger another. For example, a CloseSupportTicket Verb could have an effect that triggers a SendSatisfactionSurvey Verb. This allows you to construct complex, automated business processes from simple, reusable actions. This modularity is the foundation for building powerful Agentic Workflows, where systems can intelligently sequence actions to achieve larger goals.
When every business interaction is an explicit Verb execution, you get an infallible audit trail for free. You can track every action: who performed it, what it was performed on, when it happened, and what the results were. This is invaluable for debugging, compliance, security, and gaining deep business insights. Action Management transforms from a reactive forensic exercise into a proactive, real-time capability.
Once a Verb is defined, it can be executed through a simple, unified API call from anywhere in your stack. Your frontend team doesn't need to know the intricate details of stock management and payment processing; they just need to call purchase.execute(). This provides a consistent interface for all business interactions, accelerating development and reducing the surface area for bugs. It is API Automation at its most logical extreme.
The Actions-as-Code paradigm offers a powerful vision for the future of business automation. With Verbs.do, that vision is a practical reality. By giving you the tools to define, manage, and automate any business action as code, it empowers you to:
The era of scattered business logic is over. It's time to treat your business actions with the same discipline and power as the rest of your code. It's time for Business-as-Code.