Commit 646b0f2
feat(workflow-api): make Job.result the default GET-status source with session_id
Flip the v2 workflow GET-status construction so the durable Job.result blob
is the primary output source and vertex_build reconstruction is the fallback.
Echo session_id (from job_metadata request, falling back to flow id) on the
response so completed background runs return the same shape as sync.
Populate Job.result for AG-UI runs via protocol-neutral off-wire capture: a
synthesized WORKFLOW_OUTPUT_CAPTURE_EVENT frame built from the raw end_vertex
before adapter.translate, captured in-memory only (never appended or published,
so it cannot leak to /events). This makes AG-UI runs carry full outputs even
though the wire protocol emits no output event.
Add LANGFLOW_JOB_EVENTS_STORAGE_ENABLED to gate job_events persistence. When
off, the runner uses a local seq fallback so live subscribers still work while
per-milestone DB writes and reattach/replay are skipped; Job.result and
GET-status output are unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(workflow-api): preserve pre-pause HITL outputs; drop job-events storage flag
A background run that produced a terminal output on one branch, then paused
for human input on another, lost that output: the resumed pass starts a fresh
capture list and the output loop skips re-emitting checkpoint-restored
vertices, so finalize only had the resumed pass's captures.
Fix: PauseRequested carries the pre-pause output_events out of _drive; _suspend
stashes them (deduped) in job_metadata.pre_pause_outputs; a resumed _drive
pre-seeds its capture list from that stash; set_result dedups by component_id
(first position, latest value) so a re-emitted vertex overwrites its stale
entry and branch order is preserved.
Also remove the job_events_storage_enabled setting — the durable event log is
now always persisted (removes the event-storage-off path that dropped live
HITL requests). Drops the field from EXPECTED_FIELDS and the now-impossible
off-mode test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix: harden background workflow result handling
feat(workflow-api): persist sync run outputs to Job.result
A sync run already creates a Job row (to support HITL suspend + run_id-keyed
vertex builds) and reaches COMPLETED, but never wrote Job.result — so a later
GET status on its job_id could not return the outputs the request returned
inline. Persist the terminal outputs in the same list-of-OutputEvent shape the
background runner writes, so the status read is protocol-uniform across sync and
background. Best-effort: the caller already holds the response inline, so a
result-cache write failure is logged and never fails the run.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fixed exception handling upon persistence failure but execution success. now persistence issue won't block users from getting the output if the workflow ran successfully.1 parent f953218 commit 646b0f2
13 files changed
Lines changed: 901 additions & 62 deletions
File tree
- src
- backend
- base/langflow
- api/v2
- services
- background_execution
- jobs
- tests/unit
- api/v2
- background_execution
- services/background_execution
- lfx
- src/lfx/workflow
- adapters
- tests/unit/workflow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| |||
644 | 648 | | |
645 | 649 | | |
646 | 650 | | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
652 | 689 | | |
653 | | - | |
| 690 | + | |
654 | 691 | | |
655 | 692 | | |
656 | 693 | | |
657 | 694 | | |
658 | 695 | | |
659 | 696 | | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
| 697 | + | |
| 698 | + | |
665 | 699 | | |
666 | | - | |
| 700 | + | |
667 | 701 | | |
668 | 702 | | |
| 703 | + | |
669 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
670 | 709 | | |
671 | 710 | | |
672 | 711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
324 | 346 | | |
325 | 347 | | |
326 | 348 | | |
| |||
430 | 452 | | |
431 | 453 | | |
432 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
433 | 482 | | |
434 | 483 | | |
435 | 484 | | |
| |||
554 | 603 | | |
555 | 604 | | |
556 | 605 | | |
557 | | - | |
| 606 | + | |
558 | 607 | | |
559 | 608 | | |
560 | 609 | | |
| |||
563 | 612 | | |
564 | 613 | | |
565 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
566 | 620 | | |
567 | 621 | | |
568 | 622 | | |
| |||
Lines changed: 81 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| |||
232 | 239 | | |
233 | 240 | | |
234 | 241 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
242 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
243 | 265 | | |
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
247 | 269 | | |
248 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
249 | 278 | | |
250 | 279 | | |
251 | 280 | | |
| |||
258 | 287 | | |
259 | 288 | | |
260 | 289 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
264 | 293 | | |
265 | 294 | | |
266 | 295 | | |
| 296 | + | |
| 297 | + | |
267 | 298 | | |
268 | 299 | | |
269 | 300 | | |
| |||
287 | 318 | | |
288 | 319 | | |
289 | 320 | | |
290 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
291 | 357 | | |
292 | 358 | | |
293 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments