@@ -250,7 +250,7 @@ def serialize(self) -> JsonObject:
250250 has_manual_trigger = len (manual_trigger_edges ) > 0
251251
252252 # Determine which nodes have explicit non-trigger entrypoints in the graph
253- # We need this early to decide whether to create an ENTRYPOINT node
253+ # This is used later to decide whether to skip entrypoint edges for nodes with triggers
254254 non_trigger_entrypoint_nodes : Set [Type [BaseNode ]] = set ()
255255 for subgraph in self ._workflow .get_subgraphs ():
256256 if any (True for _ in subgraph .trigger_edges ):
@@ -261,18 +261,6 @@ def serialize(self) -> JsonObject:
261261 except Exception :
262262 continue
263263
264- # Check if workflow has only non-manual triggers (IntegrationTrigger/ScheduleTrigger)
265- has_only_non_manual_triggers = len (trigger_edges ) > 0 and not has_manual_trigger
266-
267- # We need an ENTRYPOINT node if:
268- # 1. There's a ManualTrigger, OR
269- # 2. There are no triggers at all (backward compatibility), OR
270- # 3. There are non-trigger entrypoints (nodes that need ENTRYPOINT edges alongside triggers)
271- # We skip ENTRYPOINT node only when there are ONLY non-manual triggers with no regular entrypoints
272- needs_entrypoint_node = (
273- has_manual_trigger or not has_only_non_manual_triggers or len (non_trigger_entrypoint_nodes ) > 0
274- )
275-
276264 entrypoint_node_id : Optional [UUID ] = None
277265 entrypoint_node_source_handle_id : Optional [UUID ] = None
278266 entrypoint_node_display = self .display_context .workflow_display .entrypoint_node_display
@@ -296,8 +284,9 @@ def serialize(self) -> JsonObject:
296284 "base" : None ,
297285 "definition" : None ,
298286 }
299- elif needs_entrypoint_node :
300- # Non-trigger entrypoints exist: use workflow_display ENTRYPOINT node
287+ else :
288+ # Non-manual trigger or no triggers: use workflow_display ENTRYPOINT node if IDs are present
289+ # This allows the ENTRYPOINT node to be optional - if IDs are None, no ENTRYPOINT node is created
301290 entrypoint_node_id = self .display_context .workflow_display .entrypoint_node_id
302291 entrypoint_node_source_handle_id = self .display_context .workflow_display .entrypoint_node_source_handle_id
303292
@@ -315,7 +304,6 @@ def serialize(self) -> JsonObject:
315304 "base" : None ,
316305 "definition" : None ,
317306 }
318- # else: only non-manual triggers with no regular entrypoints - no ENTRYPOINT node needed
319307
320308 # Add all the nodes in the workflows
321309 for node in self ._workflow .get_all_nodes ():
0 commit comments