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

Scott Hood

06/22/2022, 4:06 PM
Hey all, is there a current best practice for having a sensor that runs
job A
only when
job B
is successful? I saw some practices of building a sensor, and listening to the instance events, however in the filter types I only see things to filter certain assets and not certain jobs. Would I need to parse through the event records returned by the
get_event_records
to see if any of said events were triggered by a given job?
🤖 1
s

Scott Hood

06/22/2022, 4:15 PM
@Zach I read in support that there is a limitation for this that it doesn't support yielding a RunRequest: https://dagster.slack.com/archives/C01U954MEER/p1644948693507139?thread_ts=1644834898.698609&cid=C01U954MEER
Unless this has changed, or you can simply run the execute_in_process.
z

Zach

06/22/2022, 4:25 PM
ah okay I wasn't aware of that, good catch. I see your issue now with not being able to filter on a specific job. a cursory look at the RunStatusSensorDefinition source makes it seem you will need to filter on job name after collecting the event records, but I might be missing a different pattern people are using for this. sorry I'm not very helpful here
s

Scott Hood

06/22/2022, 4:27 PM
All good, ya I think I can just filter off the records but before I go down that route wanted to see if there was something cleaner, this seems like a use case that would be popular potentially popular but maybe abstracting my workflows into separate jobs using a sensor is breaking a pattern.....
s

sandy

06/22/2022, 5:56 PM
Hey Scott - here's an issue where we're tracking enabling run status sensors to yield run requests: https://github.com/dagster-io/dagster/issues/7383. I linked this slack thread from that issue.
3 Views