FoundationAgents/OpenManus · error · ValueError

Unknown flow type: {flow_type}

Error message

Unknown flow type: {flow_type}

What it means

Raised by FlowFactory.create_flow() when flow_type is not in its registry. This version registers only FlowType.PLANNING, so any other enum value (or a raw string that does not match) is unsupported. It is a fail-fast guard against typos and unavailable flow implementations.

Source

Thrown at app/flow/flow_factory.py:28

    PLANNING = "planning"


class FlowFactory:
    """Factory for creating different types of flows with support for multiple agents"""

    @staticmethod
    def create_flow(
        flow_type: FlowType,
        agents: Union[BaseAgent, List[BaseAgent], Dict[str, BaseAgent]],
        **kwargs,
    ) -> BaseFlow:
        flows = {
            FlowType.PLANNING: PlanningFlow,
        }

        flow_class = flows.get(flow_type)
        if not flow_class:
            raise ValueError(f"Unknown flow type: {flow_type}")

        return flow_class(agents, **kwargs)

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Use FlowType.PLANNING, the only registered value: flow = FlowFactory.create_flow(FlowType.PLANNING, agents)
  2. If you need other flows, register them in the flows dict in app/flow/flow_factory.py or instantiate PlanningFlow directly
  3. Pass the enum member, not a string, to avoid lookup misses

Example fix

# before
flow = FlowFactory.create_flow(FlowType.FLOWFACTORY, agent)  # Unknown flow type

# after
flow = FlowFactory.create_flow(FlowType.PLANNING, agent)
Defensive patterns

Strategy: type-guard

Validate before calling

from app.flow.flow_factory import FlowFactory
from app.flow.flow_types import FlowType

def supported_flow(ft: FlowType) -> bool:
    return ft == FlowType.PLANNING

Type guard

from typing import TypeGuard
from app.flow.flow_types import FlowType

def is_supported_flow(value: object) -> TypeGuard[FlowType]:
    return value is FlowType.PLANNING

Try / catch

try:
    flow = FlowFactory.create_flow(flow_type, agents)
except ValueError as e:
    if "Unknown flow type" in str(e):
        flow = FlowFactory.create_flow(FlowType.PLANNING, agents)  # explicit fallback
    else:
        raise

Prevention

When it happens

Trigger: FlowFactory.create_flow(FlowType.FLOWFACTORY, agents) or any flow_type other than FlowType.PLANNING; passing flow_type as a string like "planning" when a FlowType enum member is expected (dict lookup by string can also miss).

Common situations: Following docs/tutorials from a fuller version of the framework that has flowfactory/planning variants; copy-pasting code that references flows removed in this build; enum/string mismatch at the call boundary.

Related errors


AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15). Data as JSON: /api/errors/54e8f340dbfb38bf. Report an issue: GitHub.