Hi Is there an easy way for a job to access the la...
# ask-community
t
Hi Is there an easy way for a job to access the last run info? I have a sensor that runs whenever a job fails but I only want to fire an alert if the previous run was a success, otherwise skip if its a fail.
c
Hi Tyrone. Within your sensor or job, you could do something like:
Copy code
context.instance.get_runs(RunsFilter(job_name="..."), limit=...)
which should allow you to fetch the previous runs for a given job along with their statuses, etc.
t
Oh this is great! Thank you so much!