@@ -311,6 +311,31 @@ already exists changes nothing. Each returns the reference it was called on, so
311311Pass a value as an argument when the downstream task needs it, and use ``before `` or ``after `` when
312312it only needs to run in order.
313313
314+ Task groups
315+ ~~~~~~~~~~~
316+
317+ ``dag.taskGroup(groupId) `` opens a scope with the same ``task `` and ``taskGroup `` methods as the Dag,
318+ prefixing the id of everything declared in it, as Python's ``prefix_group_id `` does:
319+
320+ .. code-block :: typescript
321+
322+ const staging = dag .taskGroup (" staging" );
323+ staging .task (" stage_rows" , stageRows )(); // task id "staging.stage_rows"
324+ staging .taskGroup (" checks" ).task (" nulls" , checkNulls )(); // "staging.checks.nulls"
325+
326+ staging .before (loaded ); // staging >> loaded
327+
328+ A group is an edge endpoint in its own right, so ``before `` and ``after `` order a whole group against
329+ a task or against another group.
330+
331+ Tasks and groups share one id namespace, as they do in Python, so a Dag cannot hold both a task and a
332+ group called ``staging ``. A ``. `` is what separates a group from what it holds, so it cannot appear in
333+ an id of either.
334+
335+ Pass ``{ prefixGroupId: false } `` to keep the ids declared in a group as written, as ``prefix_group_id=False ``
336+ does in Python; they then have to be unique across the Dag. A group id is made of letters, digits, dashes and
337+ underscores, and is at most 200 characters.
338+
314339``new Dag `` and ``dag.task `` both take a trailing spec of Airflow options:
315340``{ schedule: "@daily", tags: ["etl"] } `` for the Dag, ``{ retries: 2, retryDelay: 30 } `` for a task.
316341
0 commit comments