Skip to content

docs: add subgraph developer guide#751

Closed
christian-byrne wants to merge 1 commit intomainfrom
subgraph-docs-2
Closed

docs: add subgraph developer guide#751
christian-byrne wants to merge 1 commit intomainfrom
subgraph-docs-2

Conversation

@christian-byrne
Copy link
Contributor

Summary

Add a comprehensive developer guide for working with subgraphs programmatically in ComfyUI extensions, plus a companion backend guide for Python node authors.

Changes

  • custom-nodes/js/subgraphs.mdx — Primary developer guide covering:
    • Node ID types (local, locator, execution) and when to use each
    • Recursive graph traversal patterns
    • Subgraph event system (CustomEventTarget events table)
    • Widget promotion lifecycle
    • AbortController-based cleanup patterns
    • Known limitations with issue links
  • custom-nodes/backend/subgraphs.mdx — Backend guide on UNIQUE_ID behavior inside subgraphs and execution flattening
  • docs.json — Navigation entries for both pages
  • custom-nodes/backend/expansion.mdx — Related links section
  • interface/features/subgraph.mdx — Cross-link Tip to the developer guide

Review Focus

  • Accuracy of the three node ID types table (local, locator, execution)
  • Whether code snippets match current internal APIs
  • Navigation placement in docs.json (backend: after expansion, JS: after context-menu-migration)

Fixes #724

- Add custom-nodes/js/subgraphs.mdx — primary developer guide covering
  node ID types, recursive traversal, subgraph events, widget promotion,
  cleanup patterns (AbortController), and known limitations
- Add custom-nodes/backend/subgraphs.mdx — backend guide for UNIQUE_ID
  behavior inside subgraphs
- Update docs.json navigation for both pages
- Add cross-links from expansion.mdx and subgraph.mdx

Fixes #724

Amp-Thread-ID: https://ampcode.com/threads/T-019c3604-fb97-775b-baea-5ecf94822c8e
@christian-byrne christian-byrne added the documentation Improvements or additions to documentation label Feb 7, 2026
@christian-byrne christian-byrne self-assigned this Feb 7, 2026
christian-byrne added a commit that referenced this pull request Feb 7, 2026
Rewrite custom-nodes/js/subgraphs.mdx to be actionable and snippet-focused:
- Remove all internal module imports (@/utils/*, @/types/*, @/core/*)
- Add copy-paste walkGraph helper for recursive traversal
- Use plain JS with import { app } style matching other JS docs
- Add complete working examples for events, cleanup, widget promotion
- Add known limitations section

Incorporate best parts from PR #751:
- Add custom-nodes/backend/subgraphs.mdx (UNIQUE_ID in subgraphs)
- Add cross-links on expansion.mdx and subgraph.mdx
- Add backend nav entries in docs.json (EN + zh-CN)
- Move JS subgraphs before javascript_examples in nav

Closes #724

Amp-Thread-ID: https://ampcode.com/threads/T-019c3603-c29b-70c4-b6a1-9c2dd385475f
@christian-byrne
Copy link
Contributor Author

Consolidated into #750 which includes the best content from both PRs: snippet-focused JS guide (no internal imports), backend Python subgraphs page, cross-links, and zh-CN stubs.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing documentation for devs dealing with subgraphs.

1 participant