In the rapidly evolving landscape of business automation, developers and operations teams face a constant challenge: building systems that are not only powerful but also reliable, scalable, and easy to maintain. Traditional automation scripts can be brittle, difficult to debug, and nearly impossible to reuse. This is where the paradigm of agentic workflows and atomic actions comes in, offering a structured, robust foundation for modern automation.
Welcome to action.do, the core building block for your automated business processes. Let's explore how reframing your tasks as atomic actions can revolutionize the way you build, execute, and manage workflows.
At its heart, an atomic action is the smallest, indivisible unit of work in any automated process. Think of it as a single, self-contained function designed to perform one specific task perfectly.
An apt analogy is a LEGO brick. A single brick is simple, but it's a standardized, reliable component that you can combine with others to build structures of incredible complexity. In the same way, an atomic action like send-email or update-database-record is a simple building block for sophisticated, multi-step agentic workflows.
The core principle is to encapsulate individual tasks into manageable, reusable, and observable units. This is the foundation of scalable business automation.
You might be thinking, "This sounds like a function. I write functions all the time." And you're right—at its core, an action.do wraps a function. However, it adds a crucial, structured layer that transforms a simple piece of code into an enterprise-grade component for reliable task execution.
Here’s what action.do adds on top of a standard function call:
Theory is great, but let's see what this looks like in practice. Here’s how you can define a simple yet powerful atomic action for sending an email using action.do in 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.
Let's break this down:
This sendEmail action is now a standalone, testable, and reusable component ready to be plugged into any agentic workflow.
The true power of atomic actions is unleashed when you combine them. They are designed to be the fundamental pieces orchestrated by a higher-level service, such as a workflow engine. For example, you could use a service like workflow.do or agent.do to chain these actions together.
Consider a common business process: onboarding a new customer.
Each step is a discrete, reliable, and observable atomic action. If the email fails, the retry logic within that action can handle it. If the database call is slow, observability tools will pinpoint it immediately. You've created a robust, maintainable, and scalable business process from simple, powerful building blocks.
Q: What are some common examples of an action.do?
A: Any discrete task can be an action. Common examples include: create-support-ticket, update-crm-record, query-api, transcribe-audio, generate-invoice, and post-to-slack. Each action is focused on doing one thing perfectly.
Q: Can I really combine multiple actions?
A: Absolutely. That is their core purpose. Atomic actions are designed to be orchestrated by a workflow engine to create complex, multi-step business processes, transforming simple tasks into a powerful, automated system.
By shifting your perspective from writing monolithic scripts to composing workflows from atomic actions, you build systems that are inherently more robust, transparent, and scalable. The action.do framework provides the structure and tooling to make this a reality.
Start thinking about your business processes. What are the indivisible tasks? The atomic units of work? Define them, encapsulate them, and start building your next generation of automation.