In the world of task automation and intelligent agents, complexity is the enemy of reliability. As we build more sophisticated systems, a single, monolithic script can quickly become a brittle, unmanageable tangle of logic. When something breaks, debugging is a nightmare. When requirements change, updates are terrifying. There has to be a better way.
Enter the atomic action.
This powerful concept is the core of the .do platform, providing a fundamentally different approach to building automations. Instead of thinking in large, complex processes, we start with the smallest, most fundamental unit of work.
An atomic action is the smallest, indivisible unit of work in any system. Think of it as a single, self-contained, executable task that does one thing and does it well.
Like a single LEGO brick, an atomic action is simple on its own. But when you combine them, you can build incredibly powerful and reliable agentic workflows. This is the foundation: Execute. Automate. Scale.
Talk is cheap. Let's see what an atomic action looks like in practice. On the .do platform, you define actions directly in code, turning your business logic into a programmable building block.
Here’s a simple TypeScript example of an action that sends 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);
Let's break down what makes this so powerful:
A common point of confusion is the difference between an action and a workflow. The distinction is crucial.
This separation is the key to building resilient systems. When you build with atomic actions, you gain immense flexibility. Need to change how emails are sent? You only update the sendWelcomeEmail action, and every workflow that uses it instantly benefits—without you having to touch the workflow's logic. This modularity is essential for scaling your task automation efforts.
The true power of the .do platform is that you aren't limited to a pre-built library of actions. You can—and should—create your own.
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.
This concept, often called "business as code," means you can create a library of your company’s core operational capabilities.
Each of these processes, once encapsulated as an atomic action, becomes a reliable, version-controlled, and easily composable component for any future agentic workflow or automation project.
The future of automation isn’t about writing bigger scripts; it’s about composing smarter, smaller, and more reliable pieces. Atomic actions are the fundamental unit of this future, and they are the building blocks you need to create truly unbreakable workflows.
What is an atomic action in the .do platform?
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.
How are actions different from workflows?
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.
Can I create my own custom actions?
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.