1. Blocks
  2. Sensor

If there is a block with a sensor as an upstream dependency, that block won’t start running until the sensor has evaluated its condition successfully.

Read more about sensors in Core abstractions.

Example

You can add sensors to a pipeline the same way you add other types of blocks.

from mage_ai.orchestration.run_status_checker import check_status


@sensor
def check_condition(**kwargs) -> bool:
    return check_status(
        'pipeline_uuid',
        kwargs['execution_date'],
        block_uuid='block_uuid',
    )