Generic middleware for handling REDCap Triggers from Flask web apps