6969class SerializationContext (ABC ):
7070 """Base serialization context.
7171
72- This provides contextual information during serialization and deserialization
73- operations. Different contexts (activity, workflow, etc.) can provide
74- specialized information.
72+ Provides contextual information during serialization and deserialization operations.
73+
74+ Examples:
75+
76+ - In client code, when starting a workflow, or sending a signal/update/query to a workflow, or
77+ receiving the result of an update/query, or handling an exception from a workflow, the context
78+ type is :py:class:`WorkflowSerializationContext` and the workflow ID set of the target
79+ workflow will be set in the context.
80+
81+ - In workflow code, when operating on a payload being sent/received to/from a child workflow, or
82+ handling an exception from a child workflow, the context type is
83+ :py:class:`WorkflowSerializationContext` and the workflow ID is that of the child workflow,
84+ not of the currently executing (i.e. parent) workflow.
85+
86+ - In workflow code, when operating on a payload to be sent/received to/from an activity, the
87+ context type is :py:class:`ActivitySerializationContext` and the workflow ID is that of the
88+ currently-executing workflow. ActivitySerializationContext is also set on operations
89+
7590 """
7691
7792 pass
@@ -81,13 +96,14 @@ class SerializationContext(ABC):
8196class WorkflowSerializationContext (SerializationContext ):
8297 """Serialization context for workflows.
8398
84- Matches .NET SDK's ISerializationContext.Workflow .
99+ See :py:class:`SerializationContext` for more details .
85100
86101 Attributes:
87102 namespace: The namespace the workflow is running in.
88- workflow_id: The workflow ID. Note, when creating/describing schedules,
89- this may be the workflow ID prefix as configured, not the final
90- workflow ID when the workflow is created by the schedule.
103+ workflow_id: The ID of the workflow. Note that this is the ID of the workflow of which the
104+ payload being operated on is an input or output. Note also that when creating/describing
105+ schedules, this may be the workflow ID prefix as configured, not the final workflow ID
106+ when the workflow is created by the schedule.
91107 """
92108
93109 namespace : str
@@ -98,7 +114,7 @@ class WorkflowSerializationContext(SerializationContext):
98114class ActivitySerializationContext (SerializationContext ):
99115 """Serialization context for activities.
100116
101- Matches .NET SDK's ISerializationContext.Activity .
117+ See :py:class:`SerializationContext` for more details .
102118
103119 Attributes:
104120 namespace: Workflow/activity namespace.
0 commit comments