@@ -27,6 +27,8 @@ class DurableOrchestrationContext:
2727 def __init__ (self , ctx : OrchestrationContext , orchestration_input : Any = None ):
2828 self ._ctx = ctx
2929 self ._input = orchestration_input
30+ self ._custom_status : Any = None
31+ self ._will_continue_as_new = False
3032
3133 # -- input ---------------------------------------------------------------
3234 def get_input (self ) -> Any :
@@ -49,6 +51,47 @@ def current_utc_datetime(self) -> datetime:
4951 """Get the replay-safe current UTC date/time."""
5052 return self ._ctx .current_utc_datetime
5153
54+ @property
55+ def custom_status (self ) -> Any :
56+ """Get the custom status set during this execution (or ``None``)."""
57+ return self ._custom_status
58+
59+ @property
60+ def will_continue_as_new (self ) -> bool :
61+ """Whether :meth:`continue_as_new` has been called in this execution."""
62+ return self ._will_continue_as_new
63+
64+ @property
65+ def parent_instance_id (self ) -> str :
66+ """Get the ID of the parent orchestration.
67+
68+ Not available: durabletask does not currently surface the parent
69+ instance ID on the orchestration context.
70+ """
71+ raise NotImplementedError (
72+ "parent_instance_id is not currently exposed by durabletask." )
73+
74+ @property
75+ def function_context (self ) -> Any :
76+ """Get the Azure Functions-level context.
77+
78+ Not available: durabletask does not provide the v1 ``FunctionContext``
79+ binding metadata.
80+ """
81+ raise NotImplementedError (
82+ "function_context is not available in this SDK." )
83+
84+ @property
85+ def histories (self ) -> Any :
86+ """Get the running history of scheduled tasks.
87+
88+ Not available: durabletask manages orchestration history internally and
89+ does not expose it on the context.
90+ """
91+ raise NotImplementedError (
92+ "histories is not exposed by durabletask; use the client's "
93+ "get_orchestration_history instead." )
94+
5295 # -- activities ----------------------------------------------------------
5396 def call_activity (self , name : Callable [..., Any ] | str , input_ : Any = None ) -> Task [Any ]:
5497 """Schedule an activity function for execution."""
@@ -92,10 +135,12 @@ def wait_for_external_event(self,
92135 # -- control -------------------------------------------------------------
93136 def continue_as_new (self , input_ : Any ) -> None :
94137 """Restart the orchestration with a new input."""
138+ self ._will_continue_as_new = True
95139 self ._ctx .continue_as_new (input_ )
96140
97141 def set_custom_status (self , status : Any ) -> None :
98142 """Set the orchestration's custom status payload."""
143+ self ._custom_status = status
99144 self ._ctx .set_custom_status (status )
100145
101146 # -- deterministic IDs ---------------------------------------------------
0 commit comments