In the world of modern software and business operations, complexity is the default. We build intricate systems by connecting databases, firing off APIs, sending notifications, and manipulating data. But as these workflows grow, so does the risk. What happens when a multi-step process fails halfway through? You're left with inconsistent data, confused users, and a debugging nightmare.
The solution isn't to build simpler systems; it's to build systems from simpler, more reliable components. This is the core philosophy behind action.do.
BUILDING BLOCKS FOR AUTOMATION
action.do provides the fundamental building blocks for your agentic workflows: atomic actions. These are single, indivisible tasks designed to either succeed completely or fail cleanly, ensuring your automations run with precision and reliability.
Think of an atomic action as the smallest possible unit of work in a process. It's a single, self-contained operation that cannot be broken down further.
Consider these examples:
The key is "atomicity." Each action is an all-or-nothing event. The credit card charge either goes through successfully, or it fails entirely. There is no in-between state. This simple guarantee is the foundation of building robust, enterprise-grade workflow automation. It eliminates the risk of partial updates and inconsistent system states, making your processes predictable and trustworthy.
It's important to distinguish between an action.do and a service.do. While they work together, they serve different purposes.
For example, a "New User Onboarding" service might be composed of several atomic actions:
Each step is a discrete, reliable action.do, while the entire sequence constitutes the service.do. This modular approach, a cornerstone of Business-as-Code, allows you to build, test, and reuse components with confidence.
The .do platform makes invoking these actions incredibly straightforward. Using our API or SDKs, you can seamlessly trigger actions from anywhere in your application stack.
Here’s how you would execute a predefined 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. You simply specify the action's name and pass the required params. The .do platform handles the execution, logging, and error management, abstracting away the underlying complexity of the API integration.
While the .do platform may come with a library of common actions, its true power is unlocked when you define your own. You can encapsulate any piece of business logic—whether it's an internal script, a proprietary algorithm, or a complex call to a legacy system—into a reusable, versioned, and callable atomic action.
This empowers your entire organization to:
What happens when an action fails? Because they are atomic, the system isn't left in a broken, half-completed state. The entire operation is treated as a single failure.
The .do platform builds on this foundation by providing robust tools for managing these inevitable hiccups. You gain access to detailed error logs to diagnose issues quickly and can configure automated rules for:
By embracing atomic actions, you move from reactive firefighting to proactive, resilient system design. You build workflows that don't just work—they last.
Q: What is an 'atomic action' in the context of .do?
A: 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.
Q: How do actions differ from services?
A: 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.
Q: Can I create my own custom actions?
A: 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.
Q: How are actions invoked?
A: 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.
Q: What happens when an action fails?
A: 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.