In the world of software development and automation, complexity is the enemy of reliability. Monolithic scripts and tightly coupled systems are often brittle, difficult to debug, and nearly impossible to scale. When one small part fails, the entire process can grind to a halt. But what if we could build our most complex workflows not as a single, fragile chain, but as a robust composition of simple, independent parts?
This is the core philosophy behind the .do platform, and it starts with a fundamental building block: action.do. It's a service designed to do one thing and do it perfectly: Execute Atomic Actions. Precisely.
By breaking down large processes into their smallest, indivisible components, we can build automations that are resilient, scalable, and remarkably clear. Welcome to the art of composition.
An atomic action is the smallest, indivisible unit of work on the .do platform. It performs a single, specific task—like sending an email or updating a database record.
Think of it like a Lego brick. A single brick is simple, predictable, and has a clear purpose. It either connects perfectly or it doesn't. An atomic action operates on the same principle of all-or-nothing execution. It either succeeds completely, or it fails completely, leaving the system in a clean, predictable state.
This atomicity is what makes your workflows:
So, is an action.do just a fancy function call? Not at all. While a function executes code, action.do elevates that execution to a fully managed service.
When you call a standard function, you're responsible for everything around it: logging, monitoring, retries, security, and scaling. When you execute a task with action.do, the platform handles that for you. Every execution benefits from:
This is the essence of Business-as-Code. Your core business logic isn't just a script; it's a versioned, secure, and scalable asset.
Let's see how simple and powerful this is. Here’s how you would execute a pre-defined action to send a welcome email using the .do 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');
In this example, doClient.action('email.send').run(...) doesn't just trigger an SMTP command. It invokes a managed service responsible for sending that email. If the email provider's API is temporarily down, the .do platform can automatically retry the action according to your configured policy, all without a single line of extra code from you.
The platform isn't limited to a library of pre-built functions. You can define your own custom actions. Wrap your proprietary code, a Python script, or a call to a third-party API into a custom action.do service.
This transforms your unique business processes into standardized, reusable Service-as-Software. Suddenly, that complex legacy script for generating end-of-month reports becomes a simple, callable action: doClient.action('reports.generate.monthly').run().
Here is where the art of composition truly shines.
Once you have a palette of robust, atomic actions, you can start composing them to build sophisticated workflows. A user sign-up process might be a composition of actions:
Because each action.do is a managed service with built-in failure handling, the orchestration of these steps becomes dramatically more reliable. You can define compensatory actions—for example, if billing.customer.subscribe fails, you can trigger a database.users.deactivate action to roll back the change.
This is the foundation for creating truly Agentic Workflows: automated processes that are not just linear scripts but intelligent agents capable of responding to events, handling failures gracefully, and executing complex business logic autonomously.
It all starts with a single, precise, atomic action.
Ready to stop scripting and start composing? Explore what you can build on the .do platform, one atomic action at a time.