* fix(workflows): resolve GetInput serializer options per host
Remove the process-wide JsonSerializerOptions cache from ExpressionExecutionContextExtensions so DI converters registered on a later host remain visible after the first GetInput. Share CloneForValueConversion with WorkflowInstanceStorageDriver reads.
Closes#8131
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* fix(workflows): match storage write/read JSON reference semantics
Use the same cloned payload-serializer options for WorkflowInstanceStorageDriver Write and Read. Forcing ReferenceHandler.Preserve on read only treated ordinary $ref properties as metadata and broke restore.
Closes the P1 on #8158.
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* fix(workflows): serialize storage values by runtime type
SerializeToNode(object, options) used the compile-time object converter, so PolymorphicObjectConverter wrapped arrays as _items metadata. Write now uses the runtime type with the same cloned host options as Read.
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* test(workflows): assert stored array conversion is non-null
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* fix(workflows): restore _type for object-typed storage values
Serialize object-typed variables through the polymorphic converter so aliased CLR types keep a _type discriminator. Typed arrays still serialize by runtime type so they stay JSON arrays.
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* fix(workflows): deserialize object variables through polymorphic options
ConvertTo(object) returns the stored JsonObject because it is assignable to object. Read object-typed variables with the payload serializer so _type restores the concrete CLR type.
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>