Skip to content

[Bug]: Execute button throws error when used inside subgraph #4581

@christian-byrne

Description

@christian-byrne

Custom Node Testing

☑️ I have tried disabling custom nodes and the issue persists

Frontend Version

1.25.2

Expected Behavior

When selecting output nodes inside a subgraph and clicking the execute button in the selection toolbox, the partial execution should work correctly, executing only the selected nodes and their dependencies within the subgraph context.

Actual Behavior

execute-subgraph.mov

When using the execute button on selected nodes while inside a subgraph, it throws an error. The error toast displays:
"cannot read properties of undefined (reading 'inputs')"

Steps to Reproduce

  1. Create a workflow with a subgraph node
  2. Enter the subgraph (double-click or right-click → "Enter Subgraph")
  3. Add some nodes inside the subgraph, including at least one output node (e.g., SaveImage)
  4. Select one or more output nodes inside the subgraph
  5. Click the execute button (play icon) in the selection toolbox
  6. Observe the error toast message

Debug Logs

The error occurs in the browser, no terminal logs are generated for this issue.

Browser Logs

TypeError: Cannot read properties of undefined (reading 'inputs')
    at recursiveAddNodes (executionUtil.ts:37)
    at recursiveAddNodes (executionUtil.ts:39)
    at graphToPrompt (executionUtil.ts:187)

Setting JSON

Using default settings. The issue is reproducible with a fresh ComfyUI installation.

What browsers do you use to access the UI?

  • Google Chrome
  • Mozilla Firefox

Other Information

Related Code Locations

  • src/utils/executionUtil.ts - recursiveAddNodes() function (line 28-44)
  • src/components/graph/selectionToolbox/ExecuteButton.vue - UI component
  • src/composables/useCoreCommands.ts - Comfy.QueueSelectedOutputNodes command

The issue stems from the partial execution system not properly handling the hierarchical node ID structure used in subgraphs.

Root Cause Analysis

The issue appears to be in the function in . When executing from within a subgraph, the function tries to traverse node inputs but encounters undefined nodes because the node IDs in the subgraph context don't match those in the root graph's output object.

The partial execution system currently assumes all nodes are in the root graph context, but when inside a subgraph, nodes have different execution IDs that follow a hierarchical format (e.g., "parentId:subgraphId:nodeId").

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Labels

area:subgraphin progressIssue is currently being worked on by the teamverified bugSomething isn't working (confirmed by the team)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions