https://dagster.io/ logo
#ask-community
Title
# ask-community
t

Tyrone Wong

02/24/2023, 1:10 AM
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

claire

02/24/2023, 7:43 PM
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

Tyrone Wong

03/01/2023, 12:09 AM
Oh this is great! Thank you so much!