In the world of modern software development, serverless functions (like AWS Lambda or Google Cloud Functions) have become a go-to tool for running code without managing servers. They are powerful, scalable, and cost-effective. But when it comes to encapsulating and executing core business logic, are they always the right tool for the job?
While serverless functions provide the raw compute power, a new paradigm is emerging—one that treats business tasks as first-class citizens. This is the world of Actions.do, where business logic isn't just code; it's a reusable, observable, and composable asset.
Let's break down the differences and help you decide which tool is right for your needs.
Serverless functions are event-driven, stateless compute services. You upload your code, and the cloud provider handles everything required to run and scale it in response to triggers.
Pros:
The Challenge with Business Logic:
Serverless functions are general-purpose. They are the fundamental building blocks, but you are responsible for building everything else on top. For a business task like "running a credit check" or "sending an order confirmation," this means you have to:
Serverless functions give you the engine parts, but you still have to assemble the engine, build the chassis, and install the dashboard.
Actions.do takes a different approach. It’s a platform purpose-built for defining, managing, and executing business tasks.
As our FAQ states, an Action is a single, discrete business task encapsulated as a reusable, API-callable service. It’s the fundamental building block for creating powerful agentic workflows and delivering "Services-as-Software."
Instead of focusing on infrastructure, you focus on the business outcome. You write the code for the task, and the platform provides the rest as-a-service.
With Actions.do, you move from managing infrastructure to modeling your business. Here’s what makes an Action different from a standard serverless function:
Let's imagine you need to automate sending an order confirmation email.
With a Serverless Function (e.g., AWS Lambda):
With an Action from Actions.do:
Now, executing this task is as simple as a single API call from anywhere in your stack.
import { dotdo } from '@do-sdk';
// Initialize the .do client with your API key
const client = dotdo.init({ apiKey: 'your-secret-api-key' });
// Execute a pre-defined action by its name with a specific payload
const result = await client.actions.execute({
name: 'send-order-confirmation',
payload: {
customerId: 'cust_1a2b3c',
orderId: 'ord_4d5e6f'
}
});
console.log('Action executed successfully:', result);
// Expected output: { success: true, messageId: 'msg_xyz789' }
The difference is clear: Actions.do provides a higher level of abstraction, letting you operate at the speed of business.
Choose Serverless Functions when:
Choose Actions.do when:
Serverless functions are the powerful, reliable engine parts of the cloud. They are essential.
Actions.do provides the fully assembled engine, finely tuned for the specific purpose of running your business processes. It's an opinionated platform designed to help you orchestrate, execute, and automate with unprecedented speed and clarity.
Stop building infrastructure. Start building your business.
Ready to turn your business tasks into simple, executable APIs? Explore Actions.do today and start building Services-as-Software.