Task
A task represents a discrete objective or goal within a ControlFlow workflow that an AI agent needs to solve. Tasks are the fundamental building blocks of ControlFlow and act as a bridge between AI agents and application logic. Each task is defined by its specific objective, instructions, expected result type, and any required context or tools.
Tasks can have dependencies that define their relationships and execution order. Dependencies ensure that tasks are completed in a logical sequence, where one task’s output may be required as input for another, or certain tasks must be completed before others can begin. This allows developers to create complex workflows that are easy to understand and manage, ensuring that each task is executed with the necessary context and prerequisites.
Tasks have one or more agents assigned to them. By assigning appropriate agents, developers can optimize the execution of tasks by leveraging the specialized capabilities or model characteristics of different agents, ensuring each task is handled by the most suitable entity.
By specifying the parameters and dependencies of each task, developers can build sophisticated and dynamic workflows that leverage the full capabilities of AI agents in a structured and efficient manner.