ComfyUI/comfy_execution
Glary-Bot 2205341279 Include workflow_id in all execution WebSocket messages
The frontend already stores extra_data['extra_pnginfo']['workflow']['id']
when queueing a prompt and exposes it via the /api/jobs REST endpoint, but
none of the WebSocket events emitted during execution carry it. That makes
it impossible to scope progress state by workflow on the client without
maintaining a job_id -> workflow_id mapping that races with execution_start.

This adds workflow_id alongside prompt_id on every execution event:

- execution_start, execution_success, execution_error, execution_interrupted,
  execution_cached, executing, executed
- progress and progress_state
- the metadata block on PREVIEW_IMAGE_WITH_METADATA

A new public extract_workflow_id helper in comfy_execution/jobs.py is the
single source of truth for the lookup; the existing _extract_job_metadata
delegates to it. The id is plumbed through PromptExecutor (stored as
self.workflow_id and on server.last_workflow_id), the module-level
execute() coroutine, the _send_cached_ui helper, and ProgressRegistry /
reset_progress_state so WebUIProgressHandler can include it in
progress_state and preview-image metadata. The progress hook in main.py
reads server.last_workflow_id to populate the legacy 'progress' event.

Tests cover the helper's edge cases (missing/non-string ids, non-dict
levels) and that the WebUIProgressHandler emits workflow_id on every
progress_state payload via mocked PromptServer.
2026-05-02 02:29:55 +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 Include workflow_id in all execution WebSocket messages 2026-05-02 02:29:55 +00:00
progress.py Include workflow_id in all execution WebSocket messages 2026-05-02 02:29:55 +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