Skip to main content

How to set RegsterWorkflowOptions in Go

Create an instance of RegisterOptions from the go.temporal.io/sdk/workflow package and pass it to the RegisterWorkflowWithOptions call when registering the Workflow Type with the Worker.

  • Used to set options for registering a workflow
FieldRequiredType
NameNostring
DisableAlreadyRegisteredCheckNobool

Name#

Sets the name of the Workflow Type.

  • Type: string
  • Default: function name
// ...w := worker.New(temporalClient, "your_task_queue_name", worker.Options{})registerOptions := workflow.RegisterOptions{  Name: "CoolWorkflowTypeName",  // ...}w.RegisterWorkflowWithOptions(YourWorkflowDefinition, registerOptions)// ...

DisableAlreadyRegisteredCheck#

Disables the check to see if the Workflow Type has already been registered.

  • Type: bool
  • Default: false
// ...w := worker.New(temporalClient, "your_task_queue_name", worker.Options{})registerOptions := workflow.RegisterOptions{  DisableAlreadyRegisteredCheck: `false`,  // ...}w.RegisterWorkflowWithOptions(YourWorkflowDefinition, registerOptions)// ...

Get notified of updates