kaxil commented on code in PR #68492:
URL: https://github.com/apache/airflow/pull/68492#discussion_r3408842161


##########
airflow-core/docs/tutorial/hitl.rst:
##########
@@ -196,6 +196,30 @@ When the operator creates an HITL request that is waiting 
for a human response,
    :end-before: [END howto_hitl_entry_operator]
 
 
+Testing HITL Dags locally
+-------------------------
+
+``airflow dags test`` (and the underlying ``dag.test()``) supports HITL tasks. 
A task that reaches
+the ``awaiting_input`` state stays parked -- the test run never resolves it 
itself -- and the run
+waits, logging which tasks await input, until a response is recorded from 
outside. The response
+goes through the same channels as on a real deployment: the Required Actions 
page or the HITL REST
+API (``PATCH .../hitlDetails``) of an api-server sharing the metadata database 
(for example
+``airflow standalone``, or a separately started ``airflow api-server``). Once 
the response lands,
+the test run resumes the task and continues with downstream tasks.
+
+This also lets AI agents drive a HITL pipeline end-to-end locally: run 
``airflow dags test``, watch
+for the waiting log line, ask the human, and submit their answer through the 
HITL REST API. The two
+calls involved (``~`` works as a wildcard for ``dag_id`` and ``dag_run_id``):
+
+.. code-block:: text
+
+    # Discover pending requests (subject, options, params, run/task 
identifiers)
+    GET 
/api/v2/dags/~/dagRuns/~/taskInstances/hitlDetails?response_received=false

Review Comment:
   aah yes, the regex one doesn't use have `taskInstances`, will fix it!



-- 
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