Undocumented
| Class | |
Actions taken if a workflow terminates with running handlers. |
| Class | |
Decorated workflow update functions implement this. |
| Exception | |
The workflow exited before all signal handlers had finished executing. |
| Exception | |
The workflow exited before all update handlers had finished executing. |
| Function | query |
Decorator for a workflow query method. |
| Function | signal |
Decorator for a workflow signal method. |
| Function | update |
Decorator for a workflow update handler method. |
Decorator for a workflow query method.
This is used on any non-async method that expects to handle a query. If a function overrides one with this decorator, it too must be decorated.
Query methods can only have positional parameters. Best practice for non-dynamic query methods is to only take a single object/dataclass argument that can accept more fields later if needed. The return value is the resulting query value. Query methods must not mutate any workflow state.
| Parameters | |
fn:CallableType | None | The function to decorate. |
name:str | None | Query name. Defaults to method __name__. Cannot be present when dynamic is present. |
dynamic:bool | None | If true, this handles all queries not otherwise handled. The parameters of the method should be self, a string name, and a Sequence[RawValue]. An older form of this accepted vararg parameters which will now warn. Cannot be present when name is present. |
description:str | None | A short description of the query that may appear in the UI/CLI. |
CallableSyncOrAsyncReturnNoneType) -> CallableSyncOrAsyncReturnNoneType:HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]:str, unfinished_policy: HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]:Literal[ True], unfinished_policy: HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]:Decorator for a workflow signal method.
This is used on any async or non-async method that you wish to be called upon receiving a signal. If a function overrides one with this decorator, it too must be decorated.
Signal methods can only have positional parameters. Best practice for non-dynamic signal methods is to only take a single object/dataclass argument that can accept more fields later if needed. Return values from signal methods are ignored.
| Parameters | |
fn:CallableSyncOrAsyncReturnNoneType | None | The function to decorate. |
name:str | None | Signal name. Defaults to method __name__. Cannot be present when dynamic is present. |
dynamic:bool | None | If true, this handles all signals not otherwise handled. The parameters of the method must be self, a string name, and a *args positional varargs. Cannot be present when name is present. |
unfinishedHandlerUnfinishedPolicy | Actions taken if a workflow terminates with a running instance of this handler. |
description:str | None | A short description of the signal that may appear in the UI/CLI. |
| Returns | |
Callable[ | Undocumented |
Callable[ MultiParamSpec, Awaitable[ ReturnType]]) -> UpdateMethodMultiParam[ MultiParamSpec, ReturnType]:Callable[ MultiParamSpec, ReturnType]) -> UpdateMethodMultiParam[ MultiParamSpec, ReturnType]:HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]:str, unfinished_policy: HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]:Literal[ True], unfinished_policy: HandlerUnfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON, description: str | None = None) -> Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]:Decorator for a workflow update handler method.
This is used on any async or non-async method that you wish to be called upon receiving an update. If a function overrides one with this decorator, it too must be decorated.
You may also optionally define a validator method that will be called before this handler you have applied this decorator to. You can specify the validator with @update_handler_function_name.validator.
Update methods can only have positional parameters. Best practice for non-dynamic update methods is to only take a single object/dataclass argument that can accept more fields later if needed. The handler may return a serializable value which will be sent back to the caller of the update.
| Parameters | |
fn:CallableSyncOrAsyncType | None | The function to decorate. |
name:str | None | Update name. Defaults to method __name__. Cannot be present when dynamic is present. |
dynamic:bool | None | If true, this handles all updates not otherwise handled. The parameters of the method must be self, a string name, and a *args positional varargs. Cannot be present when name is present. |
unfinishedHandlerUnfinishedPolicy | Actions taken if a workflow terminates with a running instance of this handler. |
description:str | None | A short description of the update that may appear in the UI/CLI. |
| Returns | |
UpdateMethodMultiParam[ | Undocumented |