Go sdk constant for default-test-workflow-id

My workflow uses the workflow ID as an identifier. I want to create assertions using the workflow ID. Is there an exported constant for the value “default-test-workflow-id”?

Hello @mho

As I understand,… Are you setting the workflow id as part of your workflow instantiation?

Can you share some pseudo-code that illustrate what you are trying to do?

Thank you,

I have a workflow that does something like this:

func Run(ctx workflow.Workflow) error {
  publishMessage(ctx, myMessage{ID:  workflow.GetInfo(ctx).WorkflowExecution.ID})

In my test, I would like to assert that this ID is set correctly, and it seems like the workflow ID is set to “default-test-workflow-id”. I was wondering 2 things, since I didn’t see this documented anywhere:

  1. Is this ID guaranteed to stay the same across Temporal SDK versions?
  2. Is there a programmatic way to get the ID from the Go SDK, from a test runner? E.g. using the workflow test environment, some constant in a test package, etc.