Skip to content
Discussion options

You must be logged in to vote

Hi @pjirsa,

The to_json() and from_json() methods on Workflow are not designed as a public serialization API for workflow persistence.

Why it fails:

to_json() serializes the workflow's structural definition (executors, edges, start node) for observability/tracing purposes. The from_json() is inherited from DictConvertible which does a naive cls(**data), but Workflow.__init__ requires live Python objects (Executor, RunnerContext) that cannot be round-tripped through JSON.

Alternatives:

  1. Workflow state persistence: use the checkpointing API:
    workflow = WorkflowBuilder().with_checkpointing(storage).build()
  2. Declarative definitions from config (coming soon - in PR): we will soon have support …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pjirsa
Comment options

Answer selected by pjirsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
python workflows Related to Workflows in agent-framework
2 participants