In the world of modern software, complexity is the enemy of reliability. As we build increasingly sophisticated agentic workflows and automated business processes, a single point of failure can unravel an entire operation, leading to inconsistent data, duplicate actions, and frustrated users. How do we build systems that are not just powerful, but also robust and predictable?
The answer lies in a fundamental principle: atomicity.
action.do provides the core building block for this new paradigm of reliability. It allows you to define and execute single, atomic actions within your agentic workflows, offering a reliable, auditable, and idempotent way to perform tasks as part of a larger business process. It's the foundation for true Business-as-Code.
An atomic action is a single, indivisible operation that is guaranteed to either complete successfully or fail entirely, leaving no partial state behind. Think of it as an "all-or-nothing" transaction.
Consider these examples:
By breaking down a complex workflow—like "onboard a new user"—into a series of discrete atomic actions (create-user-record, send-welcome-email, assign-to-sales-rep), you can isolate failures and build resilient, self-healing systems.
action.do is designed from the ground up to be the execution layer for these single-purpose actions. It allows you to build robust workflows by composing them from simple, reliable components.
Execute. Audit. Repeat. This is our mantra. Every action you execute is a auditable event, and thanks to concepts like idempotency, you can safely repeat or retry actions without fear of unintended side effects.
Here’s how simple it is to execute a specific, named action using the .do SDK. This example invokes a predefined action to send a welcome email to a new user.
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 simple API call abstracts away the complexity of task execution, failure handling, and logging, giving you a clean and declarative way to perform tasks.
Idempotency is a core principle for reliable systems. It ensures that executing the same action multiple times with the same parameters has the same effect as executing it once. This is critical for recovering from network failures or temporary outages. With an idempotent action, if a charge-customer task fails midway through, you can safely retry it without worrying about double-billing them.
While action.do represents the individual steps, it's just one part of a larger ecosystem. A workflow.do is a sequence or graph of these atomic actions, orchestrated to achieve a broader business outcome. You compose powerful, complex workflows by chaining together simple, reliable actions.
The true power of the .do platform is its extensibility. You aren't limited to a pre-canned set of actions. You can easily define your own custom actions by wrapping your existing functions or microservices. This turns your proprietary business logic into reusable, auditable, and idempotent components that can be called via the action.do API, truly embracing the "Business-as-Code" methodology.
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.
Stop wrestling with fragile scripts and complex state management. By focusing on atomic, idempotent actions, you can build agentic workflows that are easier to understand, debug, and scale. action.do provides the essential foundation for this modern approach to workflow automation.
Ready to execute your actions flawlessly? Explore the .do platform and start building better business processes today.