There is Palette item called Cancel Trapped Job. Add this to your Pipeline Rule, so that it is invoked when the Job Status is Trapped. In the Cancel Trapped Job configuration, in turn call the Event Rule Cancel Trapped Job.