In the world of automation, few things are more frustrating than a partial failure. Imagine an e-commerce order where the payment is processed, but the shipping label fails to generate. Or a new user is created in your database, but the critical welcome email is never sent. These scenarios leave your systems in an inconsistent state, creating a poor user experience and a manual cleanup headache for your team.
This lack of integrity is a hidden tax on your automated processes. Every time a multi-step workflow breaks down mid-execution, you lose trust in your automation and waste valuable time untangling the mess.
But what if every single step in your workflow was guaranteed to either succeed completely or fail cleanly, leaving no trace? This is the principle of atomicity, and it's the core of action.do—the fundamental building block for reliable automation.
Modern business processes are complex. A single "event," like a user signing up, can trigger a cascade of operations:
If you chain these together with simple function calls, you're building on a house of cards. A temporary network hiccup or a minor API change can bring the entire sequence to a halt. The result? A user record exists, but the user never gets their welcome email and can't log in. The system is now in an inconsistent, partially-completed state. This is where the concept of an atomic action becomes your most powerful tool.
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. This guarantees data integrity and reliability in your workflows.
Think of it like a bank transfer. You can't just debit one account without crediting another. The entire transaction is a single, "atomic" unit. It succeeds or it fails, but it never leaves the money in limbo.
action.do applies this same unbreakable guarantee to your digital business processes. It allows you to define, execute, and audit any single task, ensuring it runs flawlessly or not at all.
action.do provides the infrastructure to wrap any scriptable task—from an API call to a database update—into a manageable, atomic unit. It’s built on three core principles:
You might be thinking, "Can't I just write a function for this?" While a simple function call executes code, action.do elevates that execution into a managed, observable service.
Unlike a standard function, an action defined in action.do comes with:
Let's see how simple it is to execute a predefined action to send a welcome email. This isn't just calling a mailer function; it's triggering a managed, reliable service.
import { DotDo } from '@do-platform/sdk';
const client = new DotDo({ apiKey: 'YOUR_API_KEY' });
// Execute a predefined action, 'send-welcome-email'
async function sendWelcomeEmail(userId: string) {
const result = await client.action('send-welcome-email').execute({
userId: userId,
template: 'new-user-template-2024',
});
console.log(`Action completed with status: ${result.status}`);
return result;
}
In this snippet, client.action('send-welcome-email') doesn't contain the logic itself. It securely calls the action.do platform to run the 'send-welcome-email' action with the provided parameters. The platform handles the execution, retries, logging, and auditing, returning a simple, clean result.
action.do is designed to be the fundamental building block for larger systems. While it perfects the execution of a single task, its true power is realized when you chain these actions together to create sophisticated, agentic workflows.
An orchestration agent (like the upcoming workflow.do) can direct a series of atomic actions:
Because each step is atomic, the orchestrator knows with certainty whether a step was completed. If send-welcome-email fails, the system doesn't proceed to the next step, and the orchestrator can decide whether to retry, alert a human, or roll back the create-user-record action. This creates a truly resilient and intelligent automation system.
Stop building brittle workflows. Start building with confidence.
Define, execute, and audit any single, atomic task within your business workflows. Get started with action.do and build automation you can trust.
What is an 'atomic action'?
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. This guarantees data integrity and reliability in your workflows.
How is action.do different from a simple function call?
action.do provides a layer of abstraction with built-in observability, retries, and audit trails. It treats actions as manageable, versioned services, making your automation more robust and transparent than a standard function.
What kind of actions can I perform with action.do?
You can define any action that can be scripted, such as making an API call, sending an email, updating a database record, interacting with a smart contract, or running a shell command.
Can actions be chained together?
Yes. action.do is designed as a fundamental building block. You can use an orchestration agent (like workflow.do) to chain multiple atomic actions together to create complex and powerful services.