In today's complex software landscape, building automated workflows is no longer a luxury—it's a necessity. But as these workflows grow, they often become brittle, hard to debug, and prone to leaving systems in a messy, inconsistent state. What if you could build robust, reliable processes by starting with the smallest possible unit of work?
Enter the concept of the atomic action. action.do provides a reliable, auditable, and idempotent way to define and execute these single, atomic tasks within your agentic workflows. It's the fundamental building block for your Business-as-Code.
At its core, action.do is built on a simple yet powerful idea: complex business processes should be composed of simple, single-purpose actions. Instead of a monolithic script that tries to do everything, you break down the process into its constituent parts—sending an email, updating a user record, calling a third-party API. Each of these becomes an atomic action.
This approach offers immediate benefits:
action.do is the API and execution engine for these atomic tasks. It allows you to invoke a named action with a specific set of parameters, and it handles the execution, logging, and error handling for you. It turns abstract concepts into a concrete, executable reality.
Here’s how simple it is to execute an action using the .do SDK in TypeScript:
import { Do } from '@do-sdk/core';
// Initialize the .do client with your API key
const a = new Do(process.env.DO_API_KEY);
// Execute a specific, atomic action with parameters
const { result, error } = await a.action.execute({
name: 'send-welcome-email',
params: {
userId: 'usr_12345',
template: 'new-user-welcome-v2'
}
});
if (error) {
console.error('Action failed:', error);
} else {
console.log('Action Succeeded:', result);
}
This code snippet cleanly separates the intent (sending a welcome email) from the implementation. Your workflow doesn't need to know the details of your email provider; it just needs to call the action.
Two core principles make action.do indispensable for serious workflow automation: idempotency and auditability.
Idempotency ensures that performing the same action multiple times with the same inputs has the same effect as performing it once. Why is this critical? Imagine a network glitch causes your "create-invoice" action to time out. You can't be sure if the invoice was created or not. With an idempotent action, you can safely retry the operation without the risk of creating a duplicate invoice. This resilience is essential for building fault-tolerant systems.
Because every execution is a distinct call to a named action with specific parameters, action.do creates a perfect audit trail. You have a clear, immutable log of:
This level of observability makes debugging, compliance, and C-level reporting trivial.
So, action.do represents a single step. How do you build a full business process? That's where workflow.do comes in.
An action.do is the brick. A workflow.do is the house you build with those bricks. A workflow is a sequence, graph, or state machine composed of one or more atomic actions. It orchestrates these building blocks—chaining them together, running them in parallel, and adding conditional logic—to accomplish a larger business goal, like onboarding a new customer or processing a payment.
By building workflows from discrete actions, you gain immense flexibility and maintainability. Need to change your email provider? Just update the send-welcome-email action. The 20 workflows that use it don't need to change at all.
The .do platform isn't a closed garden. You can easily define your own custom actions by wrapping existing functions, microservices, or APIs. This allows you to turn your current business logic—no matter where it lives—into a standardized, reusable, and auditable component within the .do ecosystem. It’s the ultimate bridge between your existing code and modern, agentic workflow automation.
Ready to build more reliable systems? Start with the atom.
What constitutes an 'atomic action'?
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. Examples include sending a single email, making one API call, or writing a single record to a database.
Why is idempotency important for actions?
Idempotency ensures that executing the same action multiple times with the same parameters has the same effect as executing it once. This is crucial for building reliable systems that can recover from failures without causing unintended side effects, like sending duplicate invoices.
How does action.do relate to a workflow.do?
"action.do represents the individual steps or building blocks. A workflow.do is a sequence or graph of these actions orchestrated to achieve a larger business outcome. You compose workflows from one or more atomic actions."
Can I define my own custom actions?
Yes. The .do platform allows you to define your own custom actions as functions or microservices, which can then be invoked via the action.do API. This turns your existing business logic into reusable, auditable components.