Is your user onboarding sequence as effective as it could be? Could a different notification strategy reduce churn? These are critical business questions, but testing backend logic and complex workflows is notoriously difficult. While A/B testing a button color is straightforward, experimenting with core business processes often involves clunky feature flags, risky deployments, and a mountain of engineering overhead.
What if you could A/B test your entire business logic as easily as you test a headline?
This is the promise of experiment.do, a powerful way to run controlled experiments on your agentic workflows. But to run a reliable experiment, you need reliable building blocks. That foundation is action.do.
Optimizing a business isn’t just about the user interface. It’s about the sequence of events that happens behind the scenes:
Testing changes to these interconnected systems is slow and fragile. One small error can lead to duplicate charges, missed notifications, or corrupted data. To experiment safely and effectively, you need to rethink the very nature of a task.
Before you can A/B test a workflow, you must be able to trust every single step within it. This is where action.do comes in. It provides the fundamental building block for your Business-as-Code: the atomic action.
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. Think of it as one perfect, self-contained task.
By building your business logic from these simple, single-purpose actions, you create systems that are robust, reliable, and auditable.
When you're running two versions of a workflow, reliability is non-negotiable. action.do is built on principles that make this possible:
Here’s how simple it is to execute a single, reliable action in your code:
import { Do } from '@do-sdk/core';
// Initialize the .do client with your API key
const a = new Do(process.env.DO_API_KEY);
// Execute a specific, atomic action with parameters
const { result, error } = await a.action.execute({
name: 'send-welcome-email',
params: {
userId: 'usr_12345',
template: 'new-user-welcome-v2'
}
});
if (error) {
console.error('Action failed:', error);
} else {
console.log('Action Succeeded:', result);
}
With action.do as your foundation, you can now use experiment.do to orchestrate and compare different workflows.
Imagine you want to test a new user onboarding process.
Workflow A (The Control)
Workflow B (The Variant)
experiment.do handles splitting the traffic between these two versions. Because each step is a guaranteed atomic action, you can trust the execution of both workflows. The result is clean, reliable data you can use to make informed decisions about your business logic—not just your UI.
By combining the workflow experimentation of experiment.do with the foundational reliability of action.do, you unlock a new level of business optimization. You can finally move from guessing to knowing.
Ready to stop testing buttons and start optimizing your entire business? Dive into the world of agentic workflows and build your next great process with .do.
What constitutes an 'atomic action'?
An atomic action is a single, indivisible operation that either completes successfully or fails entirely, leaving no partial state. Examples include sending a single email, making one API call, or writing a single record to a database.
Why is idempotency important for actions?
Idempotency ensures that executing the same action multiple times with the same parameters has the same effect as executing it once. This is crucial for building reliable systems that can recover from failures without causing unintended side effects, like sending duplicate invoices.
How does action.do relate to a workflow.do?
action.do represents the individual steps or building blocks. A workflow.do is a sequence or graph of these actions orchestrated to achieve a larger business outcome. You compose workflows from one or more atomic actions.
Can I define my own custom actions?
Yes. The .do platform allows you to define your own custom actions as functions or microservices, which can then be invoked via the action.do API. This turns your existing business logic into reusable, auditable components.