Python: Support Process State Management
Motivation and Context
SK Python processes have been missing support to be able to serialize and deserialize JSON state for a process and its steps. This PR brings in the functionality to allow the developer to do so. The getting_started_with_processes step03 has been update to reflect this latest functionality. It is possible to dump a JSON state to a file, and reload the state to continue running the process.
State metadata that handles the version for steps is managed via a decorator:
@kernel_process_step_metadata("CutFoodStep.V1")
class CutFoodStep(KernelProcessStep):
class Functions(Enum):
ChopFood = "ChopFood"
SliceFood = "SliceFood"
If no decorator/state is supplied the step will be built with a default state version of "v1" which aligns with .Net.
Description
Support state and versioning management for Python processes.
- Update samples to reflect changes.
- Closes #9584
Contribution Checklist
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone :smile:
Python Unit Test Overview
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 3470 | 5 :zzz: | 0 :x: | 0 :fire: | 1m 37s :stopwatch: |
@moonbox3 Have you had a look at https://github.com/UiPath/CoreWF, which seems like a thorough implementation of the same idea?
@moonbox3 Have you had a look at https://github.com/UiPath/CoreWF, which seems like a thorough implementation of the same idea?
@jsboige thanks for sharing -- CoreWF is interesting, but it serves a very different purpose. It's a Windows Workflow Foundation reimplementation for .NET, more aligned with UiPath's RPA and orchestration model. Semantic Kernel's process framework, on the other hand, is tailored specifically for AI service/agentic LLM orchestration within the SK runtime and SDK, with a strong emphasis on interoperability, function calling that leverage native code plugins, and memory integration. While both frameworks touch on workflow and coordination, they operate in entirely different ecosystems and solve fundamentally different problems.