Best practices for Flow state initialization with required fields #3688
visalvo
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Following up on #3744, I'd like to start a discussion about the design patterns and best practices for initializing Flow state with Pydantic models, particularly when dealing with required fields.
The Challenge
Currently, there's a tension between type safety and Flow initialization. When using Pydantic models with required fields as Flow state, developers face validation errors unless all fields are optional or have defaults.
Questions for the Community
__init__time or atkickoff()time?Related Work
A PR (#3743) has been submitted to address the immediate technical issue, but I think there's value in discussing the broader design implications before finalizing the approach.
Goal
Let's align on the recommended patterns for Flow state management, in order to provide clear guidance in documentation and ensure the API supports common use cases elegantly.
What are your thoughts and experiences with Flow state initialization?
Beta Was this translation helpful? Give feedback.
All reactions