In today's fast-paced digital landscape, business processes are becoming increasingly complex. From onboarding a new customer to processing an order, a single outcome often requires a dozen different steps across multiple systems. Automating these processes can feel like trying to untangle a web of dependencies—daunting, brittle, and difficult to scale.
But what if you could break that complexity down into simple, manageable pieces? What if every business operation could be distilled to its core, essential function?
This is the philosophy behind atomic actions, the fundamental building block of every powerful agentic workflow on the .do platform. By treating tasks as discrete, programmable units, you can move from tangled scripts to elegant, robust, and scalable automations. This is how you transform "business logic" into "business as code."
Think of an atomic action as the smallest, indivisible unit of work. It’s a self-contained, executable task designed to do one thing and do it well. Just as atoms are the building blocks of matter, atomic actions are the building blocks of automation.
An atomic action is:
By embracing this concept, you stop building monolithic, hard-to-maintain automations and start creating a library of reusable, Lego-like bricks that can be assembled in infinite ways.
The true power of this approach becomes clear when you define your own custom actions. The .do SDK allows you to codify your unique business operations into these powerful, reusable blocks.
Let's look at a practical example: creating an action to send a standardized 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's happening here:
This isn't just a script. It's a structured, validated, and self-documenting piece of your business logic, ready to be deployed.
An atomic action is powerful on its own, but its true potential is unlocked when composed into a workflow.
Actions are the individual steps, while workflows are the orchestration of multiple actions in a specific sequence or logic.
If an action is a single instruction in a recipe (chop vegetables), a workflow is the entire recipe card. It dictates the sequence, handles conditional logic, and passes ingredients (data) from one step to the next.
Consider a complete "New User Onboarding" agentic workflow:
This workflow is clear, logical, and composed of four independent, reusable atomic actions. If you later need to change your email provider, you only update the send-welcome-email action. The rest of the workflow remains untouched. This is the essence of building resilient, scalable systems.
Adopting an atomic, compositional approach to task automation yields massive benefits:
Complexity is a given, but chaos is a choice. By breaking down your most sophisticated processes into their atomic units, you can orchestrate powerful, reliable, and scalable agentic workflows. The .do platform provides the framework to define, execute, and scale these individual tasks, transforming your operations into a library of programmable, future-proof assets.
Ready to stop wrestling with complexity and start composing with clarity? Explore the .do platform and build your first atomic action today.