I have some pg_cron jobs that run at night time. They basically run some plpgsql Procedures and trigger based off CRON expressions.
The problem is that some of my JOBS are dependent on the jobs that run before them. I have been dealing with that by inserting a record into a utility table I have created, but it's annoying to me that even the 1st job runs and inserts this record, the other job is constantly re-triggering because of the CRON expression. I do indeed have a conditional statement in the 2nd and subsequent jobs so they don't run if the 1st job didn't insert its record into the utility table, but I don't see to find any way to completely outright prevent the other jobs from running.
Also, I don't know when the 1st job will end, so if I technically set a specific CRON time, the 1st job might not be done, and the 2nd will never run (which I don't want).
Ideally, there would be someway for me to link the jobs together (if 1st job runs and completes, run the 2nd) but I seem to only be able to set expressions like (* * * * *), where basically the job has to repeatedly check all day.
Is this the best approach? Is there an alternative to setting Cron expressions for the pg_cron jobs or a way to link jobs?