In today's world of automation, the complexity of our systems is growing exponentially. We're moving beyond simple scripts to build sophisticated, multi-step agentic workflows that are the backbone of modern business operations. But as these workflows grow, they often become fragile, monolithic, and difficult to debug. A single failure point can bring an entire process to a screeching halt, leaving a trail of inconsistent data and manual cleanup.
What if we could build our automations like we build modern software? By breaking them down into small, reliable, and reusable components.
This is the core principle behind action.do: a powerful API for defining and executing atomic, single-responsibility actions. It's time to stop writing brittle scripts and start architecting robust, scalable, and maintainable Business-as-Code.
In the context of workflow automation, an atomic action is a self-contained, single-responsibility task that is designed to either complete successfully or fail entirely, leaving no partial or indeterminate state behind.
Think of it as the smallest indivisible unit of work in your business process:
Each of these tasks performs one, and only one, job. By enforcing this single responsibility principle, you gain immense clarity and reliability. You always know exactly what a specific piece of your workflow does, making the entire system easier to understand, test, and maintain.
With action.do, executing these granular tasks becomes a trivial, declarative API call. Instead of managing complex internal logic, you simply state what you want to do and provide the necessary input.
Here’s how easy it is to execute a send-welcome-email action using the .do SDK in TypeScript:
import { Dō } from '@do-sdk/core';
const dō = new Dō({ apiKey: 'YOUR_API_KEY' });
// Define and execute a single, atomic action
const result = await dō.action.execute({
name: 'send-welcome-email',
input: {
userId: 'user-12345',
template: 'new-user-welcome',
},
});
console.log(result);
// { success: true, transactionId: 'txn_abc_123' }
The beauty of this approach lies in its simplicity. You call the action by name, provide a clear input payload, and receive a simple, unambiguous result. The transaction ID gives you a clear audit trail for every single action executed in your system.
If you're thinking, "This sounds like a serverless function," you're on the right track—but action.do is a higher-level abstraction designed specifically for agentic workflows.
While a serverless function gives you a blank slate for execution, action.do provides the essential framework for business process automation out of the box:
action.do handles the operational heavy lifting, allowing you to focus purely on the business logic that delivers value.
While action.do is focused on executing a single task, its true power is realized when these actions are chained together to form complex automations. These sequences, or workflow.dos, are built on a foundation of highly reliable, independent steps.
This architecture has profound implications for error handling. Because each action is atomic, its failure is contained and predictable. An action doesn't half-succeed. It either works, or it fails with a clear error state. This transactional integrity enables you to build sophisticated and resilient systems that can:
By composing complex processes from these simple, robust primitives, you eliminate the cascading failures that plague monolithic automation scripts.
The future of automation is not in bigger, more complex scripts. It's in smarter, more resilient systems built from simple, well-defined components. action.do provides the fundamental building block for this new paradigm.
Define your granular, single-responsibility tasks as powerful API endpoints and start building robust, scalable, and maintainable workflow automation that you can trust.
Q: What is an 'atomic action' in the context of .do?
A: An atomic action is a self-contained, single-responsibility task that either completes successfully or fails entirely, without partial states. Think of it as the smallest indivisible unit of work in your workflow, like 'send-email', 'create-user', or 'charge-card'.
Q: How is action.do different from a serverless function?
A: While similar, action.do is designed specifically for agentic workflows. It provides built-in orchestration, state management, logging, and security context that serverless functions require you to build and manage yourself. It's a higher-level abstraction for business logic.
Q: Can actions be chained together?
A: Absolutely. While action.do executes a single action, it's designed to be a fundamental building block within a larger workflow.do. You compose complex processes by sequencing these atomic actions to create robust Services-as-Software.
Q: What kind of error handling does action.do support?
A: Actions are designed for transactional integrity. If an action fails, it returns a clear error state and can trigger automated retries, notifications, or alternative workflow paths, ensuring your automations are robust and resilient.