Adding a workflow
When building AI agents, it can be useful to combine them with workflows that perform multi-step tasks or fetch structured data. Timbal lets you pass workflows to an agent using the workflows
parameter. Workflows provide a way for agents to trigger predefined sequences of steps, giving them access to more complex operations than a single tool can provide.
Prerequisites
This example uses the openai
model. Make sure to add OPENAI_API_KEY
to your .env
file.
Creating a workflow
This workflow retrieves English Premier League fixtures for a given date. Clear input and output schemas keep the data predictable and easy for the agent to use.
Adding a workflow to an agent
This agent uses soccer_workflow
to answer fixture questions. The instructions tell it to compute the date, pass it in YYYY-MM-DD format, and return team names, match times, and dates.
Example usage
Use the agent directly by calling it with a prompt message.