Workflow automation cancellation

Workflow automation cancellation

How do I set up an automated workflow rule so that it is cancelled when a stage is closed won, closed lost, etc?