In modern software development, our business logic is often a ghost in the machine. It's scattered across microservices, duplicated in frontend validation, buried in backend controllers, and hardcoded in database triggers. This decentralized chaos makes systems brittle, difficult to audit, and incredibly slow to change.
As we stand on the cusp of a new era—the age of agentic workflows—this problem becomes even more acute. We envision AI agents and autonomous systems that can make decisions and perform complex tasks on our behalf. But how can an agent reliably "refund a purchase" or "approve a document" if the rules for those actions are spread across a dozen different places?
The answer isn't to build more complex agents. It's to build a simpler, more robust foundation. The future requires us to define our business operations not as scattered code, but as powerful, executable verbs.
Consider a simple action: a user following another user on a social platform. The logic might look like this:
What happens when you want to add a new effect, like adding the followed user's posts to the follower's feed? You have to hunt down the SocialService, modify it, and hope you don't break anything. What if you want to audit every "follow" action for the past month? You'd have to sift through database logs, service logs, and more. The action itself has no concrete identity.
What if we could define the "Follow" action once, as a declarative piece of code? This is the core principle behind Verbs.do: treating business actions as first-class citizens in your codebase.
Instead of imperative steps scattered across services, you define an action as a single, centralized object.
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 model, the Verb encapsulates the entire business action.
By codifying the action, you centralize its logic. Now, whether a follow is initiated from your web app, mobile app, or an admin tool, the execution is identical. follow.execute() becomes the single, auditable source of truth for that action.
This is where things get truly exciting. Simple, well-defined Verbs are the building blocks for creating incredibly complex workflows. Because Verbs are composable, the effects of one action can trigger another.
Imagine a more complex workflow, like PublishArticle.
You can construct sophisticated, automated business processes by chaining these simple, reusable, and self-contained actions. Each Verb does one thing well, and the system orchestrates them to achieve a larger goal.
This is the foundation for an agentic workflow. An "AI Content Moderator" agent doesn't need to know how to quarantine a post, notify a user, and alert a human moderator. It only needs to make one decision: execute the QuarantinePost Verb. The Verb itself reliably handles all the downstream consequences.
This drastically simplifies the development of agents. The "thinking" part of the agent (the decision-making) is decoupled from the "doing" part (the execution of the action), which is perfectly encapsulated within the Verb.
By treating business actions as code, you gain transformative benefits:
To build the autonomous systems of tomorrow, we must first bring order to the logic of today. It's time to stop chasing ghosts in the machine and start defining the actions that drive your business.
Ready to transform your operations into composable, agent-ready services? Visit Verbs.do to learn how to define any business action as code.