def METHOD_NAME(cls, instances, **kwargs):
    instance = instances[0]  # only one instance in asyc action
    instance.counter += 1
    instance.save()
    kwargs['shared_params'][instance.pk]['counter'] = instance.counter
    kwargs['history_kwargs'][instance.pk]['hist_counter'] = instance.counter
    if instance.counter < 5:
        raise RescheduleAsyncTransitionActionLater()
    instance.foo = kwargs['foo']
    instance.save()