In the world of workflow automation, reliability is paramount. Brittle scripts, tangled dependencies, and partially completed tasks can lead to data inconsistencies, failed processes, and frustrated users. As we move towards more sophisticated, AI-driven "agentic workflows," the need for a solid foundation becomes even more critical. How can we ensure that every step in a complex automation is executed with precision and predictability?
The answer lies in adopting a granular, foundational approach. Instead of building monolithic automations, we must break them down into their smallest, most fundamental units.
BUILDING BLOCKS FOR AUTOMATION
Welcome to action.do, the core component of the .do platform for defining and executing atomic actions. These actions are the indivisible building blocks that empower you to construct complex, reliable, and scalable automations with confidence.
In computer science, an operation is "atomic" if it is indivisible and irreducible. This means it either completes successfully in its entirety, or it fails completely, leaving the system in its original state. There is no middle ground, no partial success.
Think of it like a bank transfer. When you move money from your savings to your checking account, two things must happen: a debit from savings and a credit to checking. If the debit succeeds but the credit fails, your money vanishes. An atomic transaction ensures that both operations succeed, or neither does.
In the context of workflow automation, an atomic action applies this same all-or-nothing principle to a single business task. Examples include:
By encapsulating each of these tasks as an atomic action, you build a foundation of reliability, ensuring your workflows never get stuck in a confusing, inconsistent state.
The .do platform provides a robust framework for implementing this concept with action.do. You define a single, granular task—along with its required inputs and logic—as a versioned, reusable action. This action then becomes a reliable, API-callable unit that you can execute on demand.
Let's see how simple it is to invoke a predefined action using the .do 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');
In this example, we aren't writing the complex logic for SMTP connections or email templating. We are simply executing the send-welcome-email action. The underlying complexity is neatly encapsulated, making our application code cleaner and more focused on the business intent.
While atomic actions are the fundamental building blocks, their true power is realized when they are composed into higher-level workflows. This is where service.do comes in.
For example, a "New User Onboarding" service could orchestrate several atomic actions in sequence:
This compositional approach allows you to build sophisticated, multi-step agentic workflows from simple, reliable, and reusable components.
The .do platform fully embraces the Business-as-Code philosophy. This means you can define your own custom actions, encapsulating any proprietary business logic, external API integration, or script.
You write the code for your action's logic, define its parameters, and deploy it to the platform. From that moment on, it becomes a versioned, callable, and managed part of your automation toolkit. This allows you to treat your business processes with the same rigor as your application code—with version control, peer reviews, and automated testing.
By focusing on atomic units of work, action.do provides the precision and reliability needed for modern automation. Stop wrestling with brittle scripts and start architecting elegant, resilient, and scalable workflows. Define your fundamental tasks as atomic actions and compose them into powerful services that drive your business forward.
What is an 'atomic action' in the context of .do?
An atomic action is the smallest, indivisible unit of work within a workflow. It represents a single, specific task—like sending an email or updating a database record—that either completes successfully or fails entirely, ensuring system reliability and preventing partial states.
How do actions differ from services?
An action (action.do) is a single, granular operation. A service (service.do) is a higher-level business capability composed of one or more actions orchestrated into a workflow. Actions are the building blocks; services are the valuable outcomes.
Can I create my own custom actions?
Yes. The .do platform empowers you to define your own custom actions using Business-as-Code. You can encapsulate any business logic, external API call, or script into a reusable, versioned, and callable action for your agentic workflows.
How are actions invoked?
Actions are invoked programmatically through the .do API or our language-specific SDKs. You simply call the action by its unique name and provide the necessary parameters, allowing for seamless integration into any application or system.
What happens when an action fails?
Because actions are atomic, a failure is handled cleanly without leaving your system in an inconsistent state. The platform provides detailed error logging and allows you to configure automated retries, notifications, or alternative compensatory actions.