New to Kestra?
Use blueprints to kickstart your first workflows.
Fetch all namespaces from a Kestra instance via the REST API. Automate namespace discovery and inventory for multi-tenant environments with typed outputs.
Inventory every namespace registered on a Kestra instance with two simple HTTP calls against the Kestra REST API. This blueprint solves namespace discovery for multi-tenant and large platform deployments, where teams need a programmatic, repeatable way to enumerate namespaces for audits, governance reports, access reviews, or downstream automation instead of clicking through the UI.
The flow runs two sequential HTTP requests, each an io.kestra.plugin.core.http.Request task configured with method: GET and a bearer token header.
get_nr_of_namespaces calls io.kestra.plugin.core.http.Request against /api/v1/namespaces/search?size=1 to read the total field from the response body, giving the full namespace count.get_all_namespaces reuses that count in /api/v1/namespaces/search?size={{ total }} so a single paginated request returns every namespace.namespaces (an ARRAY of namespace IDs built from results) and total (an INT count), both ready to feed later tasks or flows.ARRAY and INT) consumable by downstream flows.Kestra turns an ad hoc API call into a managed, observable process. You get event and schedule triggers, automatic retries on transient HTTP failures, full execution lineage and logs, and declarative YAML you can version control. A raw curl script or cron job cannot capture outputs as typed values, chain them into other flows, or give you the auditability and replay that orchestration provides.
vars.kestra_local_uri)./api/v1/namespaces/search endpoint.KESTRA_API_TOKEN: the bearer token sent in the Authorization header for both requests.KESTRA_API_TOKEN secret to your Kestra instance.vars.kestra_local_uri to point at your instance base URL.namespaces and total outputs in the execution view.io.kestra.plugin.core.trigger.Schedule trigger to refresh the inventory daily.outputs.namespaces with Loop to run per-namespace maintenance.