Skip to content

Load connection type metadata on-demand to improve Add Connection page load time #61815

Closed

Description

@yuseok89

Apache Airflow version

main (development)

If "Other Airflow 3 version" selected, which one?

No response

What happened?

The Connection Add page takes ~10 seconds to load on first access.

  • GET /ui/connections/hook_meta imports all Hook classes and their form definitions, which loads every provider and its dependencies.

With 100+ connection types, this causes significant delay before users can interact with the form.
I understand the slowdown is more noticeable because the main branch has all providers installed by default.
Nevertheless, in my opinion, it would be good if this could be improved.

Screen.Recording.2026-02-12.at.9.34.40.PM.mov

What you think should happen instead?

It's not a critical issue, but for better user experience, the Add Connection form should be usable within about 1 second. To achieve this, connection types should load first, then metadata only when the user selects a type.

| Step | Current | Proposed |
|------|---------|----------|
| Add button click | Load all types + metadata | Load types only |
| Connection type dropdown | — | Populated from types API |
| User selects type | — | Load metadata for that type only |
| Form fields | — | Rendered from detail API |

Proposed API changes:

1. GET /ui/connections/connection_types (new, lightweight)

  • Returns only connection type identifiers

2. GET /ui/connections/hook_meta/{connection_type} (new, on-demand)

  • Returns full metadata (standard_fields, extra_fields) for the selected type only

3. GET /ui/connections/hook_meta (existing)

  • Kept unchanged for backward compatibility

Adopted approach: Use YAML-based metadata
Instead of adding new APIs, we use the connection metadata already migrated to YAML by @amoghrajesh :

  1. hook_meta reads from provider.yaml / get_provider_info.py – no Hook class imports
    • ProvidersManager._load_ui_metadata() loads connection-types from provider.yaml
    • hook-name added to provider.yaml connection-types for display in the dropdown
    • get_provider_info() (from get_provider_info.py) provides metadata without importing Hooks
  2. Connection form dropdown – shows hook-name when present, otherwise connection_type
  3. No new endpoints – existing GET /ui/connections/hook_meta is kept and made faster by avoiding Hook imports

### Implementation Plan
1. GET /ui/connections/connection_types
- PR: TBD
2. GET /ui/connections/hook_meta/{connection_type}
- PR: #63650
3. Split hooks + Update ConnectionForm to use new APIs
- PR: TBD

How to reproduce

  1. Install Airflow with many providers
  2. Go to Connections page.
  3. Click Add button.
  4. This reproduces when the cache is cold (first load or after restart): the page takes ~10 seconds before the connection type dropdown is usable.

Operating System

macOS

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

No response

Anything else?

If the committers agree with this approach, I would like to implement it.
If you approve, I would appreciate it if you could assign this issue to me.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. yuseok89 commented on Feb 12, 2026

    @yuseok89
    ContributorAuthor

    If the committers agree with this approach, I would like to implement it.
    If you approve, I would appreciate it if you could assign this issue to me.

  2. added
    area:APIAirflow's REST/HTTP API
    area:UIRelated to UI/UX. For Frontend Developers.
    on Feb 12, 2026
  3. jroachgolf84 commented on Feb 12, 2026

    @jroachgolf84
    Collaborator

    @yuseok89, feel free to open up a PR for this issue!

  4. choo121600 commented on Feb 13, 2026

    @choo121600
    Member

    Thanks for raising this! I agree the initial load time is noticeable.

    Just for context, #60410 recently introduced YAML-based discovery for connection form metadata
    Since I think this change is closely related to this issue, it might be helpful to align with @amoghrajesh to ensure the approach is consistent.

    cc @amoghrajesh

  5. jason810496 commented on Feb 13, 2026

    @jason810496
    Member

    Here is more context for the long-term goal: #60404

    The idea is to read the metadata from provider.yaml instead of importing via get_ui_field_behaviour.

  6. yuseok89 commented on Feb 13, 2026

    @yuseok89
    ContributorAuthor

    @choo121600 @jason810496
    Thanks for the context and pointers.
    I'll look into the code to see how the YAML-based approach works.

    @amoghrajesh
    Would splitting the API(connection_types + on-demand detail per type) align with the YAML-first direction?

  7. jason810496 commented on Feb 13, 2026

    @jason810496
    Member

    Sorry that I didn't look into the proposed "API(connection_types + on-demand detail per type)" approach carefully in my last reply.
    From my perspective, the static yaml based approach might already be fast enough

    Since we only need the provider.yaml for each provider instead of importing hooks for each provider, which should be less than 1 seconds for those file I/O operation. Maybe we can wait until the yaml base approach finishes and then see whether do we need the additional separate routes for the UX purpose.

  8. Arunodoy18 commented on Feb 14, 2026

    @Arunodoy18
  9. yuseok89 commented on Feb 15, 2026

    @yuseok89
    ContributorAuthor

    @jason810496
    Thanks again for the context.
    I'd like to double-check my understanding.

    As I understand it, the framework for reading from YAML is complete, and most of the YAML migration still appears to be needed.

    I'd like to contribute to this migration.
    Is anyone already working on it?
    I'd prefer to avoid overlapping or conflicting work.

    cc @amoghrajesh

  10. jason810496 commented on Feb 15, 2026

    @jason810496
    Member

    I'd like to contribute to this migration.
    Is anyone already working on it?
    I'd prefer to avoid overlapping or conflicting work.

    I’m not sure whether Amogh has started yet.

  11. amoghrajesh commented on Feb 16, 2026

    @amoghrajesh
    Contributor

    @jason810496 Thanks again for the context. I'd like to double-check my understanding.

    As I understand it, the framework for reading from YAML is complete, and most of the YAML migration still appears to be needed.

    I'd like to contribute to this migration. Is anyone already working on it? I'd prefer to avoid overlapping or conflicting work.

    cc @amoghrajesh

    Hello @yuseok89, I will be primarily working on it. As @jason810496 mentioned it will be significantly faster than the current approach.

    I have plans to start on this later this week, I also have some proposals for the more "long term" goal of this which would allow no providers to be installed on Airflow API server at all. That will take some time and is dependent on another parallel effort.

    I can loop you in onto the effort if there is some room for collaboration.

  12. yuseok89 commented on Feb 16, 2026

    @yuseok89
    ContributorAuthor

    @amoghrajesh
    Thanks for the update!
    I'd really like to be part of this.
    Please do loop me in when you're ready.
    I'm happy to help with any tasks you have in mind.

    I'll leave this ticket open for now.
    It might be good to see if additional work is needed after the YAML-related work is done.

  13. potiuk commented on Mar 2, 2026

    @potiuk
    Member

    @yuseok89 We are unassigning you from this issue as part of our updated assignment policy.

    This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.

    We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.

  14. yuseok89 commented on Mar 31, 2026

    @yuseok89
    ContributorAuthor

    @amoghrajesh
    After your YAML migration I re-measured load time and the Add Connection flow was still noticeably slow on a cold cache.
    I traced it and found that the Add Connection page (via GET /ui/connections/hook_meta) was not actually going through the YAML.
    This PR(#63826) wires the endpoint up to use the migrated YAML metadata so we avoid that work.
    Could you take a look when you have time?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:APIAirflow's REST/HTTP APIarea:UIRelated to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugkind:featureFeature Requests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions