obilalk commented on issue #28825:
URL: https://github.com/apache/airflow/issues/28825#issuecomment-1387123398

   In `v1.yaml` you can see setted get-post request for airflow 
`/dags/{dag_id}/dagRuns`:
   
   
https://github.com/apache/airflow/blob/d5ac1b057f96d94062a92d968fe40f4371eb5da0/airflow/api_connexion/openapi/v1.yaml#L700-L759
   
   `post_dag_run` function is the main function to external trigger for Dag, in 
this case if dagrun_instance return False start to send payload to trigger 
airflow dag but there are no exist note section.
   
   
https://github.com/apache/airflow/blob/d5ac1b057f96d94062a92d968fe40f4371eb5da0/airflow/api_connexion/endpoints/dag_run_endpoint.py#L308-L325
   
   On the other hand to set a note for DagRun with api call we need 
dagrun_instance True but it will conflict in `post_dag_run` function.
   
   
https://github.com/apache/airflow/blob/d5ac1b057f96d94062a92d968fe40f4371eb5da0/airflow/api_connexion/endpoints/dag_run_endpoint.py#L426-L450
   
   Solution:
   -Use note paramater inside of first task so that after triggered dag it will 
update DagRun notes.
   Example : 
PATCH-->`BASE_URL/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote`
   
   Alternative:
   -Contribute new session to combine payload.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to