In the world of business automation, we've moved from simple scripts to complex, interconnected systems. The rise of "agentic workflows"—autonomous processes that can execute complex business operations—demands a new way of thinking. How do you build sophisticated, reliable automation without creating a tangled mess of brittle, unmanageable code?
The answer lies in starting small. The foundation of robust automation is the atomic action.
With action.do, we provide the building blocks for this new era. It's a framework to encapsulate individual tasks into manageable, reusable, and observable actions, allowing you to build complex workflows from simple, powerful components.
Execute. Measure. Automate.
Think of an atomic action as the smallest, indivisible unit of work in your automation ecosystem. It's a self-contained function designed to do one thing and do it perfectly. Whether it's sending an email, updating a CRM record, or querying an API, the action is:
By breaking down a large business process—like "onboard a new customer"—into a series of atomic actions (create-account, send-welcome-email, add-to-crm), you create a system that is transparent, scalable, and easy to debug.
"Isn't this just a fancy function?" It's a fair question. While an action.do does wrap a function, it adds a crucial, structured layer that transforms a simple script into an enterprise-grade component.
When you define a task using action.do, you're not just writing code; you're creating a managed, observable, and standardized asset for your entire organization. This structured layer provides:
This turns a simple task into a robust building block ready for mission-critical automation.
Let's see how simple it is to define an atomic action. Here, we'll create a send-email action using TypeScript.
import { Action } from '@do-co/core';
// Define the input for our action
interface SendEmailInput {
to: string;
subject: string;
body: string;
}
// Define the output of our action
interface SendEmailOutput {
messageId: string;
status: 'sent' | 'failed';
}
// Create the action as a service
const sendEmail = new Action<SendEmailInput, SendEmailOutput>({
name: 'send-email',
description: 'Sends a transactional email.',
handler: async (input) => {
// Integration with an email provider (e.g., SendGrid, SES)
// would happen here. For this example, we'll simulate it.
console.log(`Sending email to ${input.to}...`);
const messageId = `msg_${Date.now()}`;
return {
messageId,
status: 'sent',
};
},
});
// This action can now be executed within any workflow or agent.
In this snippet, we've defined a clear contract: the action requires a to, subject, and body, and it will return a messageId and status. The core logic lives in the handler. This sendEmail action is now a standardized component that any workflow or agent in your system can reliably call, knowing exactly how it will behave.
The true power of atomic actions is realized when they are combined. They are designed to be the fundamental building blocks orchestrated by higher-level workflow engines or autonomous agents.
Imagine an "Order Fulfillment" workflow. It doesn't contain the logic for charging a card or printing a shipping label. Instead, it orchestrates a sequence of atomic actions:
Each step is a discrete, testable, and reusable action. If the update-inventory step fails, you know exactly where the process broke down, and the system can handle the error gracefully without affecting the other components.
An atomic action is the smallest, indivisible unit of work in an agentic workflow. It's a self-contained function (like sending an email or updating a CRM record) with clear inputs and outputs, designed to be reliable, reusable, and observable.
While an action.do wraps a function, it adds a structured layer of observability, error handling, retries, and standardization. This transforms a simple function into a managed, enterprise-grade component for reliable automation.
Absolutely. The core purpose of atomic actions is to serve as building blocks. They are designed to be orchestrated by higher-level services like workflow.do or agent.do to create complex, multi-step business processes.
Common actions include 'send-email', 'create-support-ticket', 'update-database-record', 'query-api', 'post-to-slack', or 'transcribe-audio'. Each action is focused on performing one specific task perfectly.
Agentic workflows represent the future of scalable and resilient business automation. By adopting a building-block approach with action.do, you can leave behind brittle scripts and start creating robust, observable, and manageable "business processes as code."
Ready to build your first atomic action? Visit action.do to dive into the documentation and start transforming your automation strategy.