What is the best practice for moving activity functions for long-running workflows #4995
-
I'm refactoring activity functions: moving them to another package (we are using Go client). But I've encountered a problem: long-running workflows that were started before the change fail because they try to find activities by the old path. Activities are executed by functions, not activity names (string). err := workflow.ExecuteActivity(ctx, taskactivities.SendEmail, req).Get(ctx, nil) One solution to this problem is keeping activities in the old packages and making them simple wrappers for activities moved to the new ones. func SendEmail(ctx context.Context, req taskactivities.SendEmailRequest) error {
return taskactivities.SendEmail(ctx, req)
} I'm wondering if is there a more elegant way that doesn't force us to keep activities in the old place and still make old workflows running? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
another idea is to use alias. After refactoring, register the activity with the old name of using old path. |
Beta Was this translation helpful? Give feedback.
another idea is to use alias. After refactoring, register the activity with the old name of using old path.