In the world of workflow automation, complexity is the enemy of reliability. As we build increasingly sophisticated systems and agentic workflows, a single failure point in a multi-step process can bring everything to a grinding halt, leaving systems in a messy, inconsistent state. What if we could build our automations from unshakeable, indivisible units of work?
This is the principle behind action.do. By embracing the concept of atomic actions, you can power your agentic workflows with fundamental building blocks that guarantee precision and reliability. It's time to stop building brittle chains of tasks and start composing robust services from the ground up.
BUILDING BLOCKS FOR AUTOMATION
Borrowed from the world of database transactions, an atomic action is the smallest, indivisible unit of work within a workflow. Think of it as a single, specific task—like sending a transactional email, updating a customer record in a CRM, or calling an external API.
The key is its "all-or-nothing" guarantee. An atomic action has only two possible outcomes:
There is no middle ground. This simple but powerful constraint eliminates the risk of partial execution, ensuring your systems remain consistent and predictable, even when things go wrong. On the .do platform, these actions are the bedrock of reliable automation.
Invoking an atomic action is designed to be straightforward and developer-friendly. Using the .do SDK, you can execute a predefined, versioned action with a simple API call, abstracting away the underlying complexity.
Here’s how you might 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');
As you can see, the code is clean and declarative. We state our intent—execute the send-welcome-email action with specific parameters—and the .do platform handles the rest, from execution to logging and error management. This is a core tenet of Business-as-Code: defining your business processes as clear, callable, and manageable code.
It's important to distinguish between the building blocks and the final product.
Actions are the Lego bricks; services are the complete model you build with them. This separation of concerns allows you to build complex, high-value services from simple, reusable, and independently testable components.
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.
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.
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.
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.
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.