In the world of software and business automation, complexity is the enemy of reliability. We've all seen it: a multi-step user onboarding process fails halfway through, leaving a user in limbo—created in the database but without a welcome email or trial access. These brittle, monolithic processes are a constant source of errors, manual interventions, and frustrated customers.
What if you could build your business logic like you build modern applications? By breaking it down into small, robust, and independent components.
This is the principle behind action.do. We believe in a new paradigm: Business-as-Code. And the fundamental building block of this paradigm is the atomic action.
action.do allows you to define and execute single, atomic actions within your agentic workflows. It’s the secret to building robust, reliable, and auditable business processes.
An atomic action is a single, indivisible operation that is guaranteed to either complete successfully or fail entirely, leaving no messy partial state behind. Think of it as a single transaction for your business logic.
Good examples of atomic actions include:
The key is "one." An action doesn't try to do everything. It does one thing, and it does it perfectly. This simplicity is its greatest strength.
Seeing is believing. With the .do SDK, executing a defined action is clean and straightforward. You simply name the action you want to run and provide the necessary parameters.
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);
}
Notice the clear, unambiguous response: result or error. There is no middle ground. The action either succeeded or it failed, and your application knows exactly how to proceed.
Why is this so important for task execution? Because in the real world, things fail. Networks glitch, servers time out, and APIs become temporarily unavailable. A robust system must be able to retry a failed operation without causing unintended side effects.
This is where idempotency comes in.
An idempotent action ensures that executing it multiple times with the same parameters has the exact same effect as executing it just once.
Imagine a charge-customer action. If a network error occurs after the payment is processed but before you receive a confirmation, you would want to retry the action. An idempotent implementation would recognize that this specific charge has already been made and simply return a success, rather than charging the customer a second time. action.do is designed with this principle at its core, preventing duplicate invoices, multiple emails, and other costly mistakes.
So, if action.do is for single steps, how do you orchestrate a complete business process like user onboarding?
That's where workflow.do comes in.
You compose a workflow from one or more atomic actions. Your "Onboard New User" workflow might look like this:
By composing workflows from auditable, idempotent actions, you build a system that is resilient by design. If step 3 fails, it can be retried independently without re-executing steps 1 and 2.
The platform isn't limited to a pre-defined set of operations. The real power of action.do is unlocked when you turn your own business logic into reusable components.
Yes, you can define your own custom actions.
By wrapping your existing functions or microservices, you can register them with the .do platform. They instantly become standardized, auditable, and idempotent building blocks that can be invoked via the action.do API and used in any workflow. This is the essence of Business-as-Code: turning your unique logic into manageable, repeatable assets.
Stop wrestling with complex, fragile scripts. Start building with simple, powerful, and reliable atomic actions. By embracing this fundamental building block, you create a foundation for scalable, resilient, and transparent workflow automation.
action.do provides the framework to execute flawlessly, audit everything, and repeat reliably.