In the world of workflow automation, complexity is the enemy of reliability. A long chain of operations is only as strong as its weakest link. When a multi-step process fails halfway through, you're often left with a messy, inconsistent state. A customer record is created but the welcome email never sends. An invoice is generated but fails to log to the payment gateway. These partial failures lead to bugs, bad user experiences, and hours of manual debugging.
What if you could build your workflows from the ground up to be resilient, auditable, and predictable?
This is the principle behind action.do. We believe that robust, complex processes are built from simple, reliable parts. Our hero headline says it all: Atomic Actions, Executed Flawlessly. By focusing on the smallest indivisible unit of work—the atomic action—action.do provides the fundamental building block for your Business-as-Code.
At its core, an atomic action is a single, all-or-nothing operation. It either completes successfully, or it fails entirely, leaving the system in the exact state it was in before the action was attempted. There is no middle ground, no partial completion.
Think of it like a database transaction. You wouldn't want to withdraw money from one account without it being deposited in another. The entire operation must succeed or fail as a single unit. That's atomicity.
In the context of an agentic workflow, an atomic action could be:
By defining these tasks as discrete actions, you create a system that is inherently easier to understand, test, and manage.
Our approach revolves around a simple yet powerful lifecycle for every task in your business process.
Executing an action should be simple and explicit. With the .do SDK, you can trigger any defined action with a clear set of parameters. This turns complex operations into a simple, declarative function call.
Here’s how you would execute a send-welcome-email action using our TypeScript SDK:
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 is clear, concise, and its intent is unmistakable. You are executing one specific action with one specific set of inputs. If it fails, the error object tells you exactly why, without leaving you to guess about the state of your system.
Because every execution is a discrete event, action.do provides a complete, auditable log of every task performed. For any given action, you can see:
This level of transparency is invaluable for debugging, ensuring compliance, and understanding exactly what your automated agents are doing.
What happens if you run the same action twice with the same parameters? In a poorly designed system, this could be disastrous—sending two welcome emails, charging a customer twice, or creating duplicate records.
This is why idempotency is a core principle of action.do. An idempotent action can be executed multiple times with the same inputs and will produce the same result as if it were executed only once.
This is crucial for building resilient workflows. If a network error causes an action to time out, you don't have to worry if the task was partially completed. You can simply retry the action, confident that you won't cause unintended side effects.
If action.do is the individual Lego brick, then workflow.do is the complete castle you build. An action.do represents a single step. A workflow.do orchestrates a sequence or graph of these actions to achieve a larger business outcome.
You compose powerful, end-to-end business processes—like new user onboarding or order fulfillment—by chaining together simple, atomic actions. This layered approach ensures that even your most complex workflows are built on a foundation of reliable, auditable, and idempotent components.
Q: What constitutes an 'atomic action'?
A: 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.
Q: Why is idempotency important for actions?
A: 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.
Q: How does action.do relate to a workflow.do?
A: 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.
Q: Can I define my own custom actions?
A: 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.
Ready to build more reliable agentic workflows? Get started with action.do and discover the power of atomic actions today.