Skip to content

Nexus samples: use business IDs for workflow IDs#137

Open
VegetarianOrc wants to merge 2 commits intomainfrom
amazzeo/nexus-wf-id
Open

Nexus samples: use business IDs for workflow IDs#137
VegetarianOrc wants to merge 2 commits intomainfrom
amazzeo/nexus-wf-id

Conversation

@VegetarianOrc
Copy link
Copy Markdown

What was changed

Stop using the Nexus request ID as the backing workflow ID. Build a meaningful business ID from the operation input.

Why?

Our samples should reflect best practices around creating meaningful IDs. Part of temporalio/features#692.

@VegetarianOrc VegetarianOrc requested a review from a team as a code owner April 28, 2026 01:16
@VegetarianOrc VegetarianOrc marked this pull request as draft April 28, 2026 01:17
@VegetarianOrc VegetarianOrc marked this pull request as ready for review April 28, 2026 01:23
new() { Id = GetHelloWorkflowId(input) }));

private static string GetHelloWorkflowId(IHelloService.HelloInput input) =>
$"hello-{input.Language}-{input.Name.Trim().Replace(' ', '-')}";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other examples, e.g. temporalio/samples-go#460, aren't going through the Name.Trim().Replace(...) jazz.

Are spaces allowed in Workflow IDs? If they are, then maybe that would just be overkill for the sample, if that type of sanitization isn't required? (Or if it is, maybe it should be added to the other examples?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants