In today's digital-first landscape, business processes are becoming increasingly complex. From onboarding a new customer to fulfilling an order, workflows involve dozens of steps, multiple systems, and critical logic. Too often, this logic is scattered across various SaaS tools, buried in spreadsheets, or exists only in the minds of a few key employees. This creates fragility, hinders innovation, and makes automation a nightmare.
What if you could treat your business operations with the same rigor, clarity, and power as modern software development? This is the core idea behind Business as Code, a philosophy that transforms your processes into version-controlled, testable, and modular components.
At the heart of this philosophy lies a simple yet profound concept: the atomic action.
Imagine building a complex structure with LEGO bricks. You don't start with a fully formed wall; you start with a single, standardized brick. This brick is simple, predictable, and can be combined with others in near-infinite ways.
In the world of workflow automation, action.do is that fundamental brick.
An action.do represents a single, indivisible, executable step in a workflow. It’s the smallest unit of work. Think of tasks like:
By design, an action does one thing and does it well. This "atomic" nature is its superpower. It ensures that operations are reliable, easy to debug, and highly reusable. You can chain these simple actions together to create powerful, automated services and deliver valuable Services-as-Software.
The best way to understand an action.do is to see one. Instead of being trapped in a complex GUI, your business logic is expressed in clean, clear code. This makes it understandable, version-controllable, and easy for developers to integrate.
Here’s a simple example using the .do TypeScript SDK to define an action that sends a welcome email to a new user.
import { action } from '@do-sdk/core';
// Define an action to send a welcome email
const sendWelcomeEmail = action.create({
id: 'send-welcome-email',
description: 'Sends a welcome email to a new user.',
execute: async ({ email, name }) => {
// Your email sending logic via an external API
// For example, using SendGrid, Mailgun, or AWS SES
console.log(`Sending welcome email to ${name} at ${email}...`);
// The action returns a structured result
return { success: true, messageId: 'xyz-123' };
}
});
// Execute the action with specific inputs
const result = await sendWelcomeEmail.execute({
email: 'jane.doe@example.com',
name: 'Jane Doe'
});
console.log(result); // { success: true, messageId: 'xyz-123' }
In this code:
This is Business as Code in its purest form. The logic for "sending a welcome email" is now a self-contained, testable, and reusable asset.
A single action is useful, but the real power emerges when you compose them. This is where workflow.do comes in. A workflow orchestrates multiple action.do steps to achieve a larger business outcome.
action.do is the what (the specific task). workflow.do is the how (the sequence, conditions, and logic connecting the tasks).
Consider a user signup process:
A workflow.do would chain these actions together, handle errors (e.g., what if the email fails to send?), and pass data from one step to the next. Because each step is an isolated, atomic action, the entire workflow becomes more robust and easier aintain. If a user doesn't get their welcome email, you know exactly which brick in the wall—the send-welcome-email action—needs inspecting.
An atomic action is the smallest, indivisible unit of work in a workflow. It performs a single, specific task, like 'send an email' or 'update a database record', ensuring that operations are reliable, testable, and easy to debug.
An action.do represents a single step, while a workflow.do orchestrates multiple actions to achieve a larger business outcome. You build powerful workflows by composing a series of simple actions.
Yes. The .do platform is designed for extensibility. You can define your own custom actions using our SDK, encapsulating your specific business logic and integrating any third-party API to make them available in any workflow.
No, actions are stateless by design. They receive input, perform their task, and produce output without retaining memory of previous executions. State management is handled at the workflow level, ensuring actions are reusable and predictable.
Running your business as code isn't just a technical novelty; it's a strategic advantage. It brings agility, reliability, and clarity to your most critical operations.
By starting with the simple, powerful concept of an action.do, you lay the foundation for a more resilient and scalable organization. Stop wrestling with opaque, interconnected systems and start building your business with clean, modular, and powerful blocks of code.