In modern software development, business logic often becomes a tangled web. Critical functions like sending an invoice, updating a CRM, or verifying a user are buried deep within monolithic applications or scattered across various microservices. This makes them difficult to manage, reuse, and scale. What if you could treat every single business task as a clean, independent, and callable API endpoint?
This is the core philosophy behind action.do. It's about breaking down complexity and focusing on the fundamental building blocks of any business process: the atomic actions. By defining and executing these discrete, single-purpose tasks in an API-first manner, you can build more robust, scalable, and manageable automated workflows.
Think of an atomic action as the smallest, indivisible unit of work in your business. It’s a single, self-contained task that accomplishes one specific thing. It either succeeds or fails, but it doesn't get partially done.
Some clear examples of atomic actions include:
In the action.do ecosystem, these actions are not just abstract concepts; they are tangible, executable agents. By isolating logic into these atomic units, you gain immense clarity. Each action has one job, making it easy to understand, test, and maintain.
The true power of action.do lies in its developer-friendly, API-first approach. You define your business logic in code, and the platform instantly makes it available as a secure, executable endpoint.
Let's look at how simple it is to define and trigger an action using the action.do SDK. Here, we'll create an action to send a welcome email to a new user.
import { Do } from '@do-inc/sdk';
// Initialize the platform client
const platform = new Do({ apiKey: 'YOUR_API_KEY' });
// Define a simple, atomic action: send an email
const sendWelcomeEmail = platform.action('send-welcome-email', {
description: 'Sends a welcome email to a new user.',
handler: async (inputs: { email: string, name: string }) => {
// Business logic for the action would go here
console.log(`Sending welcome email to ${inputs.name} at ${inputs.email}`);
return { success: true, messageId: 'xyz-123' };
},
});
// Execute the action via the SDK
const result = await sendWelcomeEmail.run({
email: 'alex@example.com',
name: 'Alex',
});
console.log(result);
Let's break this down:
This API-first design means your core business logic is no longer locked away. It's an accessible tool ready for seamless integration across your entire stack.
It's important to distinguish between an action and a full workflow.
You compose complex agentic workflows by connecting various action.do agents together. For example, a "New User Onboarding" workflow might look like this:
Each step is a discrete, reliable, and reusable atomic action. By chaining them together, you model a complete business process and deliver a powerful Service-as-Software without the monolithic overhead. This approach to workflow automation is more resilient, as a failure in one action can be identified and retried without impacting the entire process.
Adopting an atomic action mindset offers several key advantages:
Ready to stop wrestling with tangled business logic? Start thinking in terms of atomic actions. Define the discrete, single-purpose tasks that power your business, and use action.do to Build, Trigger, and Automate them as an elegant and powerful service.