feat: Add workflow session persistence and loop step support #542
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.
Summary
This PR introduces two major enhancements to the workflow automation system:
Changes
Session Persistence (
feat: Add session persistence to workflow engine)load_from_session()andresume_from_session()methods~/.mcp/workflows/sessions/directoryLoop Step and Workflow Operations (
wip: Refactor workflow operations)tasks[0].items)Benefits
Session Persistence:
Loop Step:
Testing
Files Changed
Core Changes
plugins/automation/workflows/engine.py(+261 lines): Session persistence implementationplugins/automation/workflows/steps/loop.py(+252 lines): New loop stepplugins/automation/runtime_data/state.py(+47 lines): Array indexing supportNew Features
plugins/automation/workflows/steps/operations/decompose.py(+253 lines): New decompose operationplugins/automation/workflows/steps/operations/schemas.py(+235 lines): Operation schemasplugins/automation/workflows/examples/demo_ai_research.py(+259 lines): Interactive demoTests
plugins/automation/tests/test_loop_step.py(+307 lines): Loop step testsplugins/automation/tests/test_runtime_data.py(+73 lines): Context testsplugins/automation/tests/test_workflow_definition.py(+61 lines): Definition testsCleanup
Migration Notes
No breaking changes for existing workflows. Session persistence is opt-in via the
persistparameter.Demo
To see session persistence in action:
This will show:
🤖 Generated with Claude Code