In the world of software development and automation, complexity is the enemy of reliability. As we build increasingly sophisticated systems—from simple business process automations to advanced agentic workflows—the risk of failure grows with every moving part. The key to mastering this complexity isn't to build bigger, monolithic systems, but to think smaller. Much smaller.
Enter action.do, the fundamental building block of the .do ecosystem. An action.do represents a single, indivisible, and executable step. It's the atomic unit of work that allows you to transform your business logic into code, composing simple, powerful actions to create robust and scalable automated services.
At its core, an action.do is an atomic action. Think of it like a single function in programming or a single brick in a LEGO set. It is designed to perform one specific task and do it exceptionally well.
This "atomic" nature is its superpower. Instead of creating a massive script that onboards a new user by creating an account, adding them to a CRM, sending a welcome email, and provisioning their software licenses all at once, you break it down:
This granularity provides immediate benefits:
Defining an action is straightforward. Using the @do-sdk/core, you encapsulate your logic within a simple structure, giving it a unique ID and a clear description. This turns a piece of business logic into a reusable, executable component.
Here’s how you would define an action.do to send a welcome email using TypeScript:
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}...`);
// On success, return a consistent output
return { success: true, messageId: 'xyz-123' };
}
});
// Execute the action with specific inputs
const result = await sendWelcomeEmail.execute({
email: 'jane.doe@example.com',
name: 'Jane Doe'
});
In this example, the send-welcome-email action is a self-contained unit. It takes an email and name as input, performs its task, and returns a structured output. This action can now be used anywhere, by anyone (or any agent) that needs to send a welcome email.
A common question is how action.do relates to workflow.do. The distinction is simple yet powerful:
You don't build complex automation with a single, monolithic action. You build it by composing a series of simple, stateless actions within a workflow. The workflow manages the state, handles the logic of passing outputs from one action as inputs to the next, and implements error handling and retries.
This composable approach is the foundation of turning Business as Code into a reality, enabling the delivery of valuable Services-as-Software.
Every action.do is designed around a few key principles that make it perfect for modern automation and agentic systems.
The rise of agentic AI systems introduces a new paradigm for automation. These agents can reason and make decisions, but to interact with the world, they need a reliable toolkit of capabilities.
This is where action.do shines. Each well-defined action.do becomes a tool the agent can use. When an agent decides it needs to "update a customer record," it doesn't have to guess how. It can invoke the update-customer-record action—a trusted, tested, and reliable tool—knowing exactly what inputs are required and what output to expect. This makes agentic behavior more predictable, secure, and effective.
By building a library of atomic actions, you are essentially creating a robust and sanctioned API for your AI agents to operate your business.
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.