Weaviate SchemaCreate

Weaviate SchemaCreate

Certified

Create a Weaviate collection

Creates a collection (class) with the given properties and vectorizer. Fails if the collection already exists, unless skipIfExists is true.

yaml
type: io.kestra.plugin.weaviate.SchemaCreate

Create a collection for objects with precomputed vectors.

yaml
id: create_weaviate_schema
namespace: company.team

tasks:
  - id: schema
    type: io.kestra.plugin.weaviate.SchemaCreate
    url: https://demo-cluster-id.weaviate.cloud
    apiKey: "{{ secret('WEAVIATE_API_KEY') }}"
    className: Movies
    fields:
      name: text
      description: text
      year: int
      genres: text[]

Create a collection vectorized by Weaviate Embeddings, if it does not exist yet.

yaml
id: create_weaviate_collection_vectorizer
namespace: company.team

tasks:
  - id: schema
    type: io.kestra.plugin.weaviate.SchemaCreate
    url: https://demo-cluster-id.weaviate.cloud
    apiKey: "{{ secret('WEAVIATE_API_KEY') }}"
    className: Question
    vectorizer: TEXT2VEC_WEAVIATE
    skipIfExists: true
    fields:
      question: text
      answer: text
      category: text

Configure how each property is indexed, e.g. enable range filters on numbers and dates.

yaml
id: create_weaviate_orders
namespace: company.team

tasks:
  - id: schema
    type: io.kestra.plugin.weaviate.SchemaCreate
    url: http://localhost:8080
    className: Order
    skipIfExists: true
    fields:
      orderId: uuid
      total:
        type: number
        indexRangeFilters: true
      createdAt:
        type: date
        indexRangeFilters: true
      note:
        type: text
        description: Free-text note from the customer
        indexFilterable: false
      status:
        type: text
        indexSearchable: false

Multi-tenant collection with one tenant per customer and RQ-compressed vectors.

yaml
id: create_weaviate_tenants
namespace: company.team

tasks:
  - id: schema
    type: io.kestra.plugin.weaviate.SchemaCreate
    url: https://demo-cluster-id.weaviate.cloud
    apiKey: "{{ secret('WEAVIATE_API_KEY') }}"
    className: SupportTicket
    vectorizer: TEXT2VEC_WEAVIATE
    skipIfExists: true
    quantization:
      type: RQ
      bits: 8
    multiTenancy:
      autoTenantCreation: true
      tenants:
        - acme
        - globex
    fields:
      subject: text
      body: text

  - id: insert
    type: io.kestra.plugin.weaviate.BatchCreate
    url: https://demo-cluster-id.weaviate.cloud
    apiKey: "{{ secret('WEAVIATE_API_KEY') }}"
    className: SupportTicket
    tenant: acme
    objects:
      - subject: Cannot log in
        body: The password reset email never arrives.

Create a collection from its JSON definition, e.g. as exported by https://weaviate.github.io/weaviate-add-collection/.

yaml
id: create_weaviate_from_json
namespace: company.team

tasks:
  - id: schema
    type: io.kestra.plugin.weaviate.SchemaCreate
    url: http://localhost:8080
    skipIfExists: true
    definition: |
      {
        "class": "Product",
        "properties": [
          { "name": "name", "dataType": ["text"] },
          {
            "name": "dimensions",
            "dataType": ["object"],
            "nestedProperties": [
              { "name": "width", "dataType": ["number"] },
              { "name": "unit", "dataType": ["text"] }
            ]
          }
        ],
        "vectorConfig": {
          "default": {
            "vectorizer": { "none": {} },
            "vectorIndexType": "hnsw",
            "vectorIndexConfig": { "rq": { "enabled": true, "rescoreLimit": 50 } }
          }
        }
      }
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-weaviate --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties
Min length1

Configure Weaviate endpoint URL

HTTP(S) URL of the Weaviate server, including the port when it is not the scheme default. Without a scheme, https is assumed. Example: http://localhost: 8080 or https://cluster-id.weaviate.cloud. Weaviate Cloud URLs (*.weaviate.cloud, *.weaviate.network) are detected automatically. Requires Weaviate 1.32 or later.

Provide managed cluster API key

Optional API key; required for Weaviate Cloud. If omitted, requests use anonymous access.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Collection (class) name

Required, unless definition names the collection in class. With definition, it overrides that name.

Collection definition as Weaviate JSON

The full collection, in the JSON format of Weaviate's REST API (POST /v1/schema), as a map or a JSON string. It is sent to Weaviate as is, so every option the server supports is available, including ones this task has no property for. Build one visually with https://weaviate.github.io/weaviate-add-collection/. Use it instead of fields, vectorizer, quantization, invertedIndex and the other collection options; skipIfExists and multiTenancy.tenants still apply.

Properties to add to the collection

Map of property name to a Weaviate data type: text, int, number, boolean, date, uuid (each also as an array, e.g. text[]), blob, geoCoordinates or phoneNumber. A single-element list is also accepted; the legacy string type maps to text. To configure a property, give a map instead: type plus any of description, indexFilterable (equality filters), indexRangeFilters (range filters on int, number and date), indexSearchable (BM25 on text), tokenization (how text is split into tokens: WORD, LOWERCASE, WHITESPACE, FIELD, TRIGRAM, GSE, KAGOME_JA or KAGOME_KR), and textAnalyzer (foldAscii, keepAscii, stopwordPreset). Unset options keep Weaviate's defaults. To choose which properties are vectorized, use vectorizeProperties.

Override gRPC host

Host of the Weaviate gRPC endpoint, used for queries and batch inserts. Defaults to the host of url, or to the grpc- prefixed host on Weaviate Cloud.

Override gRPC port

Port of the Weaviate gRPC endpoint, between 1 and 65535. Defaults to 50051, or 443 on Weaviate Cloud. gRPC uses TLS when url is https.

Set custom request headers

Key/value headers sent with every REST and gRPC call, e.g. vectorizer API keys such as X-OpenAI-Api-Key. Values that are credentials should come from {{ secret('...') }}. The plugin also sends an X-Weaviate-Client-Integration header identifying itself; setting that key here overrides it.

Collection-wide inverted index settings

Enables the extra indexes some filters need (indexTimestamps, indexNullState, indexPropertyLength) and tunes keyword search (bm25, stopwords). Unset values keep Weaviate's defaults.

Definitions
bm25
bnumber

Length normalization, 0 to 1

Weaviate's default is 0.75.

k1number

Term frequency saturation

Weaviate's default is 1.2.

cleanupIntervalSecondsinteger

Seconds between cleanups of deleted objects in the inverted index

indexNullStateboolean

Index whether properties are null

Needed for the IS_NULL filter operator.

indexPropertyLengthboolean

Index the length of text and array properties

Needed to filter on len(property).

indexTimestampsboolean

Index creation and update times

Needed to filter on _creationTimeUnix and _lastUpdateTimeUnix.

stopwords

Stopwords ignored by keyword search

additionsarray
SubTypestring

Words to add to the preset

presetstring

Preset

en (default) or none.

removalsarray
SubTypestring

Words to remove from the preset

Multi-tenancy

Stores each tenant's objects in its own shard, so tenants are isolated and can be activated, deactivated or deleted on their own. BatchCreate, Query and Delete then need tenant. tenants are created with the collection; when the collection already exists and skipIfExists is true, missing ones are added. See https://docs.weaviate.io/weaviate/manage-collections/multi-tenancy.

Definitions
autoTenantActivationboolean

Activate inactive tenants on access

autoTenantCreationboolean

Create unknown tenants on insert

Lets BatchCreate write to a tenant that does not exist yet.

enabledboolean

Enable multi-tenancy

Defaults to true when multiTenancy is set.

tenantsarray
SubTypestring

Tenants to create

Created as active.

Vector quantization (compression)

Compresses the vectors to cut memory use, at a small cost in recall. type is RQ (rotational, recommended), BQ (binary), SQ (scalar), PQ (product), or NONE to keep vectors uncompressed even if the server sets a default quantization. Unset uses the server default. See https://docs.weaviate.io/weaviate/configuration/compression.

Definitions
bitsinteger

Bits per dimension (RQ)

8 (default, about 4x smaller) or 1 (about 32x smaller).

centroidsinteger

Centroids per segment (PQ)

At most 256.

segmentsinteger

Number of segments (PQ)

Must divide the vector dimensions. 0 lets Weaviate choose.

typestring
Possible Values
NONERQBQSQPQ

Quantization method

RQ, BQ, SQ, PQ, or NONE for uncompressed vectors.

Set request timeout

Timeout applied to connection, query and insert requests. Defaults to the Weaviate client defaults (30s connect, 60s query, 120s insert).

Defaultfalse

Succeed without changes if the collection exists

Vector name

Creates a named vector instead of the default one.

SubTypestring

Properties the vectorizer embeds

Text properties the vectorizer turns into the vector (Weaviate's sourceProperties). Defaults to all text properties. Leave out labels and IDs so they don't affect similarity.

DefaultNONE
Possible Values
NONETEXT2VEC_COHERETEXT2VEC_MODEL2VECTEXT2VEC_TRANSFORMERSTEXT2VEC_OPENAITEXT2VEC_WEAVIATE

Vectorizer

NONE (default) means vectors are provided on insert, e.g. with BatchCreate.vectorKey. Other values vectorize text properties server-side; the module must be enabled on the server. Unlike plugin versions built on the v5 client, the server's DEFAULT_VECTORIZER_MODULE is not used, so set this explicitly.

Vectorizer model

Model name for TEXT2VEC_COHERE, TEXT2VEC_OPENAI and TEXT2VEC_WEAVIATE. Defaults to the module default.

Whether the collection was created

False when it already existed and skipIfExists is true.

Whether the task succeeded

SubTypestring

Tenants created by this run