In the world of workflow automation, complexity is the enemy of reliability. As systems grow, automations can become tangled webs of dependent tasks, where a single failure can cause cascading problems, corrupt data, and leave your business processes in a dreaded "in-between" state. How do you build complex automations that are robust, predictable, and easy to debug?
The answer lies in breaking things down to their an indivisible core.
Enter action.do, the fundamental building block for automation on the .do platform. action.do allows you to define and execute atomic actions—single, self-contained tasks that power your agentic workflows with precision and unparalleled reliability.
BADGE: BUILDING BLOCKS FOR AUTOMATION
Think of an atomic action as the smallest possible unit of work in your workflow. It's a single, specific task that must be completed in its entirety. It either succeeds completely, or it fails completely. There is no middle ground.
Consider sending a welcome email to a new user. This single task might involve:
With action.do, this entire sequence is encapsulated as one atomic unit. If any step fails—for instance, the email API is down—the entire action fails cleanly. It rolls back, leaving your system in a consistent state, as if the action was never attempted. This prevents scenarios where the system thinks an email was sent when it wasn't, ensuring your Business-as-Code is always a source of truth.
Integrating these powerful building blocks into your applications is incredibly straightforward. Invoked via a simple API call, actions can be triggered from anywhere in your stack.
Here’s how you can execute a predefined action, like send-welcome-email, 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, we simply call client.action.execute, providing the unique name of the action and the params it requires. The .do platform handles the rest—the orchestration, the error handling, and the atomicity. This clean separation of concerns is at the heart of building scalable and maintainable agentic workflows.
It's important to distinguish between an action and a service on the .do platform.
Actions are the reusable components you use to build valuable services.
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.
Stop wrestling with brittle scripts and unreliable automations. By embracing the power of atomic operations with action.do, you can build sophisticated, resilient, and scalable workflow automation that drives real business value.
Ready to power your agentic workflows with precision? Explore the .do platform and start defining your atomic actions today!