ComfyUI/comfy_execution
Cursor Agent 7578d1989f
Add workflow_id to all websocket messages
This commit addresses BE-672 by ensuring all execution-related websocket
messages include the workflow_id field when available.

Changes:
- Added extract_workflow_id() helper function in comfy_execution/jobs.py
  to extract workflow_id from extra_data
- Updated execution.py to include workflow_id in all websocket messages:
  - execution_start
  - execution_cached
  - execution_success
  - execution_error
  - execution_interrupted
  - executing
  - executed (including cached UI)
- Updated main.py to include workflow_id in:
  - progress messages (via hijack_progress hook)
  - final executing message (node=None)
- Updated comfy_execution/progress.py to include workflow_id in:
  - progress_state messages
  - preview image metadata

The workflow_id is extracted from extra_data['extra_pnginfo']['workflow']['id']
and is conditionally included in messages only when present, maintaining
backward compatibility with workflows that don't have this field.

Fixes: BE-672

Co-authored-by: Luke Mino-Altherr <luke-mino-altherr@users.noreply.github.com>
2026-05-01 00:35:43 +00:00
..
cache_provider.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
caching.py dynamicVRAM + --cache-ram 2 (CORE-117) (#13603) 2026-04-28 19:15:02 -04:00
graph_utils.py V3 Node Schema Definition - initial (#8656) 2025-07-31 18:02:12 -04:00
graph.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
jobs.py Add workflow_id to all websocket messages 2026-05-01 00:35:43 +00:00
progress.py Add workflow_id to all websocket messages 2026-05-01 00:35:43 +00:00
utils.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
validation.py V3 Improvements + DynamicCombo + Autogrow exposed in public API (#11345) 2025-12-30 23:09:55 -05:00