In the landscape of modern business, processes can feel like a tangled web. Manual hand-offs, disconnected systems, and a lack of visibility create friction, slow down operations, and make scaling a nightmare. We dream of seamless, automated systems, but the path from our current chaotic state to a streamlined, coded workflow seems daunting. What if you could build robust automation not with monolithic, inflexible scripts, but with simple, powerful building blocks?
This is the core principle behind agentic workflows. Instead of chaos, you get code. Instead of complexity, you get clarity. The foundation of this entire approach starts with one simple but profound concept: the atomic action.
Think of building a complex structure with LEGOs. You don't start with a fully-formed wall; you start with a single, standard brick. An atomic action is the LEGO brick for your business automation.
In the context of the .do ecosystem, an atomic action is the smallest, indivisible unit of work within an agentic workflow. It’s a self-contained function designed to perform one specific task perfectly. It has clearly defined inputs, produces a predictable output, and is built to be reliable, reusable, and completely observable.
Common examples of atomic actions include:
Each action is a specialist, focused on executing its task flawlessly.
"Wait," you might be thinking, "isn't this just a function call?" That's a great question. While an action.do wraps a function, it adds a crucial, structured layer that transforms a simple script into a managed, enterprise-grade component.
Here’s the difference:
Let's see what this looks like in practice. Here's how you'd define a send-email action using action.do.
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.
By wrapping our logic in the Action class, the simple task of sending an email is now a robust, observable piece of our automation infrastructure.
This is where the magic happens. Atomic actions are powerful on their own, but their true purpose is to be combined. They are the building blocks for creating complex, multi-step business processes. This orchestration is managed by higher-level services like a workflow engine.
Imagine a new user signs up for your product. A simple, manual process might involve a support agent sending a welcome email and then creating a task to follow up. With an automated workflow built from atomic actions, it looks like this:
Trigger: New User Created
This sequence of independent, reliable actions forms a complete, automated workflow. If the Slack notification fails, it doesn't stop the user from getting their welcome email. The system can retry the failed action or alert an operator, all without disrupting the core business process. This is the path from chaos to clean, resilient code.
Q: What is an 'atomic action' in the context of .do?
A: 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.
Q: How does action.do differ from a simple function call?
A: 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 business automation.
Q: Can I combine multiple actions?
A: Absolutely. The core purpose of atomic actions is to serve as building blocks. They are designed to be orchestrated by a workflow engine to create complex, multi-step business processes.
Stop wrestling with brittle scripts and opaque processes. Start building your business automation on a foundation of solid, manageable, and observable components. By embracing atomic actions, you transform your workflows from a source of friction into a scalable, codified asset for your company.
Ready to start building? Explore action.do and lay the foundation for your first agentic workflow today.