Skip to main content
If your users interact directly with a Workflow, it is often useful to make it a Conversational Workflow. Users will then be able to chat with the Workflow, in the same way you’d interact with an Agent or a Team. This feature allows you to add a WorkflowAgent to your workflow that intelligently decides whether to:
  1. Answer directly based on the current input and past workflow results
  2. Run the workflow when the input cannot be answered based on past results
What is a WorkflowAgent?WorkflowAgent is a restricted version of the Agent class specifically designed for workflow orchestration.

Quick Start

This is how you can add a WorkflowAgent to your workflow:

Architecture

Workflows conversational workflows diagram

Workflow History for Conversational Workflows:

Similar to workflow history for steps, the WorkflowAgent has access to the full history of workflow runs for the current session. This makes it possible to answer questions about previous results, compare outputs from multiple runs, and maintain conversation continuity.
How to control the number of previous runs the workflow agent can see?The num_history_runs parameter controls how many previous workflow runs the agent can see when making decisions. This is crucial for:
  • Context awareness: The agent needs to see past runs to answer follow-up questions
  • Memory limits: Including too many runs can exceed the model context window
  • Performance: Fewer runs mean faster processing and lower input tokens

Instructions for the WorkflowAgent:

You can provide custom instructions to the WorkflowAgent to control its behavior. Although default instructions are provided which instruct the agent to answer directly from history or to run the workflow when new processing is needed, you can override them by providing your own instructions.
We recommend using the default instructions unless you have a specific use case where you want the agent to answer in a particular way or include some specific information in the response. The default instructions should be sufficient for most use cases.

Usage Example

Developer Resources

Explore the different examples in Conversational Workflows Examples section for more details.