Multiple signal channels and selector vs. Single signal channel

I have a process that I have created a workflow for:

image

The progress of this process is driven by a third party and we will be receiving webhooks for the various states. We also perform activities before and after this process is initialted with the third party.

My question is whether it’s better to create multiple signal channels, one for each state(webhook). And making use of selectors:

for {
	selector := workflow.NewSelector(ctx)

	selector.AddReceive(channelForWebhook1, func(c workflow.ReceiveChannel, _ bool) {
		var signal interface{}
		c.Receive(ctx, &signal)

		// Handle signal for webhook 1
	})

	selector.AddReceive(channelForWebhook2, func(c workflow.ReceiveChannel, _ bool) {
		var signal interface{}
		c.Receive(ctx, &signal)

		// Handle signal for webhook 2
	})

	// Other signal channels per webhook required for this workflow.

	selector.Select(ctx)
}

Or to use a single signal per workflow. And handle the logic of differentiating the state(webhook) types in the workflow itself.

Are there any benefits to either implementation that we should be aware of? Or is this just an implementation detail?

In the underlying implementation, there is basically no difference between differently named signals and signals sent with the same name. So it’s just up to your code preference. From a code best-practices point of view, it might be wisest to let the signal argument/purpose help you decide - if the argument is the same and the purpose is the same, use the same signal name. If they aren’t, use different names. But really that’s all they are are just different names and channels, no real effects.