Skip to content

AIP-90: HITLOperator within standard provider #52053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented Jun 23, 2025

Why

AIP-90

What

  • db change (model)
    1. HITLResponseModel: Store input request from task and human response
  • public API endpoint
    1. GET /hitl/task-instances/{task_instance_id}/response: Get the whole HITLResponseModel details
    2. POST /hitl/task-instances/{task_instance_id}/response: write the response content part (TODO: change it to PATCH)
    3. GET /hitl/responses: get all HITLResponseModel details
  • execution API endpoint
    1. POST /hitl/task-instances/{task_instance_id}/input-reqest: Create a HITLResponseModel with input request content (Operator calls it to create the input requests)
    2. POST /hitl/task-instances/{task_instance_id}/responses: after deferring, HITLTrigger checks whehter the timeout has passed, if so, write the default value back. (the endpoint might be useful when dealing with xcom in follow up PRs as well)
    3. GET /hitl/task-instances/{task_instance_id}/responses: after deferring, HITLTrigger keeps checking whether the response is ready
  • operators
    1. HITLOperator
    2. ApprovalOperator
    3. HITLTerminationOperator defer to follow up PRs
    4. HITLBranchOperator defer to follow up PRs
    5. HITLEntryOperator (not implemented) defer to follow up PRs
  • trigger
    1. HITLTrigger -> query whether there's a HITLResponse for a certain HITLInputRequest in database

TODO

  • use plugin to load api endpoints
  • fix existing tests
  • add tests

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@Lee-W Lee-W changed the title AIP-90: InteractiveOperator within standard provider AIP-90: HITLOperator within standard provider Jun 23, 2025
@Lee-W Lee-W moved this to In progress in AIP-90 - Human in the loop Jun 23, 2025
@Lee-W Lee-W force-pushed the aip-90-within-standard-provider branch 11 times, most recently from 39043d9 to 3b35e89 Compare June 25, 2025 15:52
@Lee-W Lee-W force-pushed the aip-90-within-standard-provider branch 8 times, most recently from e30a6ac to c513ced Compare June 26, 2025 12:16
@Lee-W Lee-W force-pushed the aip-90-within-standard-provider branch from c513ced to 43506bf Compare June 27, 2025 08:16
@Lee-W Lee-W force-pushed the aip-90-within-standard-provider branch from 7f68d0b to e29668c Compare July 1, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants