UI async workflow runs + output streaming - #1062
Merged
Merged
Conversation
POST /start_workflow starts the run and returns a token; the run button
polls GET /workflow_status/{token} every 500ms until done, then shows the
output. run() is unchanged; start()/poll() wrap it with a single job slot
(busy while a run is in progress, not_found for unknown tokens). Poll time
is logged server-side.
Move the run token out of RunWorkflowButton into a shared useWorkflowRunStore keyed by workflow name, so every button for a workflow reflects the same run: all disable and show a spinner while it runs, and completion/errors reach each one. Polling moves to a WorkflowRunPoller mounted once in App, which owns the useEffect loop and the run snackbars, so a run survives a button unmounting. The button now only starts the run and reads the store.
Server: PipeTee.snapshot() reads the buffer without waiting for the end; poll() returns partial output while running, final text when done. Flatten the runner's single-run state (token/status/output/error/tee) instead of a _job dict, with a str-based RunStatus enum. Client: store setRunOutput; poller writes output on every running poll; the output dialog shows the growing log with a "Running…" hint. Tests: partial output mid-run (server), poller updates while running, dialog partial/final/error states.
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.