Automation - mark as lost with a lost reason


How do I create an automation, that marks the deal as lost with a specific lost reason, I got the first half of course, sending an email on a 1 day old rotting deal in a specific stage, but how do I change the status to Lost with a predefined lost reason?