jason810496 commented on code in PR #74693:
URL: https://github.com/apache/airflow/pull/74693#discussion_r4321311365


##########
airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst:
##########
@@ -629,6 +645,47 @@ XComs are stored as JSON, so a value read with ``getXCom`` 
arrives as the matchi
   JavaScript has a single ``number`` type, so integers and decimals arrive as 
the same type, and an integer
   larger than ``Number.MAX_SAFE_INTEGER`` (2\ :sup:`53` − 1) may lose 
precision.
 
+Human-in-the-loop tasks
+-----------------------
+
+``approval`` and ``hitl``, from ``apache-airflow-ts-sdk/hitl``, make a task 
that waits for a person, as Python's
+``ApprovalOperator`` and ``HITLOperator`` do. Pass one to ``dag.task`` in 
place of a handler. Options are the
+Python keyword arguments in camelCase:
+
+.. code-block:: typescript
+
+    import { approval } from "apache-airflow-ts-sdk/hitl";
+
+    const signOff = dag.task(
+      "sign_off",
+      approval({
+        subject: ({ report }: { report: { version: string } }) => `Ship 
${report.version}?`,
+        responseTimeout: 4 * 60 * 60, // seconds
+        defaults: "Reject",
+        params: { replicas: { value: 3, schema: { type: "integer", minimum: 1 
} } },
+      }),
+    )({ report });
+
+    signOff.before(published);
+
+The task waits in ``awaiting_input`` without holding a worker slot, and 
resumes once someone responds on the
+**Required Actions** page or ``responseTimeout`` passes.
+
+* ``subject`` and ``body`` (Markdown) are a string, or a function of the 
task's inputs.
+* ``responseTimeout`` is in seconds. When it passes, ``defaults`` is applied, 
or the task fails without one.
+  ``executionTimeout`` is rejected on a HITL task.
+* ``params`` adds form fields, each with a ``value`` that pre-fills it, and an 
optional ``description`` and
+  JSON Schema. Answers arrive as ``paramsInput``.

Review Comment:
   Addressed in the latest commit, thanks.



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