is it possible to trigger a Job Run from another J...
# ask-ai
p
is it possible to trigger a Job Run from another Job Run without using a Sensor?
s
No, according to the documentation, if you want to trigger a job run in response to the completion of another job run, you would typically use sensors, specifically run_status_sensors. These sensors are designed to monitor the status of job runs and can trigger other jobs upon successful completion (or other statuses) of the monitored jobs. The documentation provides an example of how to use a run_status_sensor to trigger a job after another job completes successfully:
Copy code
python @run_status_sensor(     run_status=DagsterRunStatus.SUCCESS,     monitored_jobs=[job_1],     request_job=job_2, ) def run_job_2_sensor(context):     return RunRequest(run_key=None, run_config=run_config)
In this example,
job_2
is triggered after
job_1
completes successfully. This is the recommended way to define dependencies between jobs when you want one job to run after another. If you are looking for a way to trigger a job run from another job run without using sensors, the documentation does not provide an alternative method. Sensors are the mechanism provided by Dagster for event-driven execution between jobs.
179 Views