This sample demonstrates a simple, sequential workflow where agents and functions are executed in a linear order.
The architecture of this sample is a WorkflowAgent that defines a single, non-branching execution path.
city_generator_agent: AnLlmAgentthat starts the workflow by generating a random city.lookup_time_function: A Python function that takes the city from the previous step, looks up the current time for that city, and yields the time information.city_report_agent: A finalLlmAgentthat takes the city and time, and formats a sentence to be returned to the user.
The sequence is defined in the edges of the WorkflowAgent:
edges=[
(START, city_generator_agent, lookup_time_function, city_report_agent)
]This creates a chain where the output of one node is passed as the input to the next.
This sample showcases the basic sequential execution capabilities of a WorkflowAgent. It's the simplest form of a workflow, where you can define a specific, ordered series of tasks. This is useful when you have a process that needs to run in a controlled, step-by-step manner without any complex routing or conditional logic.
To deploy this workflow agent, you can use the adk deploy command.
Ensure you have authenticated with Google Cloud:
gcloud auth application-default loginYour GCP project and location should be set in a .env file in the root of this project.
adk deploy workflow-sequential/agent.py:root_agent --display-name "Sequential City Time Agent"After deployment, you can interact with the agent through the provided endpoint.