In the world of complex systems and intelligent automation, the quest for simplicity and reliability is paramount. As we build increasingly sophisticated agentic workflows, the monolithic scripts of the past become brittle, hard to maintain, and impossible to scale. The solution isn't to build bigger, more complex functions, but to think smaller. Much smaller.
Enter the atomic action—the fundamental, indivisible unit of work. On the .do platform, we believe that every powerful automation is built from these simple, self-contained building blocks. This approach transforms chaotic processes into manageable, programmable, and scalable agentic workflows.
So, what exactly is an atomic action? Think of it as the Lego brick of your automation. It's a single, self-contained task designed to do one thing and do it well.
An atomic action is:
By breaking down complex operations into these discrete units, you gain unprecedented control and clarity over your entire automation landscape.
Defining an atomic action on the .do platform is straightforward. Let's look at how to create a simple yet crucial action: sending a welcome email to a new user.
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);
In this example, we've created a reusable send-welcome-email action. It clearly defines what it needs (to and name) and what it does (sends an email). We can now execute this action from anywhere, confident in its behavior.
It's crucial to understand the relationship between actions and workflows. If an action is a single brick, a workflow is the entire structure you build with those bricks.
For example, a "New User Onboarding" workflow might be composed of several atomic actions:
Each step is a robust, testable, and independent action. The workflow simply wires them together to achieve a larger business goal. This modularity is the key to building resilient task automation.
Adopting an atomic approach to your agentic workflows isn't just a different way to code—it's a fundamentally better way to build.
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.
Ready to move beyond fragile scripts? Start building with the fundamental unit of work. Explore the .do platform and transform your complex processes into a library of simple, powerful, and scalable atomic actions.