Interface SerializationContext
- All Known Subinterfaces:
HasWorkflowSerializationContext
- All Known Implementing Classes:
ActivitySerializationContext,WorkflowSerializationContext
SerializationContext during data serialization to
identify the context of this serialization. This context is composed in a way to guarantee that a
user object, and it's corresponded Payload will always be handled by the serialization and data
conversion process with the same exact context.
SerializationContext scope is defined by a Serialization Target. Serialization Target
is the lowest actor in the call tree that the serializing / deserializing object or Payload belongs to. For example:
- Workflow Input and Output parameters will always get
WorkflowSerializationContextidentifying the workflow both on theWorkflowClientand Workflow Worker sides. - Side Effect output parameters are contextualized with
WorkflowSerializationContextof the workflow this side effect belongs to. - Activity Input and Output parameters will always get
ActivitySerializationContextidentifying the activity and it's workflow on both Workflow Method and Activity Worker sides. - Child Workflow Input and Output parameters will always get
WorkflowSerializationContextidentifying the child workflow on both Parent Workflow and the Child Workflow sides.
Temporal SDK provides SerializationContext to Data Serialization process through
calling withContext on DataConverter.withContext(SerializationContext), PayloadCodec.withContext(SerializationContext), and PayloadConverter.withContext(SerializationContext) and using the modified instance when
applicable.
Nexus operations inside a workflow do NOT have a WorkflowSerializationContext because
it is not available in the operation handler.
Note: Serialization Context is experimental feature, the class and field structure of SerializationContext objects may change in the future. There may be also situation where the
context is expected, but is not currently provided.