def lambda_handler(event, context):
# Parse the PD incident dictionary
event_detail = event['detail']
incident = event_detail['incident']
title = incident['title']
# Parse the title to determine if it is the retrain trigger monitor
should_retrain_model = 'retrain_model_trigger' in title and 'Triggered' in title
# Construct a payload to return from the handler that can be used
# by downstream workflows (AirFlow etc.)
retrain: should_retrain_model