In today's fast-paced digital landscape, the gap between business logic and technical implementation is a major source of friction. Critical processes often exist as a patchwork of manual steps, brittle scripts, and siloed tribal knowledge. This approach is slow, error-prone, and impossible to scale. But what if you could treat your business operations just like you treat your software?
Enter Business-as-Code (BaaC), a revolutionary paradigm that applies the principles of modern software development—version control, testing, and automation—to your company's core operational processes. It’s about transforming abstract workflows into tangible, versioned, and automated assets.
This post explores the concept of Business-as-Code and demonstrates how the .do platform, with its focus on atomic actions, provides the perfect foundation to make this vision a reality.
Think about a common business process, like onboarding a new customer. Traditionally, this might involve:
Each step is a potential point of failure. The script might be outdated, data entry errors can occur, and if one person is on vacation, the entire process grinds to a halt. There's no single source of truth, no audit trail, and no easy way to improve the process.
Business-as-Code treats every process as a piece of software. By defining your operations in code, you gain the same benefits developers have enjoyed for years with Infrastructure-as-Code (IaC):
To build this new class of software, you need the right building blocks. On the .do platform, this fundamental unit is the Atomic Action.
An Atomic Action is the smallest, indivisible unit of work in your workflow. It's a self-contained, reusable function designed to perform a single task reliably. Think of it as a supercharged API endpoint for your business logic.
You can encapsulate any single, repeatable task as a self-contained Action. Chain them together to create powerful, intelligent workflows and deliver Services-as-Software.
Let's turn a simple business task—sending a welcome email—into an Atomic Action using the .do SDK. This simple, self-contained block can then be reused across countless workflows, from user sign-ups to trial starts.
import { Action } from '@do-sdk/core';
// Define a new Action to send a welcome email
const sendWelcomeEmail = new Action({
name: 'send-welcome-email',
description: 'Sends a standardized welcome email to a new user.',
handler: async (inputs: { email: string; name: string }) => {
console.log(`Preparing to send email to ${inputs.email}...`);
// Logic to connect to an email service (e.g., SendGrid, SES)
// const emailSent = await emailService.send({
// to: inputs.email,
// subject: `Welcome, ${inputs.name}!`,
// body: 'We are so glad you joined us...'
// });
const result = { success: true, messageId: `msg_${Date.now()}` };
console.log('Email sent successfully:', result.messageId);
return result;
},
});
// Execute the action via the .do SDK
async function run() {
const execution = await sendWelcomeEmail.run({
email: 'alex@example.com',
name: 'Alex',
});
console.log('Execution Result:', execution);
}
run();
In this example, send-welcome-email is now a durable, discoverable asset. It's no longer a random script; it's a formal piece of your business's operational code.
While an Action might look like a standard serverless function, it comes with superpowers. Actions on .do are automatically instrumented with the features you need for robust agentic workflows:
This turns your code from a simple function into a managed, resilient, and composable block of business logic.
While Actions are atomic, real business processes are complex. The power of the .do platform lies in workflow orchestration. You don't build monolithic Actions that do everything. Instead, you create powerful automations by chaining simple, single-purpose Actions together in a workflow.do file.
This promotes modularity and a clear separation of concerns. Your send-welcome-email Action does one thing perfectly. Your create-user-in-db Action does another. A customer-onboarding.do workflow can then orchestrate them:
This is the essence of building agentic workflows: composing small, smart Actions into a larger, autonomous process that reliably executes a business service.
An atomic action is the smallest, indivisible unit of work in a workflow. It's a self-contained, reusable function designed to perform a single task reliably, like 'send an email', 'create a user', or 'query a database'.
Actions on .do are supercharged functions. They are automatically instrumented with logging, error handling, retries, and versioning. They are designed to be discovered and composed into larger workflows, effectively turning your business logic into manageable code.
While Actions are designed to be atomic, complex logic is best handled by orchestrating multiple Actions within a Workflow (workflow.do). This promotes modularity, reusability, and a clearer separation of concerns in your automation architecture.
Virtually any task you can script. Common examples include interacting with third-party APIs (e.g., Stripe, Slack, Salesforce), performing database operations, running data transformations, or executing machine learning model inferences. If you can code it, you can make it an Action.
Business-as-Code isn't just a theoretical concept; it's a practical strategy for building a more efficient, resilient, and scalable organization. By codifying your operations, you transform them from fragile manual processes into robust, automated assets.
Atomic actions are the key to unlocking this potential, providing the durable, reusable building blocks you need. Ready to turn your operational logic into code? Start building your first Action on the .do platform today and DO MORE, FASTER.