I have 3 workflows that essentially do the same thing, with slight variations which make it hard to make 1 generic workflow.
I’ve had an issue for the past year as these workflows grow, that I have a lot of duplicate methods that are identical in all 3 workflows, but cannot be extracted into one class because they call activities.
i.e. a function that checks whether a customer is eligible for Whatsapp communication would call 3 activities that check historical data for that customer, based on which we would decide to send a whatsapp message to that customer.
However, since that function calls external APIs, I use an activity for that.
Since a common class is not going to be annotated with @WorkflowMethod
, I get an error telling me this won’t work.
Is there a trick to do this in temporal or is this functionality just not supported?