In the rapidly evolving landscape of business automation and AI, the complexity of our systems is growing exponentially. We're moving beyond simple scripts to build sophisticated, AI-powered "agentic workflows"—intelligent systems that can reason, plan, and execute multi-step tasks. But how do you ensure these complex systems are reliable, maintainable, and scalable?
The answer lies in going back to a fundamental principle of great software engineering: building with small, focused, and robust components.
This is where action.do comes in. It's a platform to Encapsulate Logic. Execute Flawlessly. We provide the atomic building block for the next generation of automation, allowing you to transform any piece of business logic into a reliable, scalable, and observable API endpoint.
Think of an atomic action as the ultimate single-purpose tool in your developer toolbox. It's a self-contained, independent function designed to do one thing and do it exceptionally well.
Each of these is a perfect candidate for an action.do. By encapsulating this logic, you treat Business As Code—making your operations versionable, testable, and composable. Instead of being buried in a monolithic application, your core business capabilities become first-class citizens in your architecture.
Defining an action is designed to be simple and intuitive. You define your inputs and then write the handler logic. The .do platform takes care of the rest—deployment, security, scalability, and observability.
Here’s a simple example of an action.do that processes a payment using TypeScript:
import { Do } from '@do-sdk/core';
// Define an atomic action to process a payment
const processPayment = Do.action('process-payment', {
inputs: {
customerId: 'string',
amount: 'number',
},
handler: async ({ inputs, context }) => {
// Connect to a payment provider like Stripe
console.log(`Processing payment of $${inputs.amount} for ${inputs.customerId}`);
// ... payment gateway logic here
// Return a structured result
return { success: true, transactionId: `txn_${context.runId}` };
},
});
// Execute the action securely via the .do API
const result = await processPayment.run({
customerId: 'cust_12345',
amount: 49.99,
});
console.log(result);
// Output: { success: true, transactionId: 'txn_...' }
In this snippet, we've defined a process-payment action with strongly-typed inputs. The handler contains the core business logic. When processPayment.run() is called, the .do platform securely executes this logic, returning a predictable, structured result.
You might be thinking, "This looks like a serverless function." While the concept is similar, an action.do is purpose-built for the world of agentic workflows and intelligent automation.
A standard serverless function gives you a compute environment. An action.do gives you a fully managed component integrated into a larger ecosystem. It comes with native support for:
The true power of atomic actions is realized when you combine them. An individual action is intentionally limited to a single responsibility. This is a core design principle that promotes clarity and reusability.
To orchestrate multiple steps, you use a workflow.do. A workflow composes individual actions into a larger, stateful process.
This separation of concerns between atomic actions (the what) and workflows (the how) allows you to build incredibly robust, maintainable, and easy-to-understand systems.
By embracing the paradigm of atomic actions, you're not just writing functions—you're creating a library of well-defined business capabilities. These become the LEGO bricks for your developers, your AI agents, and your entire organization to build powerful, intelligent automations.
Ready to transform your business logic into flawless, executable actions? Dive into the .do platform and start building a more robust and automated future.
What is an 'atomic action' on the .do platform?
An atomic action is a self-contained, single-purpose function that performs one specific task, like sending an email or updating a database record. It's the fundamental building block for creating reliable and modular agentic workflows.
How is an action.do different from a standard serverless function?
While similar, an action.do is purpose-built for agentic systems. It includes native integration with the .do ecosystem for state management, observability, and composition, allowing you to treat business logic as a first-class citizen in your Services-as-Software.
Can actions call other actions?
A single action is designed to be atomic and perform one task. To orchestrate multiple actions, you use a 'workflow.do', which composes individual actions into a larger, stateful process. This promotes a clean separation of concerns.
What kind of logic can I run inside an action.do?
Anything you can code. Actions can perform data transformations, integrate with third-party APIs (e.g., Stripe, SendGrid), query databases, or run machine learning models. It encapsulates any unit of business logic and exposes it as a simple API.
How are inputs and secrets handled in an action?
Inputs are defined with clear types in the action's configuration and are passed during execution. Secrets, like API keys or database credentials, are managed securely through the .do platform and injected into the action's context at runtime, never exposed in your code.