You're in a good place re the children. There are many on here who could tell you about monster partners who treat the children like pawns in a game to score points.
There is much talk here about 'detaching' and yes, in some cases, the hard line (minimal to no contact, yes and no responses, never initiating messages) is what is needed to allow the LBS mind and soul to heal. But that hard line option is not really available to us who have children. We have to maintain contact. Sometimes we have to initiate. And we definitely have to keep things on a friendly level. The trick is to think of her like your children's teacher. Be polite but suitably forceful. Show her that you are the man that the children deserve to have in their life.
I read above that you are thinking of orchestrating a career move so that you can live in Madrid. I am all for this as long as you are doing it so you get to spend more time with your children. If you're fearful that this might be taken as pursing, then frame the discussion in a way that it isn't about being closer to her (because it shouldn't be) but about being closer to your children. I'm sure that there are people here who can help you with putting together some words should that be something you want in the future.
My H and I successfully co-parent. He is a wonderful dad and he (mostly) respects me as a mum. He does not see anything I do or say as pursuit (because it isn't). There are pros and cons to this, but it is the path I chose. I am OK with it.