Apache Tika Parse

Apache Tika Parse

Certified

Parse files with Apache Tika

Auto-detects MIME type, extracts text and metadata, and can capture embedded files. Defaults to XHTML content, no OCR, and stores the parsed Ion payload to internal storage unless store is false. OCR on images requires Tesseract to be installed on the Kestra host; without it, image parsing falls back to metadata extraction only.

yaml
type: io.kestra.plugin.tika.Parse

Extract text and embedded files from an upload.

yaml
id: tika_parse_file
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: parse
    type: io.kestra.plugin.tika.Parse
    from: "{{ inputs.file }}"
    extractEmbedded: true
    store: false

  - id: log_embedded
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.parse.result.embedded }}"

Extract text from an image using OCR (requires Tesseract on the Kestra host).

yaml
id: tika_parse_image_ocr
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: parse
    type: io.kestra.plugin.tika.Parse
    from: "{{ inputs.file }}"
    ocrOptions:
      strategy: OCR_AND_TEXT_EXTRACTION
    store: true

Download and extract image metadata using Apache Tika.

yaml
id: parse-image-metadata-using-apache-tika
namespace: company.team

tasks:
  - id: get_image
    type: io.kestra.plugin.core.http.Download
    uri: https://kestra.io/cdn-cgi/image/onerror=redirect,width=1080,height=608,fit=cover,format=webp/_astro/main.C_OjFrVt.jpg

  - id: tika
    type: io.kestra.plugin.tika.Parse
    from: "{{ outputs.get_image.uri }}"
    store: false
    contentType: TEXT
    ocrOptions:
      strategy: OCR_AND_TEXT_EXTRACTION

  - id: log_metadata
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.tika.result.metadata }}"

Download a PDF file and extract text from it using Apache Tika.

yaml
id: parse-pdf
namespace: company.team

tasks:
  - id: download_pdf
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/resolve/main/pdf/app_store.pdf

  - id: parse_text
    type: io.kestra.plugin.tika.Parse
    from: "{{ outputs.download_pdf.uri }}"
    contentType: TEXT
    store: false

  - id: log_extracted_text
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.parse_text.result.content }}"
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-tika --compatible-for $KESTRA_VERSION

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

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

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

Character write limit

Maximum characters when writing TEXT content; -1 (default) disables the limit.

DefaultXHTML
Possible Values
TEXTXHTMLXHTML_NO_HEADER

Output content format

Choose TEXT, XHTML (default), or XHTML_NO_HEADER. charactersLimit applies only to TEXT.

Defaultfalse

Extract embedded files

If true, inline/embedded resources are saved to internal storage and returned in embedded; default is false.

Source file to parse

Internal storage URI (e.g. kestra://...).

Default{ "strategy": "NO_OCR" }

Custom OCR options

OCR options for image parsing. To extract text from images, Tesseract must be installed on the Kestra host (apt-get install tesseract-ocr). Without Tesseract, images are parsed with ImageParser and only metadata is returned regardless of the strategy. Default strategy is NO_OCR.

Definitions
enableImagePreprocessingbooleanstring

Enable image preprocessing

Apache Tika will run preprocessing of images (rotation detection and image normalizing with ImageMagick) before sending the image to Tesseract if the user has included dependencies (listed below) and if the user opts to include these preprocessing steps.

languagestring

Language used for OCR

Tesseract language code (e.g. eng, fra).

strategystring
DefaultNO_OCR
Possible Values
AUTONO_OCROCR_ONLYOCR_AND_TEXT_EXTRACTION

OCR strategy

Requires Tesseract and language packs. Default is NO_OCR; use OCR_AND_TEXT_EXTRACTION to merge OCR and text extraction.

Defaulttrue

Store parsed payload to internal storage

When true (default), writes the parsed Ion file to internal storage and returns its URI; when false, emits the result inline.

Parsed result with extracted text and metadata

Definitions
contentstring
embeddedobject
SubTypestring
metadataobject
Formaturi

URI of the extracted content in Kestra's internal storage