Skip to content

kick off a job run after another job completes without using Assets #7160

Answered by yuhan
yuhan asked this question in Q&A
Discussion options

You must be logged in to vote

Run status sensors currently don’t support yielding RunRequest. So, I'd recommend to write a custom sensor that listens to the run storage and yields a RunRequest when a job_1 run finishes.

Something like:

from dagster import RunsFilter, sensor, DagsterRunStatus

@sensor(job=do_the_second_thing)
def thing_sensor(context):
    run_records = context.instance.get_run_records(
        filters=RunsFilter(
            job_name="do_the_first_thing",
            statuses=[DagsterRunStatus.SUCCESS],
            updated_after=..., # can also filter by timestamp to do more efficient fetching
        ),
        order_by="update_timestamp",
        ascending=False,
    )
    for run_record in run_records

Replies: 2 comments 5 replies

Comment options

yuhan
Mar 30, 2022
Maintainer Author

You must be logged in to vote
2 replies
@nvinhphuc
Comment options

@alangenfeld
Comment options

Answer selected by yuhan
Comment options

You must be logged in to vote
3 replies
@tav1nald3rs0n
Comment options

@yuhan
Comment options

yuhan Jun 17, 2024
Maintainer Author

@CamFromStar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants