The building block of Agentic Workflows
Functions are atomic, single-purpose units of work that are composable and reusable throughout your agentic workflows.
In the world of agentic workflows and delivering "services-as-software" on the .do platform, the fundamental building block is the function. Think of functions as the essential atoms that come together to create complex, intelligent processes. But what exactly constitutes a function within the .do ecosystem? It's all about clear definitions, precise inputs, and predictable outputs.
At its core, a function on .do is an atomic, self-contained unit of work. This means it performs one specific task and does it well. It's the smallest and most fundamental component you'll use to build your applications and services.
Imagine you needed to build a workflow that takes customer information, validates their email address, and then sends them a personalized welcome email. Instead of building this as one massive, monolithic block, you'd break it down into functions: one function to receive customer data, one function to validate the email format, and one function to send the email. Each function handles its distinct task independently.
This atomic nature of functions is incredibly powerful because it unlocks composability and reusability:
A key characteristic of a .do function is its clear definition of inputs and outputs. This structure is crucial for how functions interact with each other and the overall workflow.
Consider this example:
{
"name": "sum",
"description": "Adds two numbers",
"inputs": {
"a": "number",
"b": "number"
},
"outputs": {
"sum": "number"
}
}
This explicit definition of inputs and outputs makes functions predictable and easy to integrate into larger workflows. You know exactly what data a function needs to run and what data you can expect to receive from it.
Think of functions like the individual steps in a recipe. Each step (function) does one specific thing – like "chop the vegetables" or "sauté the onions." To create a complete meal (a bundled service or application), you combine these individual steps in a specific order. Each step requires certain ingredients (inputs) and produces something new (outputs) that can be used in the next step.
Leveraging atomic, composable functions on .do offers several significant advantages:
What does it mean for a function to be 'atomic' on .do?
Functions on .do are atomic, meaning they perform a single, well-defined task. They are the smallest, most fundamental units of work within an agentic workflow.
Can I reuse functions across different workflows?
Yes, functions on .do are designed to be highly reusable. Once defined, a function can be incorporated into multiple different agentic workflows, reducing redundancy and promoting efficiency.
How does the composability of functions benefit me?
Composability means that functions can be combined and sequenced together to create more complex workflows and services. By linking atomic functions, you can build sophisticated business processes.
Can you give me an analogy for how functions work in a workflow?
Think of functions as the steps in a recipe. By combining these individual steps (functions), you can create a complete meal (a bundled service or application). Each function does one specific thing simply and elegantly.
How do functions handle data and information exchange?
Functions have clearly defined inputs they accept and outputs they produce. This structure makes them predictable and easy to integrate into larger workflows, ensuring compatibility and smooth execution.
Understanding the concept of functions – their atomic nature, clear inputs and outputs, and their role in composability and reusability – is key to building powerful agentic workflows and services-as-software on the .do platform. Explore the .do SDK and API to start defining and utilizing your own atomic functions today!