Download icon
JsonToIon icon
BatchCreate icon
Query icon

Extract data from a REST API, load it to Weaviate and query it

Extract JSON from a REST API, batch ingest it into a Weaviate vector database, and query it with Kestra orchestration.

Categories
AIData

Build a fully orchestrated ingestion and retrieval pipeline for the Weaviate vector database. This blueprint downloads a JSON dataset from a public HTTP endpoint, converts it to Kestra's internal Ion format, batch loads it into a Weaviate class, and then queries the cluster, including an optional NEAR_TEXT semantic search step powered by OpenAI. It solves the common gap between data sources and vector stores: most teams need a reliable way to ingest documents into Weaviate on a schedule or in response to upstream events, without writing custom Python glue.

How it works

  1. io.kestra.plugin.core.http.Download (json) pulls a sample Jeopardy dataset from a public GitHub raw URL.
  2. io.kestra.plugin.serdes.json.JsonToIon (json_to_ion) converts the JSON payload into Kestra's Ion format so it can be streamed efficiently to downstream tasks.
  3. io.kestra.plugin.weaviate.BatchCreate (batch_load) ingests the Ion file into the Questions class on Weaviate, using an internal storage URI.
  4. A second io.kestra.plugin.weaviate.BatchCreate (batch_load_map) shows the inline key-value pattern by loading a small Users collection from literal YAML maps.
  5. io.kestra.plugin.weaviate.Query (query_users) fetches the first ten Questions objects (searchType: FETCH_OBJECTS, limit: 10) with their answer, category, and question properties. Each result row is {uuid, properties, metadata}.
  6. A disabled io.kestra.plugin.weaviate.Query (generative_search) demonstrates semantic search with searchType: NEAR_TEXT and query: biology, returning the five closest Questions with their DISTANCE. The query text is vectorized by the class's vectorizer, here OpenAI through the X-OpenAI-Api-Key header.

What you get

  • Two complementary ingestion patterns: file-based (objects from a storage URI) and inline (objects as a list of maps).
  • A working structured query example (className, searchType, limit, returnProperties) you can adapt to your own classes.
  • A starting point for semantic and hybrid search using NEAR_TEXT or HYBRID and external model providers.
  • Clean separation of credentials from code via Kestra secrets.

Who it's for

  • AI and ML engineers building RAG pipelines on top of Weaviate.
  • Data engineers who need to keep a vector index in sync with upstream sources.
  • Platform teams standardizing vector database ingestion across multiple projects.

Why orchestrate this with Kestra

Weaviate itself has no native scheduler, no retry semantics, and no built-in way to coordinate ingestion with upstream extraction. Kestra adds event triggers (S3, GCS, Kafka, webhooks), automatic retries with backoff, full execution lineage, and declarative YAML that you can version in Git. You get observability into every batch load, the ability to fan out across many classes in parallel, and a single control plane that ties Weaviate to the rest of your data stack.

Prerequisites

  • A running Weaviate 1.32+ cluster (Weaviate Cloud or self-hosted). The blueprint points at a demo URL, replace it with your own.
  • Network access from your Kestra worker to the Weaviate REST endpoint and its gRPC port (50051 by default on self-hosted Weaviate; set grpcHost and grpcPort to override). Weaviate Cloud URLs are detected and use gRPC on port 443.
  • Network access from your Kestra worker to the Weaviate endpoint.
  • Optional: an OpenAI API key if you want to enable the generative_search task. NEAR_TEXT needs a vectorizer on the Questions class, for example text2vec-openai as the cluster's default vectorizer when batch_load auto-creates the class.

Secrets

  • WEAVIATE_API_KEY: API key for your Weaviate cluster.
  • OPENAI_API_KEY: only required if you enable the generative_search task.

Quick start

  1. Create a Weaviate cluster and generate an API key.
  2. Store the key as the WEAVIATE_API_KEY secret in Kestra.
  3. Replace the demo url in every Weaviate task with your own cluster endpoint.
  4. Execute the flow and inspect the query_users output for the returned Questions.
  5. (Optional) Add OPENAI_API_KEY, remove disabled: true on generative_search, and rerun for semantic search.

How to extend

  • Replace the HTTP Download task with an extractor from your real source: Postgres, Snowflake, S3, Kafka, or a SaaS API.
  • Add a io.kestra.plugin.weaviate.SchemaCreate step that creates the class with an explicit vectorizer before batch_load runs.
  • Fan out ingestion across multiple classes using Loop over a list of source files.
  • Wire a Schedule or event trigger (for example io.kestra.plugin.aws.s3.Trigger) to refresh the vector index whenever new documents land.
  • Chain the query result into a downstream task that posts answers to Slack or writes them back to a database.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.