Commit 2014ebf
committed
fix(engine): preserve for_each pause metadata and resume iterations
Ensure for_each pause metadata is serialized/deserialized and implement resume behavior for paused for_each iterations.
Key changes:
- Persist pause metadata: include ExecutionState.pause_metadata in execution serialization so for_each checkpoints survive save/load.
- Resume flow: add BlockOrchestrator.resume_for_each(...) to resume a paused iteration, evaluate the user's response, run the appropriate executor for the resumed iteration, and stitch results back into the parent iteration state. WorkflowRunner now detects for_each_iteration checkpoints and delegates to the orchestrator.
- Jinja/runtime helpers: add BlockProxy.__len__ to support len() and Jinja length filters against block/for_each data.
- LLM schema handling: add LLMCallExecutor._prepare_schema_for_openai to prune/strictify JSON schemas for OpenAI response_format compatibility.
- Tests and fixtures: add unit tests and integration tests (including YAML workflows and snapshots) covering pause/resume, serialization, and Jinja syntax cases.
This resolves a bug where pause metadata could be lost across execution state serialization and enables correct resume semantics for sequential for_each pauses.1 parent 1996cfc commit 2014ebf
11 files changed
Lines changed: 1264 additions & 93 deletions
File tree
- src/workflows_mcp/engine
- resolver
- tests
- snapshots
- workflows
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
684 | 737 | | |
685 | 738 | | |
686 | 739 | | |
| |||
750 | 803 | | |
751 | 804 | | |
752 | 805 | | |
753 | | - | |
754 | | - | |
755 | | - | |
| 806 | + | |
| 807 | + | |
756 | 808 | | |
757 | 809 | | |
758 | 810 | | |
759 | 811 | | |
760 | 812 | | |
761 | 813 | | |
762 | | - | |
| 814 | + | |
763 | 815 | | |
764 | 816 | | |
765 | 817 | | |
| |||
0 commit comments