BaseWorkflow is the abstract foundation for all workflow types in the Agentic Patterns library. It manages a named registry of agents and an optional list of tools, and enforces a common run interface that subclasses must implement.
Known subclasses: SequentialWorkflow, ParallelWorkflow
Import
Constructor
A dictionary mapping agent names to agent instances. Used to look up agents by name at runtime.
A list of tools or skills available to workflow components. Stored as
self.tools; empty list if not provided.A label used in log output to identify this workflow instance.
Methods
get_agent
Retrieves a registered agent by name.
The key used when the agent was registered in the
agents dictionary.The agent instance associated with the given name.
run (abstract)
The main entry point for executing the workflow. Must be implemented by every subclass.
The overarching task or objective to be executed by the workflow.
The final output of the workflow. Shape depends on the concrete subclass implementation.