crewai - 💡(How to fix) Fix [BUG] @listen(or_(A, B, C)) multi-source OR listener only fires once, blocking cyclic flow re-triggering [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a method uses @listen(or_(A, B, C)) (a multi-source OR condition), it is only triggered by the first satisfied condition. Subsequent signals from other conditions in the same or_() are silently dropped. This prevents cyclic flows where the same method needs to be re-triggered by different signals in different iterations.

Root Cause

When a method uses @listen(or_(A, B, C)) (a multi-source OR condition), it is only triggered by the first satisfied condition. Subsequent signals from other conditions in the same or_() are silently dropped. This prevents cyclic flows where the same method needs to be re-triggered by different signals in different iterations.

Fix Action

Fixed

Code Example

from crewai.flow import Flow, listen, router, start, or_

@start()
def start_method(self):
    return "SignalA"

@listen(or_("SignalA", "SignalB"))
def handler(self):
    print("handler triggered")
    return "done"

@router(handler)
def router_method(self):
    print("router_method running")
    return "SignalB"
RAW_BUFFERClick to expand / collapse

Description

When a method uses @listen(or_(A, B, C)) (a multi-source OR condition), it is only triggered by the first satisfied condition. Subsequent signals from other conditions in the same or_() are silently dropped. This prevents cyclic flows where the same method needs to be re-triggered by different signals in different iterations.

Steps to Reproduce

from crewai.flow import Flow, listen, router, start, or_

@start()
def start_method(self):
    return "SignalA"

@listen(or_("SignalA", "SignalB"))
def handler(self):
    print("handler triggered")
    return "done"

@router(handler)
def router_method(self):
    print("router_method running")
    return "SignalB"

Expected behavior

Infinite loop: handler → router_method → SignalB → handler → ...

Screenshots/Code snippets

handler runs once (triggered by SignalA), then SignalB from router_method does NOT re-trigger handler. Flow exits silently.

Operating System

Ubuntu 20.04

Python Version

3.11

crewAI Version

0.83.0

crewAI Tools Version

0.83.0

Virtual Environment

Conda

Evidence

This problem cann be reproduce.

Possible Solution

None

Additional context

None

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Infinite loop: handler → router_method → SignalB → handler → ...

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING