What is a Runnable?
A Runnable is an executable unit capable of processing inputs and producing outputs through an async generator interface. It works as a wrapper that turns any callable into a standarized, traceable, and composable execution unit. All runnables provide a unified interface and execution pattern, enabling seamless composition regardless of their underlying implementation:- Tools - Function wrappers with automatic schema generation and explicit parameter control
- Agents - Autonomous execution units that orchestrate LLM interactions with tool calling
- Workflows - Programmable execution pipelines that orchestrate step-by-step processing
name. This name is used for tracing, debugging, and referencing the runnable in workflows, agents, and other components. Whether you’re creating a Tool, an Agent, or a Workflow, the name parameter is required and must be unique within your application context.
Here’s how to create a basic Tool:
Parameter Handling and Basic Execution
Runnables can be called as a regular python function. You can pass parameters as keyword arguments, and they’ll be automatically mapped to the appropriate parameters in the underlying functions:b=10 is passed at runtime and overrides the callable default that would generate a random number.