In the world of software and automation, complexity is the enemy of reliability. As we build increasingly sophisticated systems—from simple data pipelines to advanced agentic workflows—the need for a solid, dependable foundation becomes paramount. How can we ensure our automations are robust, easy to debug, and simple to scale? The answer lies in breaking them down to their smallest, most fundamental parts.
Enter action.do: the atomic unit of work in the .do ecosystem. An action.do represents a single, indivisible, and executable step. By chaining these simple, powerful actions together, you can compose powerful automated services and deliver high-value Services-as-Software.
Think of an action.do as a single Lego brick. By itself, it performs one specific function perfectly. You can't break it down any further. This "atomicity" is its superpower. An action might be 'send an email', 'update a CRM record', 'create a calendar event', or 'query a database'.
This approach brings several key advantages:
Creating and using an action is designed to be intuitive for developers. With the .do SDK, you can define your business logic as code, encapsulating it into a reusable component.
Let's look at a simple example in TypeScript. Here, we'll define an action that sends a welcome email to a new user.
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 see a few key components:
Once defined, executing the action is as simple as calling the .execute() method with the required parameters. The action handles the task and returns a result, which can then be used by the next step in your workflow.
While an action.do is a single step, a workflow.do is the conductor of the orchestra. A workflow orchestrates multiple actions in a specific sequence, with logic, conditions, and error handling to achieve a larger business outcome.
You build powerful, resilient workflows by composing a series of simple, stateless actions. For example, a "New User Onboarding" workflow might look like this:
Each step is an independent action.do. If the Slack notification fails, you know the user was still created in the database and received their email. This decoupling makes the entire system more robust and easier to maintain.
Q: What is an 'atomic action' in the context of .do?
A: 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.
Q: How does an action.do differ from a workflow.do?
A: 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.
Q: Can I create my own custom actions?
A: 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.
Q: Are actions stateful?
A: 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 action.do philosophy fundamentally changes how we approach automation. By focusing on small, reusable, and stateless components, we can build systems that are not only powerful but also scalable and maintainable. It's time to stop writing monolithic scripts and start composing your business logic with the atomic building blocks of modern automation.
Ready to build your first action? Explore the .do SDK and discover how easy it is to turn any task into a powerful, reusable component.