code: def on_dag_run_failed(dag_run: DagRun, msg: str):
      """
      This method is called when dag run state changes to FAILED.
      """
      print("Dag run  in failure state")
      dag_id = dag_run.dag_id
      run_id = dag_run.run_id
      external_trigger = dag_run.external_trigger
  
      print(
          f"Dag information:{dag_id} Run id: {run_id} external trigger: {external_trigger}"
      )
  
file_path: airflow/airflow/example_dags/plugins/event_listener.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from airflow.listeners import hookimpl
label_desc: Use image node_id 5 for calling a global function with example usage: on_dag_run_failed(dag_run, msg) without return types