We saw this error recently:
unknown command CommandType: Timer, ID: XXXX, possible causes are nondeterministic workflow definition code or incompatible change in the workflow definition
This is from a scheduled workflow. One activity was changed but the main workflow definition was untouched. We added an event publisher to the struct that implements the workflow. The event is published from an activity.
Can deployments of updated binaries cause this for scheduled workflows?
Example code:
type eventPublisher interface {
PublishEvent(ctx context.Context)
}
type Workflow struct {
eventPublisher eventPublisher // this was added
}
// this function wasn't touched at all
func (w *Workflow) DoSomething(ctx workflow.Context) error {
if err := workflow.ExecuteActivity(ctx, w.DoSomeActivity).Get(ctx, nil); err != nil {
return err
}
return nil
}
func (w *Workflow) DoSomeActivity(ctx context.Context) error {
// do something
// we added something like this:
w.eventPublisher.PublishEvent(ctx)
return nil
}