Open logan-markewich opened 2 days ago
I'm really interested in your idea! I'm currently working on developing an agentic workflow, and I definitely think serialization could make it much more manageable and modular.
Do you have any approaches in mind so far? For example, do you have a preferred format for storing the objects?
Feature Description
We should provide a way for the context to be serializable. This is especially useful for use cases where you need to pause a workflow and resume it later, stepwise execution, etc.
Imagine an async stateless server like next.js. You might want to run your workflows stepwise, and store them in redis between requests. A similar use-case comes up for llama-deploy
To support this, we should serialize everything we can on the context. This means
If something in the globals dict is not serializable (i.e. json.dumps()), then we should try to pickle it. If we can't pickle, we raise an error, and the user can address how they are (ab)using the context.
Reason
Enable more stateless runs of a workflow
Value of Feature
Supporting more serving and deployment options