In the world of workflow automation, complexity is the enemy of reliability. As we build increasingly sophisticated systems—especially autonomous, agentic workflows—the risk of failure grows. A single dropped API call, a temporary database outage, or a malformed request can cascade through a process, leaving systems in a messy, inconsistent state. How do we build robust automations that can withstand the chaos of the real world?
The answer lies in going back to basics. It's about breaking down complex processes into their smallest, indivisible components. On the .do platform, we call these atomic actions.
By embracing the philosophy of Business-as-Code, we can define, execute, and orchestrate these single, reliable tasks to power agentic workflows with unparalleled precision. action.do is your command to execute these fundamental operations with confidence.
Think of an atomic action as the LEGO brick of your automation. It's the smallest, indivisible unit of work within any workflow. An atomic action represents a single, specific task—like sending a welcome email, updating a customer record in a CRM, or creating a user in a database.
The key is the word "atomic." Inspired by database transactions, an atomic action has only two possible outcomes:
There is no middle ground. An action cannot be "partially complete." If any part of the action fails, the entire operation is treated as a failure, preventing your systems from entering an unpredictable state. This all-or-nothing guarantee is the cornerstone of building reliable, enterprise-grade automations.
It's crucial to distinguish between the building blocks and the finished structure. This is where the difference between an action.do and a service.do becomes clear.
Actions provide the modularity; services provide the business value. By building services from a library of version-controlled, reusable actions, you can develop complex workflows faster and more reliably.
Actions are designed for seamless API integration into any application or system. Using the .do SDK, invoking a predefined action is simple and declarative. Instead of writing custom logic for API calls, error handling, and retries, you simply call the action by name and pass the required parameters.
Here’s how you would execute a send-welcome-email action using our TypeScript SDK:
import { Do } from '@do-platform/sdk';
// Initialize the .do client with your API key
const client = new Do({ apiKey: 'YOUR_API_KEY' });
// Execute a predefined atomic action by name
async function sendWelcomeEmail(userId: string) {
try {
const result = await client.action.execute({
name: 'send-welcome-email',
params: {
recipientId: userId,
template: 'new-user-welcome-v1'
}
});
console.log('Action Executed Successfully:', result.id);
return result;
} catch (error) {
console.error('Action Failed:', error);
}
}
// Run the action for a new user
sendWelcomeEmail('user_12345abc');
This code is clean, readable, and abstracts away the underlying complexity of the task, which is a core tenet of effective Business-as-Code.
While the .do platform may come with a set of common actions, its true power is realized when you define your own. You can encapsulate any piece of business logic—whether it's an external API call, a database script, or a proprietary algorithm—into a reusable, versioned, and callable atomic action.
This empowers you to:
So, what happens when an action fails? Because actions are atomic, the failure is handled cleanly. You are protected from the nightmare of partial updates. For example, if an action to "create a user and send an email" fails during the email step, the user creation step is effectively rolled back, ensuring system consistency.
The .do platform provides robust tools for managing these inevitable failures. You gain access to detailed error logging and can configure automated policies for:
By treating failure as a managed state rather than an unexpected exception, you can build truly resilient systems. Atomic actions are more than just a technical feature; they are a foundational concept for building the next generation of reliable, scalable, and intelligent agentic workflows.