Skip to content

Workflow validation warning: Cycle detected in workflow graph – ensure termination/iteration limits exist #83

@thegovind

Description

@thegovind

Bug Summary

A warning appears in the console related to workflow validation cycles:

[2025-11-01 15:05:04 - /Users/govindk/code/work/ip/ignite-build/spec-to-agents/.venv/lib/python3.13/site-packages/agent_framework/_workflows/_validation.py:482 - WARNING] Cycle detected in the workflow graph involving: logistics -> catering -> budget -> venue -> event_coordinator -> logistics. Ensure termination or iteration limits exist.

Details

  • The warning is triggered by the workflow validation code in the agent_framework package (see below).
  • The validation logic uses a cycle detection algorithm in WorkflowGraphValidator._validate_cycles() and warns if cycles are detected among workflow executors.
  • The cycle in my workflow involves: logistics -> catering -> budget -> venue -> event_coordinator -> logistics.

Source code (validation logic)

# (see full source in agent_framework/_workflows/_validation.py)
# ...
class WorkflowGraphValidator:
    ...
    def _validate_cycles(self) -> None:
        ...
        logger.warning(
            "Cycle detected in the workflow graph involving: %s. Ensure termination or iteration limits exist.",
            formatted_cycles,
        )

Expected Behavior

Workflow cycles should either be handled with clear termination conditions or have explicit iteration limits to prevent infinite loops.

Steps to Reproduce

  1. Construct a workflow graph with the following nodes: logistics, catering, budget, venue, event_coordinator, logistics (cycle).
  2. Run validation (or initialize the workflow).
  3. Observe warning in the console.

Additional Notes

If you need more information or a reproduction case, let me know!

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions