How can a worker register to a workflow by its name, not interface

I would like to define to the workflows on the temporal client side in Java. On the temporal worker side, it’s GoLang, and I would like to register the worker to those workflows defined in Java only by their names, so that I don’t have duplicate the workflow definition interface again on the worker side in GoLang. How can I do it?

If the workflow definitions are saved in database, can I define create them only one time so that both the client and worker will reference it by name instead of interfaces?

Thanks

Workflow definitions are not saved anywhere and they should be unique only for a single task queue.

What you are asking doesn’t really make sense as you don’t need to register workflow types in Java if they are implemented by a Go worker.

if the temporal servers are rebooted, will the workflow definitions be all gone? I thought the creation the workflow definition, which only needs once, would be separated for their usage, i.e. the registration by workers and submissions by the client. Was that understanding correct?

Workflow types are not registered with the service. They are just strings passed through it.

So the workflow registration is just telling a worker which function to call when a given string for the workflow type is received as a workflow task.