Cancel a workflow from an activity

Hi there, I have a parent workflow that spawns multiple child workflows, and each child workflow runs a set of activities. One of these activities makes an RPC call to another service. I would like to kill the entire workflow (all child workflows and the parent workflow) if we get a specific response from the RPC call. This RPC will return the same thing for all the activities running in all the child workflows, so it’s really a matter of which child workflow + activity makes this RPC call first, and is the first to trigger the kill-all.

I’m having some trouble figuring out how to relay this “cancel everything” info up from the activity through to the child and parent workflows. Could you please advise? Thank you.

I would fail that specific activity and then the child workflow in case of that error. Then the parent would cancel all the currently running child workflows as error-handling logic.

See samples-go/cancellation at main · temporalio/samples-go · GitHub