In modern software development, our applications are rarely monolithic islands. They are bustling ecosystems, deeply interconnected with a constellation of third-party services. We rely on Stripe for payments, Slack for notifications, Segment for analytics, and a dozen other APIs to deliver a rich user experience. But this connectivity comes at a cost: a tangled, brittle web of integration code.
Every time a user signs up, upgrades a plan, or performs a key action, a cascade of events is triggered across multiple systems. This logic is often scattered—a bit in a backend controller, some in a serverless function, and more in a separate microservice. This scattered approach to API automation is difficult to maintain, impossible to audit, and a nightmare to evolve.
What if you could tame this complexity? What if you could define every cross-system interaction in a single, clear, and executable format? This is the promise of a unified action layer, a new paradigm we call Business-as-Code, powered by Verbs.do.
Let's consider a seemingly simple action: a user upgrading their subscription. In a typical application, the sequence might look like this:
The code for these six steps might live in three or four different places. Now, imagine you need to change the process. What if you want to add a step to assign a customer success manager? Or what if Stripe deprecates an API endpoint? You're now on a scavenger hunt through your codebase, praying you find every instance. This isn't scalable action management; it's a recipe for bugs and technical debt.
Verbs.do introduces a powerful abstraction: the Verb. A Verb is a declarative, code-based definition of a business action. It centralizes the entire logic of an action—including all its third-party integration side effects—into a single, version-controlled object.
Instead of writing imperative code scattered across your stack, you define what an action is and what should happen when it's executed.
Let's look at the core concept. A Verb has a clear structure:
By codifying your business logic this way, you create a single source of truth for every action in your system.
Let's refactor our scattered "Upgrade Subscription" process into a clean, unified Verb.
import { Verb } from 'verbs.do';
// Define the 'UpgradeSubscription' action, centralizing all logic
const upgradeSubscription = new Verb({
name: 'UpgradeSubscription',
subject: { type: 'User', description: 'The user upgrading their plan.' },
object: { type: 'Plan', description: 'The new plan being subscribed to.' },
effects: [
// 1. Call the Stripe API
{
type: 'apiCall',
service: 'stripe',
method: 'subscriptions.update',
params: { customerId: 'subject.stripeId', planId: 'object.stripePlanId' }
},
// 2. Update our local database
{
type: 'updateRecord',
model: 'User',
id: 'subject.id',
data: { planId: 'object.id' }
},
// 3. Post a message to Slack
{
type: 'apiCall',
service: 'slack',
method: 'chat.postMessage',
params: {
channel: '#sales',
text: '🎉 `{subject.name}` just upgraded to the **{object.name}** plan!'
}
},
// 4. Send a confirmation email via a notification service
{
type: 'notify',
user: 'subject.id',
template: 'upgrade-confirmation-email'
}
]
});
// Now, this entire multi-system workflow can be triggered with one simple, declarative call
// from anywhere in your application.
await upgradeSubscription.execute({
subjectId: 'user-123',
objectId: 'plan-pro'
});
With this one definition, the entire business process is captured. Your frontend or backend no longer needs to know about Stripe, Slack, or your database schema. It just needs to execute a single, meaningful Verb.
Adopting this approach has profound implications for your architecture and team velocity.
Need to change the Slack notification message? You edit one line in the Verb definition. Want to migrate from Stripe to another payment processor? You update the apiCall effect in one place, and every part of your system that uses this action will instantly adopt the change without any code modifications.
Whether a subscription is upgraded via the user interface, an admin panel, or an automated script, you are guaranteed that the exact same logic and side effects are executed every single time. This eliminates a huge class of bugs related to inconsistent state.
Because every action is a discrete, logged event, Verbs.do provides a perfect audit trail out of the box. You can see precisely who did what, when they did it, and whether every integration side effect succeeded or failed. This visibility is invaluable for debugging, support, and compliance.
Verbs are composable building blocks. The effects of one Verb can trigger another, allowing you to chain actions together to create sophisticated, automated processes. This is the foundation of a truly agentic workflow, where your system can intelligently react to events and orchestrate complex tasks across services without brittle, hard-coded logic.
Stop writing glue code. Stop scattering your business logic to the winds. By treating integrations not as one-off tasks but as side effects of well-defined business actions, you build a system that is more resilient, observable, and adaptable to change.
A unified action layer is the key to unlocking seamless, scalable, and maintainable integrations. It's time to translate your operations into powerful, executable verbs.
Ready to centralize your business logic and streamline your integrations? Explore Verbs.do and start defining your business actions as code today.