In the world of automation, complexity is the enemy. As business processes grow, the scripts and workflows that power them often become tangled, monolithic beasts. They're difficult to debug, a nightmare to update, and nearly impossible to scale effectively. But what if we could build complex systems from simple, solid, and reusable parts?
This is the paradigm shift offered by atomic actions. By breaking down every process into its smallest, most fundamental tasks, we can build robust, scalable, and beautifully manageable agentic workflows.
Welcome to the atomic unit of work.
An atomic action is the smallest, indivisible unit of work in a workflow. It's a self-contained, executable task—like sending an email, querying a database, or calling an external API. Each action is designed to do one thing well.
Think of atomic actions like LEGO bricks. A single brick has a clear purpose, a standard shape, and can connect to other bricks. By itself, it's simple. But when you combine hundreds of these simple bricks according to a plan (a workflow), you can build anything from a simple house to an elaborate starship.
The key characteristics of an atomic action are:
So, how are actions different from workflows? It's simple:
Actions are the individual steps, while workflows are the orchestration of multiple actions in a specific sequence or logic. You build complex workflows by composing simple, reusable actions together.
Imagine a "New User Onboarding" workflow. Instead of one giant script, you compose it from a series of atomic actions:
Each step is a distinct, testable, and reusable action. If the step for adding them to the mailing list fails, you know exactly where the problem is. If you want to change the welcome email's content, you only need to edit one action without touching the rest of the workflow.
The .do platform treats these concepts as first-class citizens, allowing you to define your business operations as programmable building blocks. This is "Business as Code" in practice.
Here’s how you can define a new atomic action to send a welcome email using the .do TypeScript SDK:
import { Action } from '@do-co/agent';
// Define a new atomic action to send a welcome email
const sendWelcomeEmail = new Action('send-welcome-email', {
title: 'Send Welcome Email',
description: 'Sends a standardized welcome email to a new user.',
input: {
to: { type: 'string', required: true },
name: { type: 'string', required: true },
},
async handler({ to, name }) {
console.log(`Sending email to ${to}...`);
// Actual email sending logic (e.g., using an SMTP service) would go here
const message = `Welcome to the platform, ${name}!`;
console.log(message);
return { success: true, messageId: `msg_${Date.now()}` };
},
});
// Execute the action with specific inputs
const result = await sendWelcomeEmail.run({
to: 'new.user@example.com',
name: 'Alex',
});
console.log(result);
By defining the action in code, you get a clear contract (input schema), version control, and the ability to run and test this atomic unit of work in complete isolation before plugging it into a larger agentic workflow.
Adopting an atomic approach to task automation fundamentally changes how you build and scale. The benefits are transformative:
An atomic action is the smallest, indivisible unit of work in a workflow. It's a self-contained, executable task—like sending an email, querying a database, or calling an external API. Each action is designed to do one thing well.
Actions are the individual steps, while workflows are the orchestration of multiple actions in a specific sequence or logic. You build complex workflows by composing simple, reusable actions together.
Absolutely. The .do SDK allows you to define custom actions with specific inputs, outputs, and business logic. This transforms your unique business operations into reusable, programmable building blocks for any workflow.
Moving away from monolithic scripts and towards a composable architecture of atomic actions is the key to mastering modern automation. It's a strategy that champions clarity, resilience, and scale.
Ready to stop building tangled processes and start composing powerful, agentic workflows?
Explore the .do platform and discover the power of the atomic unit of work.