Move contacts into a flow

Move contacts into a flow

Hi,
I have a workflow composed by 18 emails.
contacts get into this workflow if they are both leads or customers taken from CRM so we have 2 different lists sync with CRM.
If a lead starts the workflow and at 6th email decide to buy, will be remove from lead list and add to customer list.
So he will start again the flow from the beginning.

How can I solve this?
thanks.
Claudio