In the world of workflow automation, complexity is the enemy of reliability. As processes grow, they often become fragile, tangled webs of dependent tasks. A single failure can cascade, leaving systems in a dreaded "in-between" state—a customer charged but without access, a user created but never notified. But what if you could build your automations from a foundation of absolute certainty?
Enter action.do, the primitive for executing atomic actions on the .do platform.
At its core, action.do is about mastering atomicity. It allows you to define single, indivisible tasks that are the fundamental building blocks for sophisticated agentic workflows. By encapsulating logic into these reliable, API-callable units, you can build complex systems that are robust, scalable, and easy to manage.
BUILDING BLOCKS FOR AUTOMATION
Think of an atomic action as a single Lego brick. It's a small, self-contained unit with a single purpose. You can't break it in half; it's either a whole brick or it isn't.
In the context of the .do platform, an atomic action is the smallest, indivisible unit of work that either completes successfully or fails entirely. There is no middle ground.
This "all or nothing" guarantee is what makes them so powerful. An action to send-welcome-email will either successfully send the email or fail cleanly, allowing your system to retry or escalate the issue. It will never leave you wondering if the email was partially sent. This principle of atomicity eliminates data inconsistencies and makes your automated processes incredibly dependable.
Defining and calling actions is designed to be simple and intuitive for developers. action.do allows you to trigger these reliable operations with a straightforward API call, abstracting away the underlying complexity.
Let's look at a common scenario: sending a welcome email to a new user. Instead of weaving email logic directly into your application code, you can execute a predefined send-welcome-email action.
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, your application's only job is to call client.action.execute. The heavy lifting—finding the user's email, rendering the template, and handling the email provider's API—is encapsulated within the send-welcome-email action on the .do platform. This is the essence of Business-as-Code: your core business processes become versioned, reusable, and testable components.
If an action.do is a single brick, then a service.do is the entire structure you build with those bricks. This distinction is key to architecting powerful workflows.
By separating granular tasks from high-level workflows, you create a system that is both powerful and flexible. You can easily reuse actions across multiple services and modify a service's workflow without having to rewrite the underlying actions.
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 API 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.
Stop wrestling with fragile scripts and inconsistent states. With action.do, you can build your automations on a foundation of certainty. By focusing on small, atomic, and reusable units of work, you unlock the ability to create truly robust, scalable, and sophisticated agentic workflows.
Ready to build better? Explore the .do platform and start defining your first atomic action today.