workflow.Go OR Futures?

I’m not sure if I’m doing it right. I have ~10 activities that should (can) be executed in parallel, and I need to wait for all their result in a workflow.
Should I

  1. use workflow.Go for each activity?
  2. will it be enough to just call Future.Get on each activity result after I’ve started all the activities?
    future1 := workflow.ExecuteActivity(…)
    future2 := workflow.ExecuteActivity(…)
    future3 := workflow.ExecuteActivity(…)

will it have the same effect?

The problem that I’m observing with (2) is that workflow task regularly fails to schedule just before this code, so I’m assuming that this could be a problem.


You can add all the futures to a workflow.Selector and the first future completed will call its callback upon Select. You can do this however many times necessary (this is similar to a Go select).

Yes, and I don’t mind waiting sequentially for the futures.

But my question is should I use workflow.Go on these activities? Is their start inherently parallel, event without workflow.Go ?

You don’t need to use workflow.Go. You can start them all and then handle all of their futures together with a selector or however.