New260+ blocks and 240+ tools are now fully documented
Tool

Elasticsearch

Search, index, and manage documents in Elasticsearch clusters

Search, index, and manage documents in Elasticsearch — the distributed full-text search and analytics engine. Use it to power keyword and JSON-query searches, ingest documents into indices, retrieve or delete specific records, and run bulk operations across your cluster.

Overview

PropertyValue
Typeelasticsearch
CategoryTool — Database
AuthAPI Key (optional; passed as ApiKey header)

Operations

OperationTool IDDescription
Searchelasticsearch_searchSearch documents in an index using an Elasticsearch query DSL object
Index Documentelasticsearch_indexCreate or replace a document in an index (auto-generates an ID when none is provided)
Get Documentelasticsearch_getRetrieve a single document by its ID
Delete Documentelasticsearch_deleteDelete a document from an index by its ID
Bulk Operationselasticsearch_bulkPerform multiple index, delete, or update operations in one NDJSON request
List Indiceselasticsearch_list_indicesList all indices in the cluster with their metadata

Configuration

SettingTypeRequiredDescription
urlstringYesElasticsearch base URL, e.g. https://my-cluster.es.io:9200. Used by every operation.
apiKeystring (secret)NoElasticsearch API key for authentication. Sent as Authorization: ApiKey <key>. Omit when the cluster allows anonymous access.
indexstringYes (all except Bulk and List Indices)Name of the target index.
documentIdstringYes (Get, Delete); No (Index)ID of the document to retrieve, delete, or overwrite. If omitted for Index Document, Elasticsearch auto-generates an ID.
querystringYes (Search)Elasticsearch query as a JSON string, e.g. {"match": {"title": "hello"}}. Parsed and sent inside the query key of the request body.
sizenumberNo (Search)Maximum number of results to return. Defaults to 10.
documentstringYes (Index Document)Document body as a JSON string, e.g. {"title": "hello", "score": 42}.
bodystringYes (Bulk Operations)Full NDJSON payload for the _bulk API. Each line must be a valid JSON object; action lines and source lines alternate.

Outputs

FieldTypeDescription
hitsjsonArray of matching document objects returned by Elasticsearch
totalnumberTotal number of documents that matched the query
tooknumberTime in milliseconds Elasticsearch spent executing the search

Index Document (elasticsearch_index)

FieldTypeDescription
idstringID assigned to the indexed document
indexstringName of the index the document was written to
resultstringOutcome string from Elasticsearch (created or updated)

Get Document (elasticsearch_get)

FieldTypeDescription
idstringID of the retrieved document
indexstringName of the index the document was retrieved from
sourcejsonFull _source body of the document

Delete Document (elasticsearch_delete)

FieldTypeDescription
idstringID of the deleted document
indexstringName of the index the document was deleted from
resultstringOutcome string from Elasticsearch (deleted)

Bulk Operations (elasticsearch_bulk)

FieldTypeDescription
tooknumberTime in milliseconds for the bulk request
errorsbooleanWhether any individual operation in the batch had an error
itemsjsonArray of per-operation result objects, one per action line in the NDJSON body

List Indices (elasticsearch_list_indices)

FieldTypeDescription
indicesjsonArray of index metadata objects returned by the _cat/indices API

Example

[Starter] → [Elasticsearch: Search] → [Agent: summarize the results]

Connect the Starter block to an Elasticsearch block configured with url set to {{ELASTICSEARCH_URL}} and apiKey set to {{ELASTICSEARCH_API_KEY}}. Set the index to products and pass the query as {"match": {"description": "{{starter.input}}"}}. The Agent block receives {{elasticsearch.hits}} and {{elasticsearch.total}} and produces a human-readable summary of the matching products.

Tips

  • API Key is optional — if your Elasticsearch cluster is open (e.g. a local dev node), leave apiKey blank. For Elastic Cloud or any secured deployment, generate an API key in Kibana under Stack Management > API keys and store it as a workflow secret referenced via {{ELASTICSEARCH_API_KEY}}.
  • Use Bulk Operations for high-throughput ingestion — instead of looping the Index Document operation, build an NDJSON body and send it in one elasticsearch_bulk call. Check the errors output and inspect items to identify any partial failures.
  • Query DSL must be valid JSON — the query param is parsed with JSON.parse before being sent, so double-check the JSON syntax. A minimal match-all query is {"match_all": {}}.
  • Index Document auto-ID vs explicit ID — omit documentId to let Elasticsearch assign a unique ID (uses POST /_doc); provide documentId to upsert by a known key (uses PUT /_doc/<id>). The result output tells you whether the document was created or updated.