In modern software development, we treat our application code with incredible rigor. We use version control like Git, conduct peer reviews, and run automated tests. Yet, the critical business processes that our applications drive—user onboarding, order fulfillment, data processing pipelines—are often managed in opaque GUI tools, brittle scripts, or worse, manual checklists.
This disconnect creates fragility. When a multi-step process fails, what happens? Do you send a customer two invoices? Is a user left in a half-provisioned state? How do you debug, roll back, or even understand what went wrong?
It's time for a paradigm shift. It's time to treat our business logic with the same discipline as our application logic. This is the core idea behind Business-as-Code, and it starts with a simple, powerful primitive: the atomic action.
Complex workflows are orchestration nightmares. They involve multiple API calls, database writes, and third-party service integrations. A single failure can cascade, leaving your system in an inconsistent state. The core problem is that most operations aren't designed to be run as part of a larger, fault-tolerant process. They lack two critical properties: atomicity and idempotency.
This is where action.do comes in. It's the foundational building block for your Business-as-Code.
action.do provides a reliable, auditable, and idempotent way to define and execute single, atomic actions within your agentic workflows.
Think of an atomic action as a single, indivisible operation. It either completes successfully, or it fails entirely, leaving no messy, partial state behind. It’s the fundamental unit of work.
By breaking down a complex process into a series of these simple, single-purpose actions, you transform a fragile script into a robust, reliable workflow.
Executing an action is designed to be simple and declarative. You state what you want to do, not how to do it.
import { Do } from '@do-sdk/core';
// Initialize the .do client with your API key
const a = new Do(process.env.DO_API_KEY);
// Execute a specific, atomic action with parameters
const { result, error } = await a.action.execute({
name: 'send-welcome-email',
params: {
userId: 'usr_12345',
template: 'new-user-welcome-v2'
}
});
if (error) {
console.error('Action failed:', error);
} else {
console.log('Action Succeeded:', result);
}
This code doesn't contain the logic for SMTP connections or template rendering. It simply invokes a well-defined action, send-welcome-email, with the necessary parameters. The underlying platform handles the execution, logging, and error handling.
The power of this model comes from three core principles:
These atomic actions are the building blocks. A workflow.do is the blueprint that orchestrates them to achieve a larger business goal.
Because your workflow is just a definition that composes actions, you can store it in a file, check it into Git, send it for code review, and deploy it through your CI/CD pipeline. Your business process is now versioned, testable, and manageable—it has truly become Business-as-Code.
Furthermore, you are not limited to a pre-canned set of actions. The platform is designed for you to define your own custom actions. You can wrap your existing business logic—a microservice, a serverless function—and expose it as a reusable, auditable component that can be invoked via the action.do API.
Stop wrestling with brittle scripts and opaque workflow engines. Embrace the Business-as-Code revolution. By breaking down your processes into atomic, idempotent, and auditable units with action.do, you can build complex, agentic workflows that are as reliable and manageable as your core application code.
Ready to build workflows that you can trust? Explore .do and transform your business logic.
What constitutes an 'atomic action'?
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. Examples include sending a single email, making one API call, or writing a single record to a database.
Why is idempotency important for actions?
Idempotency ensures that executing the same action multiple times with the same parameters has the same effect as executing it once. This is crucial for building reliable systems that can recover from failures without causing unintended side effects, like sending duplicate invoices.
How does action.do relate to a workflow.do?
action.do represents the individual steps or building blocks. A workflow.do is a sequence or graph of these actions orchestrated to achieve a larger business outcome. You compose workflows from one or more atomic actions.
Can I define my own custom actions?
Yes. The .do platform allows you to define your own custom actions as functions or microservices, which can then be invoked via the action.do API. This turns your existing business logic into reusable, auditable components.