public override async Task InvokeAsync(IPipeContext context, CancellationToken token) { var machine = context.GetStateMachine(); await _stateMachineRepo.PersistAsync(machine); await Next.InvokeAsync(context, token); }