CREATE EXTENSION pg_cron;SELECT cron.schedule_in_database('remove-completed-process-instances', '0 4 * * 0', $$DELETE FROM "public"."process_instance" WHERE ("state"='COMPLETED')$$, 'postgres');DELETE FROM "public"."process_instance" WHERE ("state"='COMPLETED')