In the world of AI and intelligent automation, the goal is to build powerful, autonomous systems—often called "agentic workflows"—that can handle complex, multi-step tasks. But as complexity grows, so does the risk of failure. A single error in a monolithic script can bring an entire process to a halt, leaving you to untangle a web of dependencies. The solution isn't to build bigger, more complicated scripts; it's to think smaller. Much smaller.
Enter the concept of the atomic action. At .do, we believe that the foundation of any robust and scalable automation is the action.do—a single, indivisible, and perfectly defined unit of work. It is the fundamental building block for creating reliable automated services and delivering valuable Services-as-Software.
Think of an atomic action as a single Lego brick. It performs one specific task flawlessly, like "send an email," "update a database record," or "query a customer's subscription status." On its own, it's simple. But when you combine these bricks, you can construct anything you can imagine.
In the context of the .do platform, an atomic action is the smallest, indivisible unit of work within a workflow. This atomicity is its superpower. By ensuring that each action performs only one job, we gain three critical advantages:
The true power of action.do is realized when you define your business logic as code. With the .do SDK, you can encapsulate any task—from making a third-party API call to running a complex internal calculation—into a reusable action.
Here’s a simple example in TypeScript of creating an action to send a welcome email:
import { action } from '@do-sdk/core';
// Define an action to send a welcome email
const sendWelcomeEmail = action.create({
id: 'send-welcome-email',
description: 'Sends a welcome email to a new user.',
execute: async ({ email, name }) => {
// Your email sending logic via an external API
console.log(`Sending welcome email to ${name} at ${email}...`);
return { success: true, messageId: 'xyz-123' };
}
});
// Execute the action
const result = await sendWelcomeEmail.execute({
email: 'jane.doe@example.com',
name: 'Jane Doe'
});
In this snippet, we've created a self-contained, executable unit of work. The sendWelcomeEmail action has a clear purpose, defined inputs (email, name), and a predictable output. It can now be imported and used anywhere within your ecosystem.
It's crucial to understand the relationship between an action.do and a workflow.do. If an action is a single step, a workflow is the complete recipe.
You build powerful, agentic workflows by composing a series of simple, atomic actions. This approach allows you to model complex business processes as code, creating systems that are both sophisticated and remarkably easy to maintain.
Absolutely. The .do platform is designed for extensibility. Using our SDK, you can define your own custom actions to encapsulate your unique business logic. This allows you to integrate with any third-party API or internal system, turning your proprietary processes into standardized, reusable building blocks available in any workflow.
No, and this is a critical design principle. Actions are stateless. They receive input, perform their task, and produce an output without retaining any memory of previous executions. This ensures that every action is reusable and predictable. State management, such as tracking a user's progress through an onboarding process, is handled at the workflow.do level, keeping the concerns neatly separated and the system robust.
By embracing atomic steps, you shift from writing fragile scripts to engineering resilient systems. The action.do is more than just a function; it's a philosophy of building with precision, clarity, and control. It's the first and most important step to mastering workflow automation and building the next generation of intelligent agents.