There are many wonderful resources out there that can complement your efforts. Read infidelity expert Dr. Shirley Glass' book NOT "Just Friends". Read sexuality expert Esther Perel's Mating in Captivity and watch her TED talk. Together with your spouse, complete the exercises in John Gottman's The Seven Principles for Making Marriage Work. Read Elizabeth Gilbert's comprehensive and engaging study on marriage: Committed: A Sceptic Makes Peace with Marriage. Watch brilliant writer and director's Sarah Polley's spot-on film Take This Waltz. (If your spouse is not aware of your feelings for someone else, watch this film privately. Likewise with regard to the book NOT "Just Friends"!) This may sound like a lot of effort, but anyone who has been through a divorce will tell you that the effort that goes into navigating the reality of divorce far outweighs the steps you can take to see if your marriage can be salvaged.
If both partners are willing to make the effort, your flirtatious experience with someone outside the the marriage can actually become a wake up call and a catalyst for tremendous change and improvement. Many couples who have come close to the brink of divorce are able to find their way back to each other and feel stronger and closer because of that journey. Unfortunately, not all marriages can be saved. If this is the case, at least you will know, for the love of your family, that you tried.