title: Apache airflow with conditional statements
body: <p>I am new to Airflow. I want to do an operation like below using airflow operators.</p>
  <p>Briefly I want to read some data from a database table and according to the values of a column in that table I want to do different tasks.</p>
  <p>This is the table which I used to get data.</p>
  <pre><code>+-----------+--------+
  | task_name | status |
  +-----------+--------+
  | a         |      1 |
  | b         |      2 |
  | c         |      4 |
  | d         |      3 |
  | e         |      4 |
  +-----------+--------+
  </code></pre>
  <p>From the above table I want to select the rows where status=4 and according to their task name run the relevant jar file (for running jar files I am planning to use Bash Operator). I want to execute this task using Airflow. Note that I am using PostgreSQL.</p>
  <p>This is the code which I have implemented so far.</p>
  <pre><code>from airflow.models import DAG
  from airflow.operators.postgres_operator import PostgresOperator
  from datetime import datetime, timedelta
  from airflow import settings
  
  #set the default attributes
  default_args = {
      'owner': 'Airflow',
      'start_date': datetime(2020,10,4)
  }
  
  status_four_dag = DAG(
      dag_id = 'status_check',
      default_args = default_args,
      schedule_interval = timedelta(seconds=5)
  )
  
  test=PostgresOperator(
      task_id='check_status',
      sql='''select * from table1 where status=4;''',
      postgres_conn_id='test',
      database='status',
      dag=status_four_dag,
  )
  </code></pre>
  <p>I am stuck in the place where I want to check the task_name and call the relevant BashOperators.</p>
  <p>Your support is appreciated. Thank you.</p>