Developing intelligent, automated agents requires breaking down complex tasks into manageable, reusable pieces. On the .do platform, this fundamental building block is known as a function.do. This concept is key to creating robust and scalable agentic workflows.
At its core, a function.do is an atomic, composable unit of business logic. Think of it as a single, well-defined action or piece of processing that your agent can perform. Instead of monolithic blocks of code, you create focused functions that do one thing well.
This atomic nature provides several key benefits:
The power of function.do lies in its ability to encapsulate specific business logic. Whether it's fetching data from an external API, processing a customer request, or performing a calculation, each task can be defined as a distinct function.
This approach aligns perfectly with the principles of "business as code," where your operational logic is directly represented and executed within the platform.
Defining a function.do on the .do platform is straightforward. You leverage familiar programming languages like TypeScript or JavaScript and utilize the .do SDK to wrap your logic. Here's a simple example:
export const createService = agent(async (input: { name: string, description?: string }) => {
// Logic to create a new service
const newService = {
id: generateId(), // Assuming generateId is a helper function
name: input.name,
description: input.description || '',
createdAt: new Date()
};
console.log(`Created service: ${newService.name}`);
return newService;
});
In this example, createService is a function.do that encapsulates the logic for creating a new service entry. It takes specific input (the service name and optional description) and returns the newly created service object.
function.do serves as the foundation for building sophisticated Agentic Workflows. By composing these atomic functions, you can define the step-by-step processes that your agents execute. For instance, a customer support agent might chain functions for:
The .do platform provides the orchestration layer to manage these compositions, ensuring seamless execution and allowing you to visualize and refine your workflows.
Once defined, function.do are deployed and managed directly within the .do platform. This provides a centralized environment for your business logic, making them:
Ready to start building with atomic, reusable logic? Explore the .do platform and begin defining your own function.do to power your next-generation agentic workflows.
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.