In modern software development, orchestrating complex business processes can be a significant challenge. From onboarding new customers to managing multi-step order fulfillment, these processes often involve multiple services, conditional logic, and error handling. What if you could define these entire processes as code—readable, version-controlled, and instantly deployable as a robust service?
Enter the .do SDK, the developer-native toolkit for building agentic workflows. It’s designed to help you turn complex business logic into simple, powerful Services-as-Software. The core philosophy is Business-as-Code: your business process is the code, and once deployed, it is the software.
This post will take a deep dive into the two fundamental building blocks of the .do ecosystem: Workflows and Agents.
Before we jump into the code, let's clarify what we mean by an "agentic workflow." Think of it as a digital assembly line designed to accomplish a specific business goal.
This model allows you to declaratively define a business process without getting bogged down in the imperative boilerplate of connecting services and managing state. You define what needs to be done, and the agent takes care of how to do it.
The first core concept in the .do SDK is the Workflow. It's a simple, declarative object that outlines the steps of a business process. Let's look at a classic example: onboarding a new customer.
With the .do SDK, this process is defined in a clean, readable Typescript object.
import { Agent, Workflow } from '@do-sdk/core';
// Define a workflow with multiple steps
const onboardCustomer = new Workflow({
name: 'customer.onboard',
steps: [
{ do: 'validate.email' },
{ do: 'create.user.profile' },
{ do: 'send.welcome.email' },
],
});
Let's break this down:
By defining the process this way, you've created Business-as-Code. Your customer onboarding logic is now explicit, easy to understand, and can be tracked in version control just like any other part of your application.
A workflow is just a blueprint; you need someone—or something—to execute it. This is where the Agent comes in. An Agent is the entity responsible for running your defined workflows.
Creating an agent is just as straightforward:
// Create an agent to execute the workflow
const agent = new Agent({ workflows: [onboardCustomer] });
Here, we're creating a new Agent and equipping it with the onboardCustomer workflow we just defined. An agent can be configured to handle multiple workflows, making it a central controller for a specific domain of business logic (e.g., a "Customer Agent," "Billing Agent," etc.).
With your Workflow defined and your Agent configured, executing the entire process is a single, clean function call.
// Execute the workflow via the agent
async function run() {
const result = await agent.execute('customer.onboard', {
email: 'new.user@example.com',
name: 'Jane Doe',
});
console.log(result);
}
The agent.execute() method takes two arguments:
The Agent handles the rest. It will step through the onboardCustomer workflow, passing the data from one step to the next, handling any intermediary logic, and finally returning the result.
This is where the paradigm shift from traditional API development truly happens. After writing your agentic workflow using the Typescript SDK, you deploy it to the .do platform.
The platform automatically exposes your 'customer.onboard' workflow as a secure, scalable API endpoint.
There's no need to set up a server, configure routing, or manage infrastructure. Your Business-as-Code instantly becomes a consumable Service-as-Software. This powerful abstraction lets you focus entirely on the business logic, knowing the delivery and scalability are handled for you.
The .do SDK is designed for any developer who wants to automate complex processes and build robust, service-oriented architecture without the overhead.
npm install @do-sdk/core
From there, you can import the Agent and Workflow modules and begin defining your first business process. For comprehensive guides and examples, be sure to check out our official documentation.
Ready to transform your business processes into powerful, maintainable software? Start building with the .do SDK today.