|
9 | 9 | from datetime import timedelta
|
10 | 10 | from typing import (
|
11 | 11 | Any,
|
| 12 | + Awaitable, |
12 | 13 | Callable,
|
13 | 14 | Mapping,
|
14 | 15 | MutableMapping,
|
15 | 16 | Optional,
|
16 | 17 | Sequence,
|
| 18 | + Type, |
17 | 19 | Union,
|
| 20 | + overload, |
18 | 21 | )
|
19 | 22 |
|
20 | 23 | import nexusrpc.handler
|
@@ -194,6 +197,7 @@ def from_start_operation_context(
|
194 | 197 |
|
195 | 198 | # Overload for single-param workflow
|
196 | 199 | # TODO(nexus-prerelease)*: bring over other overloads
|
| 200 | + @overload |
197 | 201 | async def start_workflow(
|
198 | 202 | self,
|
199 | 203 | workflow: MethodAsyncSingleParam[SelfType, ParamType, ReturnType],
|
@@ -225,6 +229,41 @@ async def start_workflow(
|
225 | 229 | request_eager_start: bool = False,
|
226 | 230 | priority: temporalio.common.Priority = temporalio.common.Priority.default,
|
227 | 231 | versioning_override: Optional[temporalio.common.VersioningOverride] = None,
|
| 232 | + ) -> WorkflowHandle[ReturnType]: ... |
| 233 | + |
| 234 | + async def start_workflow( |
| 235 | + self, |
| 236 | + workflow: Union[str, Callable[..., Awaitable[ReturnType]]], |
| 237 | + arg: Any = temporalio.common._arg_unset, |
| 238 | + *, |
| 239 | + args: Sequence[Any] = [], |
| 240 | + id: str, |
| 241 | + task_queue: Optional[str] = None, |
| 242 | + result_type: Optional[Type] = None, |
| 243 | + execution_timeout: Optional[timedelta] = None, |
| 244 | + run_timeout: Optional[timedelta] = None, |
| 245 | + task_timeout: Optional[timedelta] = None, |
| 246 | + id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, |
| 247 | + id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy = temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, |
| 248 | + retry_policy: Optional[temporalio.common.RetryPolicy] = None, |
| 249 | + cron_schedule: str = "", |
| 250 | + memo: Optional[Mapping[str, Any]] = None, |
| 251 | + search_attributes: Optional[ |
| 252 | + Union[ |
| 253 | + temporalio.common.TypedSearchAttributes, |
| 254 | + temporalio.common.SearchAttributes, |
| 255 | + ] |
| 256 | + ] = None, |
| 257 | + static_summary: Optional[str] = None, |
| 258 | + static_details: Optional[str] = None, |
| 259 | + start_delay: Optional[timedelta] = None, |
| 260 | + start_signal: Optional[str] = None, |
| 261 | + start_signal_args: Sequence[Any] = [], |
| 262 | + rpc_metadata: Mapping[str, str] = {}, |
| 263 | + rpc_timeout: Optional[timedelta] = None, |
| 264 | + request_eager_start: bool = False, |
| 265 | + priority: temporalio.common.Priority = temporalio.common.Priority.default, |
| 266 | + versioning_override: Optional[temporalio.common.VersioningOverride] = None, |
228 | 267 | ) -> WorkflowHandle[ReturnType]:
|
229 | 268 | """Start a workflow that will deliver the result of the Nexus operation.
|
230 | 269 |
|
@@ -266,8 +305,10 @@ async def start_workflow(
|
266 | 305 | wf_handle = await self.temporal_context.client.start_workflow( # type: ignore
|
267 | 306 | workflow=workflow,
|
268 | 307 | arg=arg,
|
| 308 | + args=args, |
269 | 309 | id=id,
|
270 | 310 | task_queue=task_queue or self.temporal_context.info().task_queue,
|
| 311 | + result_type=result_type, |
271 | 312 | execution_timeout=execution_timeout,
|
272 | 313 | run_timeout=run_timeout,
|
273 | 314 | task_timeout=task_timeout,
|
|
0 commit comments