Skip to content

API endpoints for sharing HITL details, operations through links from HITLOperators #52202

Closed

Description

@Lee-W

Body

Why

According to AIP-90

An URL endpoint is provided that can be used to provide a prepared link that can be shared (utility to generate included in provider to automate creation of notifications)

  • Directly opens and re-directs to the dialog with details
  • Directly trigger one action as a single-click (e.g. single click on a link in an email to approve) - assuming user is logged-in before
  • Security first! This would need to be explicitly enabled in configuration and a token would be added when generating to ensure CSRF is not made by artificial URLs. URLs would need to be generated by the utility before distribution.

, we need a URL endpoint for users to perform actions on HITLOperators.

What

  1. A URL endpoint that can generate a link that opens and redirects to the Airflow page, where the user can choose an option and enter input
  2. A URL endpoint that generates a link that sends a patch request to /api/v2/hitl-details/{dag_id}/{dag_run_id}/{task_id} and /api/v2/hitl-details/{dag_id}/{dag_run_id}/{task_id}/{map_index} with proper option embed (e.g., {"chosen_options": ["a", "b"], "params_input": {"input_1": 1}}) to Airflow if the user has logged in and has sufficient permission
  3. An airflow config that allows the user to enable the two URL endpoints above. Without explicit setup, the two URL endpoints should not be hooked into Airflow.
  4. For the above two URL endpoints, we need to add a token to ensure CSRF is not made by artificial URLs.

The endpoints for HITL-details are now ready. Please use {dag_id}/{dag_run_id}/{task_id} or /{dag_id}/{dag_run_id}/{task_id}/{map_index} as suffix of the new endpoint

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:metaHigh-level information important to the community
    on Jun 25, 2025
  2. added theissue type on Jun 25, 2025
  3. moved this from Backlog to Ready in AIP-90 - Human in the loopon Jun 27, 2025
  4. moved this from Ready to In progress in AIP-90 - Human in the loopon Jul 2, 2025
  5. changed the title [-]API endpoint for sharing input requests from `HITLOperator`s[/-] [+]API endpoints for sharing HITL details, operations through links from `HITLOperator`s[/+] on Jul 3, 2025
  6. Lee-W commented on Jul 3, 2025

    @Lee-W
    MemberAuthor

    @sunank200 I've just updated the description. please let me know if it's better now. Thanks!

  7. Lee-W commented on Jul 11, 2025

    @Lee-W
    MemberAuthor

    updated the description with some more details, but I think what we discussed should have already cover it

  8. Lee-W commented on Jul 28, 2025

    @Lee-W
    MemberAuthor

    Hey @sunank200 , could you please link the new PR to this issue? Thanks!

  9. sunank200 commented on Jul 28, 2025

    @sunank200
    Collaborator

    @Lee-W I have pushed the current change in astronomer@36b2f34. I will create the PR once it's ready today.

  10. Lee-W commented on Jul 29, 2025

    @Lee-W
    MemberAuthor

    Let's create a draft PR first, even before it's fully ready 🙂

  11. sunank200 commented on Jul 30, 2025

    @sunank200
    Collaborator

    Draft PR: #53907

  12. self-assigned this
    on Aug 6, 2025
  13. moved this from In progress to On Hold in AIP-90 - Human in the loopon Aug 18, 2025
  14. Lee-W commented on Aug 20, 2025

    @Lee-W
    MemberAuthor

    de-scope as consensus reached in #53907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:APIAirflow's REST/HTTP APIkind:metaHigh-level information important to the community

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions