fix: allow persist Flow state with BaseModel entries (#3276)

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
This commit is contained in:
Lucas Gomide
2025-08-06 10:04:59 -03:00
committed by GitHub
parent 79b375f6fa
commit 9f1d7d1aa9
2 changed files with 43 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ class SQLiteFlowPersistence(FlowPersistence):
"""
# Convert state_data to dict, handling both Pydantic and dict cases
if isinstance(state_data, BaseModel):
state_dict = dict(state_data) # Use dict() for better type compatibility
state_dict = state_data.model_dump()
elif isinstance(state_data, dict):
state_dict = state_data
else: