How can I group duplicate methods that call activities?

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?

but cannot be extracted into one class because they call activities

Can you give more info on this please? Could write reusable function that takes in your activity stub as parameter for example. Your workflow impls could extend class that contains your reusable methods.

Another approach could be to use child workflow(s) that all parent workflows invoke.

I’m using the the TypeScript SDK which doesn’t seem to be intended for use with OO patterns without custom wrappers.

I’m in a similar place where there’s a lot of code duplication and if statements inside workflows to delegate to the correct activity. What’s the best practice here? Is using child workflows the idiomatic way of doing this for typescript (contrary to what @maxim mentions here).

What’s the problem in using OO as proposed in the linked post? It is just a few lines of code to instantiate the object from a function.