In the world of workflow automation, we often talk about grand, end-to-end services: onboarding a new customer, processing a fulfillment order, or provisioning a cloud environment. These are the valuable outcomes that drive a business. But what happens when a small part of that massive process fails? The entire system can be left in a broken, inconsistent state, leading to hours of manual cleanup and frustrated customers.
The solution isn't to build bigger, more monolithic automations. It's to think smaller. Much smaller.
Enter the concept of the atomic action, the fundamental building block of modern, agentic workflows. By deconstructing complex services into their smallest, indivisible steps, you can build systems that are more reliable, reusable, and easier to understand. On the .do platform, this powerful paradigm is realized through action.do.
BUILDING BLOCKS FOR AUTOMATION
Think of building a complex structure with LEGOs. You don't start with a fully formed wall; you start with a single, standard brick. An atomic action is that brick.
In the context of Business-as-Code, an atomic action is the smallest, indivisible unit of work within a workflow. It represents a single, specific task—like sending an email, updating a database record, or calling an external API. The key is its "atomic" nature: the action either completes successfully or it fails entirely. There is no in-between, no partial state.
This simple guarantee is revolutionary for workflow reliability:
The .do platform provides a first-class primitive for defining and executing these powerful building blocks: action.do. Actions are the granular steps, while Services (service.do) are the higher-level business capabilities you build by orchestrating one or more actions into a workflow.
Invoking an action is a simple, programmatic API call. You call the action by its unique name and provide the necessary parameters.
Here’s how you might execute a predefined send-welcome-email action using the .do 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');
In this example, the entire complexity of connecting to an email provider, fetching a template, populating it with user data, and sending the message is encapsulated within the send-welcome-email action. Your application code stays clean and focused on the intent, not the implementation.
The real power of the .do platform is that you are not limited to a pre-built library. You are empowered to define your own custom actions using Business-as-Code. You can encapsulate any piece of business logic—whether it's an internal script, a third-party API integration, or a complex data transformation—into a reusable, versioned, and API-callable action.
This approach brings the discipline and power of modern software engineering to your business processes:
By moving from monolithic services to a collection of well-defined atomic actions, you build a foundation for resilient, scalable, and truly agentic workflows. Your systems are no longer fragile chains of events but robust networks of reliable, independent tasks, ready to be composed and recomposed to meet any business demand.
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.