Elasticsearch · Arazzo Workflow

Elasticsearch Document Lifecycle

Version 1.0.0

Index a document by id, read it back, apply a partial update, and confirm the merged result.

1 workflow 1 source API 1 provider
View Spec View on GitHub AnalyticsDatabaseFull-Text SearchNoSQLSearchArazzoWorkflows

Provider

elasticsearch

Workflows

document-lifecycle
Index, read, partially update, and re-read a single document by id.
Writes a document at a caller-supplied id, verifies the persisted source, merges a partial document into it, and verifies the merged result and the resulting version number.
4 steps inputs: document, id, index, partialUpdate outputs: documentId, finalVersion, mergedSource
1
indexDocument
Index the document at the supplied id. Elasticsearch answers 201 when the document is new and 200 when it replaced an existing document at that id, so both are accepted.
2
readAfterIndex
Read the document straight back to confirm exactly what was persisted before any update is attempted.
3
applyPartialUpdate
Merge the partial document into the stored source. Fields not named in the partial update are left untouched.
4
readAfterUpdate
Read the document a second time to confirm the merge landed and to capture the version Elasticsearch incremented to.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Elasticsearch Document Lifecycle
  summary: Index a document by id, read it back, apply a partial update, and confirm the merged result.
  description: >-
    The core create-read-update loop for a single Elasticsearch document. The
    workflow indexes a document at a known id, reads it back to confirm what was
    persisted, applies a partial update through the _update endpoint, and reads
    it a second time so the caller can see the merged source and the incremented
    version. Reading back after each write is what makes this flow useful as an
    integration test as well as a data path. Every step spells out its request
    inline so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: documentApi
  url: ../openapi/elasticsearch-document-api-openapi.yml
  type: openapi
workflows:
- workflowId: document-lifecycle
  summary: Index, read, partially update, and re-read a single document by id.
  description: >-
    Writes a document at a caller-supplied id, verifies the persisted source,
    merges a partial document into it, and verifies the merged result and the
    resulting version number.
  inputs:
    type: object
    required:
    - index
    - id
    - document
    - partialUpdate
    properties:
      index:
        type: string
        description: The index to write the document into.
      id:
        type: string
        description: The caller-controlled document id.
      document:
        type: object
        description: The full document source to index.
      partialUpdate:
        type: object
        description: The partial document to merge into the existing source.
  steps:
  - stepId: indexDocument
    description: >-
      Index the document at the supplied id. Elasticsearch answers 201 when the
      document is new and 200 when it replaced an existing document at that id,
      so both are accepted.
    operationId: indexDocument
    parameters:
    - name: index
      in: path
      value: $inputs.index
    - name: id
      in: path
      value: $inputs.id
    requestBody:
      contentType: application/json
      payload: $inputs.document
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 201
    outputs:
      documentId: $response.body#/_id
      result: $response.body#/result
      version: $response.body#/_version
  - stepId: readAfterIndex
    description: >-
      Read the document straight back to confirm exactly what was persisted
      before any update is attempted.
    operationId: getDocument
    parameters:
    - name: index
      in: path
      value: $inputs.index
    - name: id
      in: path
      value: $inputs.id
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      found: $response.body#/found
      source: $response.body#/_source
      version: $response.body#/_version
  - stepId: applyPartialUpdate
    description: >-
      Merge the partial document into the stored source. Fields not named in the
      partial update are left untouched.
    operationId: updateDocument
    parameters:
    - name: index
      in: path
      value: $inputs.index
    - name: id
      in: path
      value: $inputs.id
    requestBody:
      contentType: application/json
      payload:
        doc: $inputs.partialUpdate
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      result: $response.body#/result
      version: $response.body#/_version
  - stepId: readAfterUpdate
    description: >-
      Read the document a second time to confirm the merge landed and to capture
      the version Elasticsearch incremented to.
    operationId: getDocument
    parameters:
    - name: index
      in: path
      value: $inputs.index
    - name: id
      in: path
      value: $inputs.id
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      mergedSource: $response.body#/_source
      finalVersion: $response.body#/_version
  outputs:
    documentId: $steps.indexDocument.outputs.documentId
    mergedSource: $steps.readAfterUpdate.outputs.mergedSource
    finalVersion: $steps.readAfterUpdate.outputs.finalVersion

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/elasticsearch-document-lifecycle-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.