title: Airflow get/set a parameter on BashOperator
body: <p>I'm trying to set a value as parameter and later use it on bashOperations. It is failing because I don't know how to use task_instance.xcom_pull. Please help me to get/set a parameter in the bash string.</p>
  <pre><code>dag = DAG(
      dag_id = 'stackover',
      schedule_interval='01 6 * * *',
      default_args=default_args,
      description='stackover',
      tags=['stackover'],
      catchup=False
  )
  
  week_op = BashOperator(
      task_id=&quot;week_op&quot;,
      bash_command='echo &quot;{{ params.week }}&quot;',
      params = {'week' : ' $(date +%V -d \&quot;1 week ago\&quot;) ',},
      provide_context=True,
      xcom_push=True,
      dag=dag
  )
  
  
  start_op = BashOperator(
      task_id=&quot;start_op&quot;,
      bash_command=' {{ params.query }}&quot;',
      params = {'query' : 'echo {{ (task_instance.xcom_pull(task_ids=\'week_op\')) }} ',},
      provide_context=True,
      xcom_push=True,
      dag=dag
  )
  
  week_op &gt;&gt; start_op
  </code></pre>
  <p>Thanks in Advance</p>