go-workflows
go-workflows copied to clipboard
When scheduling activities or sub-workflows check if expected return type matches activity/workflow definition
For a scenario like:
func SubWorkflow(ctx workflow.Context) (int, error) { ... }
func Workflow(ctx workflow.Context) error {
x, err := workflow.CreateSubWorkflowInstance[string](ctx, ..., SubWorkflow).Get(ctx)
}
it would be good to try to detect that the return type int
of SubWorkflow
doesn't match the expected string
.
Ideally we'd catch that via generics, but I wasn't able to make that work (see https://cschleiden.dev/blog/2022-03-06-go-workflows-generics/) so maybe check it at runtime.