Vespa Feed

Vespa Feed

Certified

Feed documents to Vespa

Writes, updates or removes many documents through Vespa's feed client, which retries throttled and unavailable answers and adapts how many operations run at once. Each record is a map with id and, except for REMOVE, fields. Records Vespa refuses fail the task, or with failOnError: false end it in WARNING with the failed records in an ION file. The feed client has its own HTTP stack: connectTimeout is unused (the client waits 30 seconds to connect), and endpoint must have no path (only scheme, host and port), since the client sends to the host's root. Before feeding, Feed sends one HEAD /state/v1/health through Kestra's HTTP client, so Kestra's allowed and denied hosts apply to it too. A kestra:// file in from is read whole into memory before the first record is sent.

yaml
type: io.kestra.plugin.vespa.Feed

Feed albums written by a previous task, keyed by their name.

yaml
id: vespa_feed
namespace: company.team

tasks:
  - id: write
    type: io.kestra.plugin.core.storage.Write
    extension: .ion
    content: |
      {id:"kind-of-blue",fields:{artist:"Miles Davis",album:"Kind of Blue",year:1959}}
      {id:"a-love-supreme",fields:{artist:"John Coltrane",album:"A Love Supreme",year:1965}}

  - id: feed
    type: io.kestra.plugin.vespa.Feed
    endpoint: "{{ secret('VESPA_ENDPOINT') }}"
    token: "{{ secret('VESPA_TOKEN') }}"
    from: "{{ outputs.write.uri }}"
    namespace: mynamespace
    documentType: music

Update one field of many documents and keep going when some fail.

yaml
id: vespa_feed_update
namespace: company.team

tasks:
  - id: update
    type: io.kestra.plugin.vespa.Feed
    endpoint: "{{ secret('VESPA_ENDPOINT') }}"
    token: "{{ secret('VESPA_TOKEN') }}"
    operation: UPDATE
    failOnError: false
    from:
      - id: "id:mynamespace:music::kind-of-blue"
        fields:
          genre:
            assign: jazz
      - id: "id:mynamespace:music::a-love-supreme"
        fields:
          genre:
            assign: jazz

  - id: log_failures
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.update.failureCount }} updates failed, see {{ outputs.update.uri ?? 'nothing' }}"

Upsert documents, creating the ones that don't exist yet, and update only those still in stock.

yaml
id: vespa_feed_upsert
namespace: company.team

tasks:
  - id: upsert
    type: io.kestra.plugin.vespa.Feed
    endpoint: "{{ secret('VESPA_ENDPOINT') }}"
    token: "{{ secret('VESPA_TOKEN') }}"
    operation: UPDATE
    createIfNotExists: true
    namespace: mynamespace
    documentType: music
    from:
      - id: kind-of-blue
        fields:
          stock:
            assign: 3

  - id: reprice
    type: io.kestra.plugin.vespa.Feed
    endpoint: "{{ secret('VESPA_ENDPOINT') }}"
    token: "{{ secret('VESPA_TOKEN') }}"
    operation: UPDATE
    condition: "music.stock > 0"
    failOnError: false
    namespace: mynamespace
    documentType: music
    from:
      - id: kind-of-blue
        fields:
          price:
            assign: 9.99
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-vespa --compatible-for $KESTRA_VERSION

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

Properties

Vespa endpoint

Base URL of the Vespa container cluster serving the query and document APIs, like http://localhost: 8080 or a Vespa Cloud endpoint. A trailing / is ignored.

Structured data items, either as a map, a list of map, a URI, or a JSON string.

Structured data items can be defined in the following ways:

  • A single item as a map (a document).
  • A list of items as a list of maps (a list of documents).
  • A URI, supported schemes are kestra for internal storage files, file for host local files, and nsfile for namespace files.
  • A JSON String that will then be serialized either as a single item or a list of items. Each record is a map with id and fields; REMOVE needs only id, and other keys are ignored. Kestra reads a kestra:// file whole into memory before the first record is sent, so split very large files across several runs.

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

Write each record only if its document matches

Vespa's test-and-set condition, in its document selection language with the document type before the field, like music.year==2000. A record whose document doesn't match, or doesn't exist, is a failed record (see failOnError), unless createIfNotExists writes the missing document. One condition for the whole run.

The time allowed to connect to Vespa

Unset uses the Kestra HTTP client's default.

Defaultfalse

Create the document when it doesn't exist

true makes an UPDATE of a missing document create it first (an upsert). With condition, a PUT or UPDATE of a missing document is written without checking the condition. No effect on REMOVE, or on PUT without condition. Default false.

Vespa document type for record keys

With namespace, completes a record id that doesn't start with id: . An id that starts with id: is used as is.

Defaulttrue

Fail the task when a record fails

Default true: the good records are still written, then the task fails naming the first failed ones. false ends the task in WARNING with the failed records in the ION file uri.

Default4096

Most records waiting for Vespa's answer at one time

From 1 to 4096, default 4096 (the feed client's own ceiling). The client still adapts how many it sends below this value; lower it to put less load on Vespa. It doesn't change how much of from the worker holds in memory.

Vespa namespace for record keys

With documentType, completes a record id that doesn't start with id: into id: <namespace>: <documentType>::<id>. An id that starts with id: is used as is.

DefaultPUT
Possible Values
PUTUPDATEREMOVE

What to do with each record

PUT (default) writes the whole document, replacing one with the same ID. UPDATE changes fields of an existing document, with fields in Vespa's update format, like {"album": {"assign": "Kind of Blue"}}; Vespa accepts an update of a missing document and changes nothing, so it counts as a success; set createIfNotExists: true to create it instead. A retried UPDATE with increment applies twice. REMOVE deletes the document; removing a missing one succeeds.

The longest wait for data from Vespa

Defaults to 5 minutes.

Data-plane token

Vespa Cloud data-plane token, sent as a bearer token. Unset or empty sends no token, for a self-hosted Vespa without authentication.

Number of records that failed

Refused by Vespa, invalid (no usable id, no fields) or out of time. A record that ran out of time may still have been applied by Vespa.

Number of records Vespa applied

Formaturi

URI of the failed records

An ION file in Kestra's internal storage, one row per failed record: record (the record as given) and error. To feed them again, read each row's record. Null when nothing failed.

Unitrecords

Records refused, invalid or timed out

Unitrecords

Records Vespa applied