fix: start node validation

This commit is contained in:
lyzno1 2025-09-22 12:58:20 +08:00
parent 034602969f
commit 906028b1fb
1 changed files with 2 additions and 2 deletions

View File

@ -135,12 +135,12 @@ class Graph(BaseModel):
# fetch root node
if not root_node_id:
# if no root node id, use the START type node as root node
# if no root node id, use any start node (START or trigger types) as root node
root_node_id = next(
(
node_config.get("id")
for node_config in root_node_configs
if node_config.get("data", {}).get("type", "") == NodeType.START.value
if NodeType(node_config.get("data", {}).get("type", "")).is_start_node
),
None,
)