Joshua Greenhalgh
02/23/2024, 9:58 PMScout
02/23/2024, 9:58 PMdefault_status
parameter when defining your sensor with the @sensor
decorator. Set this parameter to DefaultSensorStatus.RUNNING
to have the sensor start in a running state as soon as it is loaded into your workspace. Here is an example from the documentation: python from dagster import sensor, DefaultSensorStatus @sensor(job=my_job, default_status=DefaultSensorStatus.RUNNING) def my_running_sensor(): ...
In this example, my_job
is the job that the sensor is associated with, and the sensor my_running_sensor
will be started by default when it is added to your Dagster instance. If you manually start or stop a sensor in the UI, that action will override any default status set in the code.