The age of AI is here, and with it, the rise of the agentic workflow. We're moving beyond simple chatbots to intelligent agents that can plan, reason, and execute complex multi-step tasks to achieve a goal. To do this, these agents need a "toolbelt"—a set of reliable functions they can call upon to interact with the world.
For many developers, the default choice for building these tools is the standard serverless function (like AWS Lambda or Google Cloud Functions). And why not? They're scalable, cost-effective, and let you run code without managing servers.
But here's the catch: a generic serverless function is like a generic multitool. It's useful, but it wasn't designed for the specific, high-stakes job of being a perfect instrument for an AI agent. When you're building robust, maintainable, and intelligent automations, you need something more specialized.
Enter action.do—the purpose-built tool for an agent's toolbelt. Let's break down why this new approach, centered on the atomic action, is a fundamental upgrade for building the next generation of business automation.
Serverless functions are a revolutionary technology, but when used as "tools" for an AI agent, their general-purpose nature can introduce friction:
Agentic workflows demand tools that are predictable, observable, and inherently composable. A general-purpose compute block just doesn't cut it.
The .do platform is built on a simple yet powerful concept: Business As Code. It treats your business logic not as an implementation detail hidden inside a function, but as a first-class citizen—an atomic action.
An atomic action is a self-contained, single-purpose function that performs one specific task and is exposed as a secure API endpoint.
Think of actions like send-welcome-email, process-payment, or update-crm-record. Each one is:
Let's look at how this translates to code. Defining an action to process a payment is clean and declarative:
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_...' }
Right away, you can see the difference. The inputs are typed and explicit. The handler contains only the core business logic. The entire package is an intelligent, self-describing tool ready for an agent to use.
| Feature | Standard Serverless Function | action.do | Why It Matters for Agents |
|---|---|---|---|
| Granularity | Discipline-dependent. Can easily become bloated. | Atomic by Design. The platform's structure encourages single-purpose logic. | An AI agent gets a tool that is 100% predictable. process-payment will never accidentally send an email. |
| Observability | Requires external tooling (CloudWatch, Datadog) and custom logging. | Built-in & Agent-Centric. Full execution history with inputs/outputs is native to the platform. | You can easily debug an agent's run and understand exactly how it used its tools, without extra setup. |
| Composition | Requires external orchestration services (e.g., Step Functions). | Native Composition. Actions are designed to be orchestrated by workflow.do, keeping logic and flow in one ecosystem. | Building complex multi-step automation is simpler and more maintainable. The separation of concerns is clear. |
| Security | Requires manual configuration of IAM, secret managers, etc. | Secure by Default. Secrets are managed by the .do platform and injected into the context at runtime, never exposed in code. | Reduces security overhead and risk, making it safer for agents to access sensitive operations. |
You wouldn't give a master watchmaker a single, clunky multitool. You'd give them a set of specialized, precise instruments. The same is true for AI agents.
While serverless functions laid the groundwork, the era of agentic workflows requires a more evolved approach. It requires a system where business logic is encapsulated into robust, reliable, and observable atomic actions.
By shifting from generic functions to purpose-built actions, you’re not just writing code—you’re building a library of powerful, reusable business capabilities. You're giving your AI agents the specialized toolbelt they need to execute flawlessly.
Q: What is an 'atomic action' on the .do platform?
A: 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.
Q: Can actions call other actions?
A: 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.
Q: What kind of logic can I run inside an action.do?
A: 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.