Automation is the backbone of modern business operations. From sending welcome emails to processing customer orders, we rely on automated workflows to save time and reduce errors. But as these systems grow, they often become a tangled web of monolithic scripts and fragile, multi-step processes. A small API change can break an entire chain, and debugging feels like searching for a needle in a haystack.
What if there was a better way?
This is where the philosophy of atomic actions comes in. Instead of building large, complex automations, you build small, self-contained, and reusable units of work. On the .do platform, we call these Actions—the fundamental building blocks for powerful, scalable, and resilient Agentic Workflows.
This guide will walk you through the process of deconstructing your existing automations and rebuilding them as a robust collection of atomic actions on action.do.
Whether you're using a low-code platform or a collection of custom scripts, you've likely encountered the pitfalls of monolithic automation:
At .do, we believe in The Atomic Unit of Work. An atomic action is the smallest, indivisible task in a workflow. It's designed to do one thing and do it exceptionally well.
Consider this simple, powerful concept defined as code on the .do platform:
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 atomic approach so powerful:
Ready to make the switch? Transitioning your automations to action.do is a straightforward process of deconstruction and composition.
Start by choosing one of your existing automations. A great candidate is one that is business-critical but also a frequent source of issues. Let's use a "New E-commerce Order" workflow.
In its current monolithic form, it might look like this:
Now, look at each step and identify the indivisible, reusable tasks. Each one will become a new Action.
Notice how we've made the actions more generic. Instead of send-order-confirmation-email, we have send-transactional-email. This new, more abstract action can be used for password resets, shipping notifications, and more, simply by changing its inputs. This is the power of reusable building blocks.
Now, transform these concepts into code using the .do SDK. You'll create a separate, well-defined file for each of your core business operations.
For example, the action to post a Slack message would be a simple, reusable module:
// /actions/post-slack-message.ts
import { Action } from '@do-co/agent';
export const postToSlack = new Action('post-slack-message', {
title: 'Post Message to Slack',
description: 'Sends a message to a specified Slack channel.',
input: {
channel: { type: 'string', required: true, default: '#general' },
message: { type: 'string', required: true },
},
async handler({ channel, message }) {
// Logic to call the Slack API
console.log(`Posting to Slack channel ${channel}: "${message}"`);
// const response = await slack.chat.postMessage(...);
return { success: true };
},
});
With your library of atomic actions defined, tested, and ready, building the new workflow is simple. The workflow itself contains no complex implementation logic; its only job is orchestration.
Your new agentic workflow on the .do platform would look like this:
The workflow is now clean, readable, and easy to maintain.
After migrating, your automation infrastructure is no longer a fragile house of cards. It's a robust, well-organized library of capabilities—a true "Business as Code" platform.
Ready to break free from monolithic automation? Get started with the .do platform today and discover the power of the atomic unit of work. Execute. Automate. Scale.
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.