diff --git a/nexus_messaging/ondemandpattern/README.md b/nexus_messaging/ondemandpattern/README.md index b9ba67ff7..b0c6145a0 100644 --- a/nexus_messaging/ondemandpattern/README.md +++ b/nexus_messaging/ondemandpattern/README.md @@ -6,7 +6,7 @@ operations. `NexusRemoteGreetingService` adds a `run_from_remote` operation that instance to target. The caller Workflow: -1. Starts two remote `GreetingWorkflow` instances via `run_from_remote` (backed by `workflow_run_operation`) +1. Starts two remote `GreetingWorkflow` instances via `run_from_remote` (backed by `temporal_operation`) 2. Queries each for supported languages 3. Changes the language on each (Arabic and Hindi) 4. Confirms the changes via queries diff --git a/nexus_messaging/ondemandpattern/caller/workflows.py b/nexus_messaging/ondemandpattern/caller/workflows.py index 8dbbd4b24..4e1e86bb3 100644 --- a/nexus_messaging/ondemandpattern/caller/workflows.py +++ b/nexus_messaging/ondemandpattern/caller/workflows.py @@ -40,7 +40,7 @@ async def run(self) -> list[str]: # This is an async Nexus operation -- starts a workflow on the handler and # returns a handle. Unlike the sync operations below, this does not block - # until the workflow completes. It is backed by workflow_run_operation on the + # until the workflow completes. It is backed by temporal_operation on the # handler side. handle_one = await self.nexus_client.start_operation( NexusRemoteGreetingService.run_from_remote, diff --git a/nexus_messaging/ondemandpattern/handler/service_handler.py b/nexus_messaging/ondemandpattern/handler/service_handler.py index 6cf12e570..2865b94cf 100644 --- a/nexus_messaging/ondemandpattern/handler/service_handler.py +++ b/nexus_messaging/ondemandpattern/handler/service_handler.py @@ -40,12 +40,15 @@ def _get_workflow_handle( ) # Starts a new GreetingWorkflow with the caller-specified user ID. - # This is an async Nexus operation backed by workflow_run_operation. - @nexus.workflow_run_operation + # This is an async Nexus operation backed by temporal_operation. + @nexus.temporal_operation async def run_from_remote( - self, ctx: nexus.WorkflowRunOperationContext, input: RunFromRemoteInput - ) -> nexus.WorkflowHandle[str]: - return await ctx.start_workflow( + self, + _ctx: nexus.TemporalStartOperationContext, + client: nexus.TemporalNexusClient, + input: RunFromRemoteInput, + ) -> nexus.TemporalOperationResult[str]: + return await client.start_workflow( GreetingWorkflow.run, id=self._get_workflow_id(input.user_id), )