feat: event-sourced workflow previews plus subgraph progress#598
Merged
Conversation
GraphAsTaskRunner now forwards the subgraph's task_complete and task_stream_* events to the owning task's parentGraph, so subgraph children surface as individual task events on the top-level stream. Bubbles recursively for nested compound tasks. Enables previews and progress for tasks inside groups.
GraphAsTask.executeStream now forwards inner task_complete / task_stream_* events to parentGraph, mirroring GraphAsTaskRunner. Covers streaming-output groups (which run via executeStream rather than the runner's executeTask path), so their subgraph children also surface on the top-level stream.
Wrap the subgraph run (GraphAsTaskRunner.executeTaskChildren) and the executeStream yield loop in try/finally so the parentGraph event bridges always unsubscribe. Without this, a rejecting/early-terminated subgraph run leaked the bridge subscriptions and double-emitted every inner task event to the parent on a later run.
Add a graph-level task_progress(taskId, progress, message) event emitted by RunScheduler.handleProgress with the task's own (pre-aggregation) progress, and bridge it up through subgraphs alongside task_complete/task_stream_*. Lets consumers track per-task progress including subgraph children.
…) groups Extract bridgeSubGraphTaskEvents() and wire it (with try/finally teardown) into WhileTask (both execute and executeStream) and FallbackTaskRunner's data mode, in addition to GraphAsTask. So inner children of While/Fallback-data groups now surface on the top-level run stream for previews/progress. Iterator/Map (per-iteration clones with fresh ids) and Fallback task-mode (standalone alternative tasks, no graph events) remain unbridged by design.
…ning Guard the per-task task_progress emit to PROCESSING/STREAMING status (terminal handlers set the terminal status before calling handleProgress(100)), so a disabled/failed/aborted task — or a completing one — no longer emits a spurious 100% progress that would paint a bridged subgraph child as 'running'. Wrap the emit in try/catch so a throwing listener can't escape a terminal handler. Tests: mid-run progress bubbles (not the terminal tick); bridge teardown prevents double-emit on re-run after a failed run.
Coverage Report
File CoverageNo changed files found. |
## @workglow/task-graph ### Features #### task-graph - bubble subgraph events for While and Fallback (data) groups - emit and bubble per-task task_progress events - bubble subgraph events from streaming groups too - bubble subgraph task events up to the parent graph - emit graph-level task_complete event per finished task ### Bug Fixes #### task-graph - only emit task_progress while a task is actively running - tear down subgraph event bridges in finally - harden task_complete emit against throwing listeners ## @workglow/test ### Features #### task-graph - bubble subgraph events for While and Fallback (data) groups - emit and bubble per-task task_progress events - bubble subgraph events from streaming groups too - bubble subgraph task events up to the parent graph - emit graph-level task_complete event per finished task ### Bug Fixes #### task-graph - only emit task_progress while a task is actively running - harden task_complete emit against throwing listeners #### huggingface-transformers - resolve server device to undefined instead of "auto" (#597) ### Chores - update deps ### Updated Dependencies - `@aws-sdk/client-sqs`: ^3.1075.0 - `@cloudflare/workers-types`: ^4.20260624.1 - `miniflare`: ^4.20260623.0 ## @workglow/aws ### Chores - update deps ### Updated Dependencies - `@aws-sdk/client-sqs`: ^3.1075.0 ## @workglow/cloudflare ### Chores - update deps ### Updated Dependencies - `@cloudflare/workers-types`: ^4.20260624.1 ## @workglow/huggingface-transformers ### Bug Fixes #### huggingface-transformers - resolve server device to undefined instead of "auto" (#597) ## @workglow/web ### Chores - update deps ### Updated Dependencies - `@vitejs/plugin-react`: ^6.0.3 - `vite`: ^8.1.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.