Updating update_processes_with_exit_codes or whatever to work with SQL backend (WIP)