Skip to content

[SPIKE] Work out a way for API server to load providers declaratively #60404

Closed

Description

@amoghrajesh

Body

Right now, API server loads all provider code just for UI metadata(static data), the intention I have in mind is that API server can start without loading provider code for connections, hooks etc

To do this, I am exploring some options where UI metadata comes from static sources like yaml.

Committer

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

Activity

  1. added this to the Airflow 3.2.0 milestone on Jan 12, 2026
  2. self-assigned this
    on Jan 12, 2026
  3. added
    kind:meta
    on Jan 12, 2026
  4. added
    area:API
    on Jan 12, 2026
  5. amoghrajesh commented on Feb 12, 2026

    @amoghrajesh
    ContributorAuthor

    This is being worked on by: #60410

  6. jason810496 commented on Feb 12, 2026

    @jason810496
    Member

    Or another approach, similar to how we introduced a ‎⁠cli⁠ section in the provider metadata: #59805

    We could separate the UI metadata into a new, clean module.

    For example, if you search for ‎⁠cli/definition.py⁠, that’s where all the provider‑level CLI definitions live. Then we could still use the existing ProviderManager approach (loading objects via ‎⁠importlib.metadata⁠). For community providers, we could add a prek to avoid importing heavy modules in the new UI metadata module, as shown here: https://github.com/apache/airflow/pull/59805/changes#diff-832133982e269231a55df6a2e72b5ac560f7b828b38b3cff2b904c0d96405ab1R145

    Which should significantly reduce the loading time as we just import some dicts via ProviderManager.

  7. jason810496 commented on Feb 12, 2026

    @jason810496
    Member

    The static YAML approach also makes sense to me! Even if we go with the static YAML approach, I think we still require providers’ ‎⁠pip⁠ dependencies on the API server, and it is unavoidable to call ‎⁠ProviderManager⁠ for the end-to-end process.

  8. amoghrajesh commented on Feb 13, 2026

    @amoghrajesh
    ContributorAuthor

    Or another approach, similar to how we introduced a ‎⁠cli⁠ section in the provider metadata: #59805

    We could separate the UI metadata into a new, clean module.

    For example, if you search for ‎⁠cli/definition.py⁠, that’s where all the provider‑level CLI definitions live. Then we could still use the existing ProviderManager approach (loading objects via ‎⁠importlib.metadata⁠). For community providers, we could add a prek to avoid importing heavy modules in the new UI metadata module, as shown here: https://github.com/apache/airflow/pull/59805/changes#diff-832133982e269231a55df6a2e72b5ac560f7b828b38b3cff2b904c0d96405ab1R145

    Which should significantly reduce the loading time as we just import some dicts via ProviderManager.

    Maybe, yes, but trying to have a declarative way instead. This would require loading python code provided by users, which could also pose a security risk for example. As of today, nothing can stop a user from writing some malicious code in get_ui_field_behaviour

  9. amoghrajesh commented on Feb 13, 2026

    @amoghrajesh
    ContributorAuthor

    The static YAML approach also makes sense to me! Even if we go with the static YAML approach, I think we still require providers’ ‎⁠pip⁠ dependencies on the API server, and it is unavoidable to call ‎⁠ProviderManager⁠ for the end-to-end process.

    Right now yes, but I am proposing a change soon on that which will let API server read connection schemas truly from yaml without having the provider installed at all. A peek into the solution would be something along the lines of having pre packaged bundles for provider.yml in api server

  10. potiuk commented on Feb 15, 2026

    @potiuk
    Member

    I think best solution will be to let providers store their configuration in the database (via task-sdk) at startup.

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

Metadata

Metadata

Assignees

Labels

area:APIkind:meta

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions