In today's rapidly evolving digital landscape, building scalable, efficient, and intelligent systems requires a new approach to how we define and manage business logic. Enter function.do – the atomic foundation for creating agentic workflows on the .do platform. It's more than just a function; it's your key to encapsulating business logic into reusable, composable units of action.
At its core, a function.do represents a single, atomic unit of business logic within the .do platform. Think of it as a precisely defined, self-contained operation that performs a specific task. These aren't just generic code snippets; they are the fundamental building blocks for crafting sophisticated agentic workflows.
The beauty of function.do lies in its atomicity. Each function focuses on one clear responsibility, making it easier to develop, test, and maintain your business logic. By breaking down complex processes into these smaller, manageable chunks, you unlock unparalleled agility and efficiency in your development cycles.
The .do platform empowers you to define your business logic using standard programming languages like TypeScript or JavaScript. This "business as code" approach bridges the gap between technical implementation and business requirements, ensuring clarity and consistency.
Let's look at an example:
In this function.do example, createService is an atomic unit responsible solely for creating a new service. It takes name and an optional description as input and returns the newly created service object. This perfectly illustrates how a function.do encapsulates a specific piece of business logic.
While individual function.do are powerful, their true strength emerges when they are combined. The .do platform's orchestration capabilities allow you to seamlessly compose and chain multiple function.do to create comprehensive Agentic Workflows.
Imagine building a complex process like "Onboard New Customer." Instead of one monolithic function, you can combine:
Each of these is a distinct function.do, working in harmony to complete the larger workflow. This modularity not only simplifies development but also enhances reusability. Any of these atomic functions can be leveraged in other workflows, maximizing your code's efficiency.
Once defined, your function.do are deployed and managed within the robust .do platform. This centralized management ensures they are:
A function.do represents a single, atomic unit of business logic within the .do platform. It's a core building block for creating more complex agents and services.
You define function.do using standard programming languages like TypeScript or Javascript, leveraging the .do SDK to encapsulate specific business logic.
Yes, multiple function.do can be composed and chained together using the .do platform's orchestration capabilities to create comprehensive Agentic Workflows.
function.do are deployed and managed within the .do platform, making them easily discoverable, executable, and scalable.
function.do is more than just a naming convention; it's a paradigm shift in how we approach business logic within scalable, agentic systems. By embracing atomic, reusable units of action, you can build more robust, maintainable, and intelligent workflows on the .do platform. Start encapsulating your business logic today and experience the power of truly composable architecture.
export const createService = agent(async (input: { name: string, description?: string }) => {
// Logic to create a new service
const newService = {
id: generateId(),
name: input.name,
description: input.description || '',
createdAt: new Date()
};
console.log(`Created service: ${newService.name}`);
return newService;
});