Skip to content

Another issue with graph analysis and conditional branches #23

Open

Description

@poautran

In GitLab by @woutdenolf on Nov 12, 2025, 14:07 GMT+1:

from ewoks import execute_graph

def run(a=None, b=None):
    print(f"{a=}, {b=}")
    return {"a":(a or 0) + 1, "b":(b or 0) + 1}

def endrun(a=None, b=None):
    print(f"END {a=}, {b=}")
    return {"a":(a or 0) + 1, "b":(b or 0) + 1}

workflows = {
    "graph": {},
    "nodes": [
        {"id": "start0", "task_type": "ppfmethod", "task_identifier": "__main__.run"},
        {"id": "start", "task_type": "ppfmethod", "task_identifier": "__main__.run"},
        {"id": "up", "task_type": "ppfmethod", "task_identifier": "__main__.run"},
        {"id": "down", "task_type": "ppfmethod", "task_identifier": "__main__.run"},
        {"id": "end", "task_type": "ppfmethod", "task_identifier": "__main__.endrun"},
    ],
    "links": [
        {"source": "start0", "target": "start", "map_all_data":True, "conditions": [{"source_output": "a", "value": 1}]},
        {"source": "start", "target": "up", "map_all_data":True},
        {"source": "start", "target": "down", "map_all_data":True},
        {"source": "up", "target": "end", "map_all_data":True},
        {"source": "down", "target": "end", "map_all_data":True}
    ]
}

import logging
# logging.basicConfig(level=logging.DEBUG)
result = execute_graph(workflows, engine="ppf")

The end node is triggered twice which should not be the case

a=None, b=None
a=1, b=1
a=2, b=2
END a=3, b=3
a=2, b=2
END a=3, b=3

Migrated from GitLab: https://gitlab.esrf.fr/workflow/ewoks/ewoksppf/-/issues/23

Activity

  1. added this to the v3.1.0 milestone on Oct 4, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. added theissue type on Oct 6, 2026
  4. updated progress triage and priority medium on Oct 6, 2026
  5. olofsvensson commented on Oct 21, 2026

    @olofsvensson
    Contributor

    I have confirmed that this is still a bug in the latest versions of ewoks modules.

  6. modified the milestone: v3.1.0 on Oct 24, 2026
  7. woutdenolf commented on Oct 24, 2026

    @woutdenolf
    Member

    Post-pone until the new graph analysis is introduced: ewoks-kit/ewokscore#518 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

priority

medium

progress

blocked

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions