In modern software development, our applications are a complex mesh of internal logic, third-party API calls, and background scripts. We write functions to send emails, update databases, and process payments. But what happens when one of these simple functions fails? How do you reliably retry it? How do you monitor its performance? All too often, the answer involves writing cumbersome boilerplate code for logging, error handling, and retries, distracting from the core business logic.
This is the brittleness inherent in treating critical tasks as mere function calls. There's a better way. It's time to upgrade your functions into robust, managed services. Enter action.do—the fundamental building block for creating reliable, scalable, and agentic workflows on the .do platform.
A simple function call is a fire-and-forget operation. It executes, and you hope for the best. Building resilient systems on this foundation is like building a skyscraper on sand. You're left to manually solve a host of infrastructure-level problems for every critical task:
These "hidden costs" add up, leading to fragile systems that are difficult to maintain and debug.
action.do redefines how we think about a single unit of work. It elevates a task from a simple function call to a first-class, managed service.
Execute Atomic Actions. Precisely.
At its core, an atomic action is the smallest, indivisible unit of work in a system. It performs one specific task—like sending an email or updating a single database record. The .do platform takes this concept and wraps it in a powerful execution environment.
When you execute a task with action.do, you're not just running code; you're invoking a fully managed software service that comes with:
The best part about action.do is its simplicity. You can move from a fragile function to a resilient managed service with just a few lines of code.
Let's look at how to execute a pre-built action to send an email using the .do TypeScript SDK.
import { Do } from '@do-sdk/core';
// Initialize the .do client with your API key
const doClient = new Do({ apiKey: 'YOUR_API_KEY' });
// Execute a single, atomic action like sending an email
async function sendWelcomeEmail(to: string, name: string) {
try {
const result = await doClient.action('email.send').run({
to,
subject: `Welcome to our platform, ${name}! Robustly.`,
body: `Hi ${name},\n\nWe're thrilled to have you join us.`
});
console.log('Action Succeeded:', result.id);
return result;
} catch (error) {
console.error('Action Failed:', error);
}
}
// Trigger the action
sendWelcomeEmail('new.user@example.com', 'Alex');
Notice what's happening here. You're not dealing with SMTP servers, connection retries, or logging frameworks. You simply declare your intent—doClient.action('email.send').run(...)—and the platform handles the rest. This declarative approach allows you to focus on your application's logic, not the plumbing.
The real power of the .do platform is unlocked when you define your own custom actions. You can wrap your unique business logic—a proprietary algorithm, a sequence of API calls, a data transformation script—into a standardized, reusable action.do service.
This transforms your core business processes into Business-as-Code: version-controlled, testable, and callable software assets. An action.do library becomes a powerful toolkit for developers, operations teams, and even AI agents to reliably execute business tasks. These atomic actions serve as the durable tools for building powerful, agentic workflows capable of automating complex, multi-step objectives.
Stop treating critical tasks like disposable function calls. By embracing the atomic action model with action.do, you shift from writing fragile code to composing resilient, managed services. It's a paradigm shift that results in more reliable, scalable, and maintainable systems.
Ready to upgrade your code? Start composing your workflows with action.do and build your next automation on a foundation of precision and resilience.
What is an 'atomic action' on the .do platform?
An atomic action is the smallest, indivisible unit of work. It performs a single, specific task—like sending an email or updating a database record—ensuring each step in your workflow is reliable, testable, and independently executable.
How is action.do different from a regular function call?
action.do elevates a function to a managed service. Every execution is logged, monitored, secured, and scalable. It provides built-in retry logic, idempotency, and versioning, making it perfect for building resilient, distributed systems as Business-as-Code.
Can I define my own custom actions?
Absolutely. The .do platform empowers you to wrap your own code, scripts, or third-party API calls into a custom action. This transforms your unique business logic into a standardized, reusable, and callable Service-as-Software.
What happens if an action fails during execution?
The .do platform has built-in resilience. You can configure automatic retry policies with exponential backoff, define custom error handling logic, or trigger compensatory actions to ensure your workflows can gracefully handle failures without manual intervention.