title: Airflow - Proper way to handle DAGs callbacks
body: <p>I have a <code>DAG</code> and then whenever it success or fails, I want it to trigger a method which posts to Slack.</p>
  
  <p>My <code>DAG args</code> is like below:</p>
  
  <pre><code>default_args = {
      [...]
      'on_failure_callback': slack.slack_message(sad_message),
      'on_success_callback': slack.slack_message(happy_message),
      [...]
  }
  </code></pre>
  
  <p>And the <code>DAG</code> definition itself:</p>
  
  <pre><code>dag = DAG(
      dag_id = dag_name_id,
      default_args=default_args,
      description='load data from mysql to S3',
      schedule_interval='*/10 * * * *',
      catchup=False
        )
  </code></pre>
  
  <p>But when I check Slack there is more than 100 message each minute, as if is evaluating at each scheduler heartbeat and for every log it did runned the success and failure method as if it worked and didn't work for the same task instance (not fine).</p>
  
  <p>How should I properly use the <code>on_failure_callback</code> and <code>on_success_callback</code> to handle dags statuses and call a custom method?</p>