In modern development, the journey from a simple piece of business logic to a secure, scalable, and production-ready API is often fraught with boilerplate and operational overhead. You write your core function—the part that actually delivers business value—and then spend hours, or even days, wrestling with authentication, routing, logging, error handling, and deployment configurations. What if you could skip all that and go directly from logic to live service?
Enter action.do. We believe in a world where your business logic can be defined as code and instantly become a powerful, executable service. This is the core principle behind Business-as-Code, and service.create is the command that makes it a reality. It's time to stop building infrastructure and start building flawless, agentic workflows.
Before we dive into creating services, let's understand the fundamental building block of the .do ecosystem: the Atomic Action.
An atomic action is a self-contained, single-responsibility task that either completes successfully or fails entirely, leaving no partial or inconsistent states. It’s the smallest indivisible unit of work in your workflow.
Think of actions like:
By designing your system around these granular actions, you create a foundation that is inherently more robust, easier to test, and infinitely more maintainable.
This is where the magic happens. service.create is the conceptual bridge between your code and a live endpoint. You define your single-responsibility function, and action.do wraps it in a production-grade API, handling all the boilerplate for you.
Once your action is defined on the platform, executing it is incredibly simple. You don't need to worry about HTTP methods, headers, or endpoint URLs. You call it by its logical name.
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' }
In this example, send-welcome-email is an atomic action you've already created. action.do takes care of locating the service, authenticating the request, passing the input, executing the logic, and returning a clear success or failure state. All you do is state your intent: execute this action.
This is a common and important question. While an atomic action might look like a serverless function (e.g., AWS Lambda), action.do operates at a higher level of abstraction specifically for workflow automation.
A serverless function gives you a compute environment; you are still responsible for building the surrounding context yourself. action.do is different because it provides built-in:
With serverless, you get a function. With action.do, you get a managed, auditable, and reliable business operation as a service.
The true power of atomic actions is realized when you compose them into larger workflows. While action.do focuses on executing a single task flawlessly, it's a fundamental building block for workflow.do, our orchestration engine.
You can chain actions together to model complex business processes:
What happens if a step fails? action.do is built for resilience. Because each action is transactional, a failure doesn't leave your system in a weird state. The action returns a clear error, which your workflow can use to trigger automated retries, send a notification to a support channel, or branch to a different path entirely. This ensures your automations are robust and reliable by default.
By turning your core operations into executable, version-controlled actions, you are codifying your business itself. This Business-as-Code approach makes your processes transparent, testable, and reusable. It closes the gap between business requirements and technical implementation, allowing you to build and automate at a velocity that was previously unimaginable.
Ready to build flawless automations? Get started with action.do today and turn your business logic into powerful, executable API endpoints in minutes.