In the rapidly evolving world of automation, agentic workflows are becoming the new frontier. We're moving beyond simple scripts to intelligent agents that can perform complex, multi-step business processes. But as these systems grow in complexity, so does the risk of failure. What happens when a 10-step user onboarding process fails on step 7? You're left with a partial, corrupted state, a frustrated user, and a debugging nightmare.
The solution isn't to build more complex error handling into every step. The solution is to build on a more reliable foundation. That foundation is the atomic action.
Execute Actions. Flawlessly. At its core, every complex workflow is just a series of individual tasks. action.do provides the fundamental building block for reliable automation by allowing you to define, execute, and audit any single, atomic task within your business workflows. It's the key to building resilient and transparent systems.
So, what exactly is an 'atomic action'?
Think of it like a bank transfer. When you move money from savings to checking, two things must happen: the money must leave savings, and it must arrive in checking. You would never accept a situation where the money left the first account but never appeared in the second. The entire operation must succeed or fail as a single, indivisible unit.
That's atomicity. An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state behind. This guarantee of integrity is non-negotiable for building trustworthy automated systems.
"But wait," you might say, "can't I just write a function to do this?" While a simple function can perform a task, action.do provides a critical layer of abstraction that makes your automation infinitely more robust.
A standard function call is a black box. If it fails, you might get a cryptic error log, but you lack context. Was it a temporary network glitch? A data validation error? action.do elevates a simple task to a managed service with built-in features that are essential for production-grade automation:
Treating actions as manageable, versioned services—rather than just lines of code—is the difference between brittle scripts and resilient, enterprise-ready automation.
Let's look at how simple it is to execute a predefined action using the action.do SDK. In this example, we'll execute an action named send-welcome-email that we've already configured in our action.do dashboard.
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;
}
Let's break this down:
The beauty is in the simplicity. The complexity of retries, logging, and auditing is completely handled by the platform, letting you focus on your business logic.
The power of action.do lies in its flexibility. You are not limited to a specific set of tasks. You can define any action that can be scripted, including:
Crucially, action.do is designed as a fundamental building block. While it perfects the execution of a single task, its true power is unlocked when you chain multiple atomic actions together. Using an orchestration agent (like workflow.do), you can create complex services—like a complete user onboarding sequence—where each step is a reliable, auditable atomic action.
The future of business is automated and agentic. But for these advanced workflows to be successful, they must be built on a foundation of trust and reliability. By ensuring that every individual task is executed flawlessly and transparently, atomic actions provide that foundation.
Stop chasing bugs in complex, monolithic scripts. Start building resilient, scalable, and auditable automation with action.do.
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.