Skip to main content
Agentic workflow is an type of tool with built-in agentic capabilities and automations that support arbitrarily complex orchestration of multiple Agents, Tools and People. Each node can represent an agent, a tool, or built-in capabilities such as user interactions, prompts, or decision logic. With agentic workflows, you design workflows using control structures such as conditional branching with if-then-else or switch-case, iteration over lists with foreach, and loops that repeat actions until specific conditions are met. A agentic workflow is composed of nodes and edges. You define nodes of different types and connect them using edges. Because agentic workflows can take several seconds to execute depending on their complexity, they run asynchronously. Agentic workflows apply to various scenarios, such as:
  • Repeatable, predictable sequencing of agents, tools, and human tasks is required.
  • Long-running processes are involved. Agentic workflow supports extended task chains that can take minutes, hours, or even days to complete.
  • Human-in-the-loop interaction is needed for approvals or decision-making.
  • Scheduling is necessary to trigger tasks at specific times or intervals.
Note:
  • When a agentic workflow tool is invoked, the system returns an instance ID and waits for the response.
  • To check the progress, use the Get agentic workflow status tool in a new chat session. Provide the instance ID to retrieve the current status of the agentic workflow.

Agentic workflow and ADK

Unlike the UI experience, the pro-code approach uses the ADK CLI and Python library. You build agentic workflows with the Python library included in ADK, then manage them with the ADK CLI in your active environment. This environment can be local or remote. For details, see Environments.
1

Create an agentic workflow

Use Python and the ADK library to create agentic workflows and their nodes. For more information, see:
2

Import the workflow into your environment

After creating a workflow, import it into your active watsonx Orchestrate environment using the command orchestrate tools import with the flag --kind flow. For more information, see Import the agentic workflow.
3

Manage agentic workflows in your environment

After you import a agentic workflow, you can also list it, export it, update it, and remove it from your active environment. Because an agentic workflow is a type of tool, you manage it with the same commands you use for other tools in ADK. For more information, see Managing tools.

Agentic workflow key concepts

The sections below introduce the key concepts and components you’ll use when working with agentic workflows:
Edges connect nodes within a agentic workflow. Every agentic workflow must begin with a Start Node and end with one or more End Node.
The system supports the following node type right now and more will be added over time:
  • Flow Node: A node that represents a agentic workflow or a nested agentic workflow.
  • Start Node: The entry point of a agentic workflow. Each agentic workflow must have exactly one Start Node.
  • End Node: The exit point of a agentic workflow. A agentic workflow must have at least one End Node.
  • Tool Node: Call an imported tool and returns its result.
  • Agent Node: Call an imported agent to perform a certain task.
  • Decisions Node: (Public Preview) Specify a decision table to determine actions based on provided conditions.
  • Prompt Node: (Public Preview) Make a LLM call to extract/classify/generate information based on provided input.
  • Doc Processing Node: (Public Preview) Extract text from a provided document.
  • Branch Node: A conditional branch. Currently, only binary branches are supported.
  • Foreach Node: A nested agentic workflow that iterates over a list of items until it is done.
  • Loop Node: A nested agentic workflow that iterates over a condition as long as it is true.
Each node includes a specification that defines its behavior and properties:
  • kind: The type of node. For example: tool, user, agent.
  • name: The internal name of the node.
  • display_name (optional): A user-friendly name for display purposes.
  • description (optional): A brief description of the node’s purpose.
  • input_schema (optional): The input schema of the node. By default there are no input schemas.
  • output_schema (optional): The output schema of the node. By default there are no output schemas.
To improve auto-mapping reliability, large data in the flow is automatically summarized. You customize the summarization by providing instructions specific to your use case. If data is not summarized, auto-mapping fails due to token limits, resulting in unpredictable agent behavior.
Python
class FlowContextWindow(BaseModel):
"""Indicate the context window setting for the LLM model used by the flow"""

compression_threshold: Optional[int] = Field(
    description="Trigger compression when the context window reaches a specific number of tokens",
    default=None
)
compression_instruction: Optional[str] = Field(
    description="Instruction used for summarization or compression",
    default=None
)
max_tokens: Optional[int] = Field(
    description="The maximum number of tokens supported by the LLM model",
    default=None
)
allow_compress: Optional[bool] = Field(
    description="Indicates whether compression is allowed",
    default=True
)
(Public Preview) It is also possible to schedule a agentic workflow or an Agent to run at a later today. See the section on Scheduler for details.

Agentic workflow examples

The examples/flow_builder directory includes sample agentic workflow that demonstrate key agentic workflow features:
  • agent_scheduler: Demonstrates agent scheduling.
  • collaborator_agents: Shows how to sequence multiple agents.
  • extract_support_request: Uses an LLM to extract information from support requests.
  • foreach_email: Applies the Foreach control to iterate over a set of items.
  • get_facts_numbers: Uses the Loop control to repeat work until a condition is met.
  • get_insurance_rate: Uses a Decisions node to determine insurance rates based on credit rating and loan amount.
  • get_pet_facts: Demonstrates branching to route requests.
  • get_tuition_reimbursed: Uses multiple branches to support complex logic routing.
  • hello_message_flow: Sequences two Python tools together.
  • ibm_knowledge_to_emails: Combines an agent and a tool in a single agentic workflow.
  • schedule_helpdesk_alert: Creates a schedulable agentic workflow to check helpdesk availability.
  • text_extract: Uses the DocProc node to extract text from a document.
  • user_flow_application_form: Displays a form to the user in the chat.