in azure/durable_functions/models/DurableOrchestrationContext.py [0:0]
def call_sub_orchestrator_with_retry(self,
name: Union[str, Callable], retry_options: RetryOptions,
input_: Optional[Any] = None,
instance_id: Optional[str] = None) -> TaskBase:
"""Schedule sub-orchestration function named `name` for execution, with retry-options.
Parameters
----------
name: Union[str, Callable]
The name of the activity function to schedule.
retry_options: RetryOptions
The settings for retrying this sub-orchestrator in case of a failure.
input_: Optional[Any]
The JSON-serializable input to pass to the activity function. Defaults to None.
instance_id: str
The instance ID of the sub-orchestrator to call.
Returns
-------
Task
A Durable Task that completes when the called sub-orchestrator completes or fails.
"""
if isinstance(name, Callable) and not isinstance(name, FunctionBuilder):
error_message = "The `call_activity` API received a `Callable` without an "\
"associated Azure Functions trigger-type. "\
"Please ensure you're using the Python programming model V2 "\
"and that your activity function is annotated with the `activity_trigger`"\
"decorator. Otherwise, provide in the name of the activity as a string."
raise ValueError(error_message)
if isinstance(name, FunctionBuilder):
name = self._get_function_name(name, OrchestrationTrigger)
action = CallSubOrchestratorWithRetryAction(name, retry_options, input_, instance_id)
task = self._generate_task(action, retry_options)
return task