Skip to content

feat: event-sourced workflow previews plus subgraph progress#598

Merged
sroussey merged 10 commits into
mainfrom
feat/task-complete-event
Jun 24, 2026
Merged

feat: event-sourced workflow previews plus subgraph progress#598
sroussey merged 10 commits into
mainfrom
feat/task-complete-event

Conversation

@sroussey

Copy link
Copy Markdown
Collaborator

No description provided.

sroussey added 8 commits June 23, 2026 13:29
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.
@sroussey sroussey self-assigned this Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 62.5% 25252 / 40403
🔵 Statements 62.35% 26135 / 41916
🔵 Functions 63.77% 4802 / 7530
🔵 Branches 51.16% 12349 / 24135
File CoverageNo changed files found.
Generated in workflow #2613 for commit f98dba0 by the Vitest Coverage Report Action

sroussey added 2 commits June 24, 2026 04:27
## @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
@sroussey sroussey merged commit 07b3923 into main Jun 24, 2026
14 checks passed
@sroussey sroussey deleted the feat/task-complete-event branch June 24, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant