Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hello_nexus/handler/service_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def my_workflow_run_operation(
return await ctx.start_workflow(
WorkflowStartedByNexusOperation.run,
input,
id=str(uuid.uuid4()),
id=f"hello-nexus-workflow-{input.name}-{uuid.uuid4()}",
)

# This is a Nexus operation that responds synchronously to all requests. That means
Expand Down
9 changes: 6 additions & 3 deletions nexus_cancel/handler/service_handler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""
Nexus service handler for the cancellation sample.

The hello operation is backed by a workflow, using the Nexus request ID as the
workflow ID for idempotency across retries.
The hello operation is backed by a workflow whose ID is derived from the
operation input (name + language), giving each fan-out branch a distinct,
meaningful business ID.
"""

from __future__ import annotations

import uuid

import nexusrpc
from temporalio import nexus

Expand All @@ -23,5 +26,5 @@ async def hello(
return await ctx.start_workflow(
HelloHandlerWorkflow.run,
input,
id=ctx.request_id,
id=f"hello-handler-{input.name}-{input.language.name}-{uuid.uuid4()}",
)
2 changes: 1 addition & 1 deletion nexus_multiple_args/handler/service_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def hello(
input.name, # First argument: name
input.language, # Second argument: language
],
id=str(uuid.uuid4()),
id=f"hello-multi-args-{input.name}-{input.language}-{uuid.uuid4()}",
)


Expand Down
Loading