@@ -1316,7 +1316,7 @@ async def query(self, query_name: str, args: list[Any] | None = None) -> Any:
13161316 return await self ._client .query_workflow (self .workflow_id , query_name , args = args )
13171317
13181318 async def cancel (self , * , reason : str | None = None ) -> None :
1319- """Request graceful cancellation of this workflow . See :meth:`Client.cancel_workflow`."""
1319+ """Close this workflow's current run as cancelled . See :meth:`Client.cancel_workflow`."""
13201320 await self ._client .cancel_workflow (self .workflow_id , reason = reason )
13211321
13221322 async def terminate (self , * , reason : str | None = None ) -> None :
@@ -4114,22 +4114,25 @@ async def query_workflow(
41144114 )
41154115
41164116 async def cancel_workflow (self , workflow_id : str , * , reason : str | None = None ) -> None :
4117- """Request graceful cancellation of a workflow's current run .
4117+ """Close the current run as cancelled immediately .
41184118
4119- Cancellation is cooperative: the server delivers a cancellation signal
4120- that the workflow can observe and handle (e.g. to roll back via a
4121- saga). Compare with :meth:`terminate_workflow`, which is forceful.
4119+ Server cancels open tasks and timers; it does not resume workflow code
4120+ to run saga or ``finally`` cleanup. :meth:`terminate_workflow` also
4121+ closes immediately, with a distinct terminal outcome. Embedded
4122+ Laravel's cooperative ``requestCancellation()`` is not yet available
4123+ through this service-mode API.
41224124 """
41234125 body : dict [str , Any ] = {}
41244126 if reason is not None :
41254127 body ["reason" ] = reason
41264128 await self ._request ("POST" , f"/workflows/{ workflow_id } /cancel" , json = body , context = workflow_id )
41274129
41284130 async def terminate_workflow (self , workflow_id : str , * , reason : str | None = None ) -> None :
4129- """Forcefully stop a workflow without giving it a chance to clean up .
4131+ """Close the current run as terminated immediately .
41304132
4131- Prefer :meth:`cancel_workflow` when the workflow code can implement
4132- graceful shutdown. Termination is an operator escape hatch.
4133+ Like :meth:`cancel_workflow`, this does not resume workflow code for
4134+ cleanup. Use the distinct terminal outcome when termination is the
4135+ appropriate operator action.
41334136 """
41344137 body : dict [str , Any ] = {}
41354138 if reason is not None :
0 commit comments