Campaign action on contact removal

Hi, is it possible to preform an action on a contact being removed from a campaign (due to being removed from the segment for the campaign)?

The scenario is we want to add a tag to a user who is in a certain campaign. Then when a database field gets updated (like an expiry date for a license) we want to send out an email to the user like a thankyou but different email depending on the campaign they are currently in.

Right now we are doing this with a database trigger that basically updates their current tag to a corresponding tag when the expiry changes and then that other tag controls another segment and campaign to match.

It would be nice to be able to perform an action on a contact when they are removed from a campaign (such as remove tag / add tag) rather than having to do it in the database. This is easy enough if they reach the end of the campaign flow, however if they are removed mid campaign I don’t know if there is a way to do it.

Thanks,