Currently we use execution-date when generating the command to send via executor in https://github.com/apache/airflow/blob/9c94b72d440b18a9e42123d20d48b951712038f9/airflow/models/taskinstance.py#L420-L436

We should replace the execution_date in their to run_id instead and handle the corresponding changes needs on the executor and worker.
tests/models/test_taskinstance.py
"""
        Test the availability of variables in templates
        """
        Variable.set('a_variable', {'a': {'test': 'value'}}, serialize_json=True)
        _, task = create_dummy_dag()
        ti = TI(task=task, execution_date=DEFAULT_DATE)
        context = ti.get_template_context()
        result = task.render_template(content, context)
        assert result == expected_output
    def test_template_with_json_variable_missing(self, create_dummy_dag):
        _, task = create_dummy_dag()
        ti = TI(task=task, execution_date=DEFAULT_DATE)
        context = ti.get_template_context()
        with pytest.raises(KeyError):
            task.render_template('{{ var.json.get("missing_variable") }}', context)
    def test_execute_callback(self, create_dummy_dag):