Skip bypassed nodes (mode 4) in workflow conversion
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m2s
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m2s
Bypassed/muted nodes should not be included in the API workflow, and connections from bypassed nodes should be ignored. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
11
handler.py
11
handler.py
@@ -116,11 +116,16 @@ def convert_frontend_to_api(frontend_workflow: dict) -> dict:
|
||||
nodes = frontend_workflow.get("nodes", [])
|
||||
links = frontend_workflow.get("links", [])
|
||||
|
||||
# Build set of active (non-bypassed) node IDs
|
||||
active_nodes = {str(node["id"]) for node in nodes if node.get("mode") != 4}
|
||||
|
||||
# Build link lookup: link_id -> (source_node_id, source_slot)
|
||||
# Only include links from active nodes
|
||||
link_map = {}
|
||||
for link in links:
|
||||
link_id, src_node, src_slot, dst_node, dst_slot, link_type = link[:6]
|
||||
link_map[link_id] = (str(src_node), src_slot)
|
||||
if str(src_node) in active_nodes:
|
||||
link_map[link_id] = (str(src_node), src_slot)
|
||||
|
||||
# Widget mappings for each node type: list of input names in order
|
||||
WIDGET_MAPPINGS = {
|
||||
@@ -165,6 +170,10 @@ def convert_frontend_to_api(frontend_workflow: dict) -> dict:
|
||||
}
|
||||
|
||||
for node in nodes:
|
||||
# Skip bypassed/muted nodes (mode 4)
|
||||
if node.get("mode") == 4:
|
||||
continue
|
||||
|
||||
node_id = str(node["id"])
|
||||
class_type = node.get("type", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user