This will work if you want to check the status of a certain tasks with in the same dag
def dag_state_check_callback(context):
dag_run = context['dag_run']
task_instance = dag_run.get_task_instance(task_id')
current_state = task_instance.state
print(f"Task state: {current_state}")