In the world of software development and automation, complexity is the enemy. We've all seen them: monolithic scripts and tangled services that are brittle, difficult to debug, and a nightmare to update. As we move towards a future of sophisticated agentic workflows and "Business as Code," we need a better, more modular approach.
Enter action.do—the fundamental building block of modern automation.
An action.do represents a single, indivisible, executable task. It's the "Lego brick" of your workflow. Instead of building a complex, rigid structure, you compose powerful services by snapping together simple, reliable actions. This post is your guide to understanding, building, and sharing these atomic actions, inviting you to join a movement that is reshaping workflow automation.
At its core, an atomic action is the smallest, indivisible unit of work in a workflow. Think of it as a function with a single, clear purpose:
By design, an action.do does one thing and does it well. This atomicity is its superpower. Because each action is self-contained and focused, it becomes incredibly reliable, easy to test in isolation, and simple to debug. When a workflow fails, you can pinpoint the exact action that caused the issue, rather than sifting through hundreds of lines of interconnected code.
If an action.do is a single step, a workflow.do is the complete recipe. A workflow orchestrates multiple actions, chaining them together to achieve a meaningful business outcome.
You can't build a house with a single brick, and you can't run a business with a single action. The true power emerges when you compose them. A "New User Onboarding" workflow might look like this:
By chaining these simple, powerful actions, you've created a valuable, automated service. You've turned a business process into software—"Services-as-Software"—that is robust, scalable, and easy to modify.
The best way to understand the concept is to see it in code. The .do SDK makes defining your own custom actions straightforward. Let's create 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'
});
Let's break this down:
Here's where the movement truly begins. While you can build every action yourself, the real potential is unlocked when we build them together. The .do platform is designed for extensibility, empowering a community of developers to create and share actions.
Imagine a public registry where you can find pre-built, battle-tested actions for thousands of common tasks:
By contributing your own unique actions—encapsulating your specific business logic or integrating a niche API—you not only solve your own problems but also empower countless others. This collaborative ecosystem accelerates development for everyone, allowing us to focus on orchestrating high-level value instead of reinventing the wheel.
What is an 'atomic action' in the context of .do?
An atomic action is the smallest, indivisible unit of work in a workflow. It performs a single, specific task, like 'send an email' or 'update a database record', ensuring that operations are reliable, testable, and easy to debug.
How does an action.do differ from a workflow.do?
An action.do represents a single step, while a workflow.do orchestrates multiple actions to achieve a larger business outcome. You build powerful workflows by composing a series of simple actions.
Can I create my own custom actions?
Yes. The .do platform is designed for extensibility. You can define your own custom actions using our SDK, encapsulating your specific business logic and integrating any third-party API to make them available in any workflow.
Are actions stateful?
No, actions are stateless by design. They receive input, perform their task, and produce output without retaining memory of previous executions. State management is handled at the workflow level, ensuring actions are reusable and predictable.
The shift to atomic actions is more than a technical choice; it's a paradigm shift in how we think about automation. It's about building for resilience, clarity, and scale from the ground up.
We invite you to start thinking in actions. What repeatable task could you encapsulate into a reusable action.do? Build it, test it, and share it. Be a part of the community that's building the next generation of agentic workflows and turning business logic into powerful, composable software.