Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions providers/http/docs/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ the response body.
:start-after: [START howto_operator_http_task_get_op_response_filter]
:end-before: [END howto_operator_http_task_get_op_response_filter]

A common pattern is combining ``response_filter`` with ``@task.branch`` to route
downstream work based on an API response. For example, a health-check endpoint
can determine whether to proceed with processing or send a notification.

.. code-block:: python

from airflow.decorators import task

@task.branch
def route(api_status):
if api_status == "healthy":
return "process_data"
return "send_notification"

In the third example we are performing a ``PUT`` operation to put / set data according to the data that is being
provided to the request.

Expand Down
Loading