In the world of software development and operations, building complex automation can feel like constructing a house of cards. A single change in a monolithic script can bring the entire process crashing down. Debugging becomes a nightmare, and reusability is often an afterthought. What if we could build robust, scalable automations with the same precision and reliability as we build modern applications?
This is where action.do comes in. It is The Building Block of Automation.
action.do represents a single, executable, and indivisible step in any process. It's an atomic unit of work designed to perform one task and do it well. By chaining these simple, powerful actions together, you can create sophisticated, automated services and begin delivering valuable Services-as-Software.
Think of an atomic action as a Lego brick for your workflows. Each brick has a specific shape and purpose. By itself, it's simple. But when you combine them, you can build anything you can imagine.
In the context of the .do platform, an atomic action is the smallest unit of work within an agentic workflow. It’s a self-contained operation that is:
This approach transforms complex processes from fragile scripts into a resilient system of interchangeable components.
At its core, action.do is about defining your business as code. Instead of relying on GUI-based builders that hide logic, you define actions explicitly, making them version-controllable, reviewable, and easy to manage.
Here’s how you can define a simple action to send a welcome email using the .do SDK in TypeScript:
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
// e.g., await sendgrid.send({ to: email, ... })
console.log(`Sending welcome email to ${name} at ${email}...`);
// Return 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 example, we've encapsulated the logic for sending an email into a reusable action. It has a clear id, a helpful description, and a focused execute function that performs the task.
If an action.do is a single brick, a workflow.do is the final construction. An action.do represents a single step, while a workflow.do orchestrates multiple actions to achieve a larger business outcome.
You build powerful workflow automation by composing a series of simple actions. Consider a new user onboarding process:
Each step is an independent, atomic action.do. The workflow.do defines the sequence, handles passing data between actions (like the user's email), and manages the overall state of the process. This separation of concerns is fundamental to building scalable and maintainable automation.
Q: What is an 'atomic action' in the context of .do?
A: 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.
Q: How does an action.do differ from a workflow.do?
A: 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.
Q: Can I create my own custom actions?
A: 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.
Q: Are actions stateful?
A: 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.