Serialization HtmlToMarkdown

Serialization HtmlToMarkdown

Certified

Convert an HTML file from Kestra internal storage into Markdown format

Useful for LLM processing and RAG pipelines where HTML is too verbose — Markdown conveys the same structure with significantly fewer tokens.

yaml
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown

Fetch a web page and convert it to Markdown.

yaml
id: web_to_markdown_pipeline
namespace: company.team

tasks:
  - id: fetch_html
    type: io.kestra.plugin.core.http.Request
    uri: "https://kestra.io/docs"

  - id: write_html
    type: io.kestra.plugin.core.storage.Write
    content: "{{ outputs.fetch_html.body }}"
    extension: ".html"

  - id: convert_to_md
    type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown
    from: "{{ outputs.write_html.uri }}"

  - id: log_result
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.convert_to_md.uri }}"

Convert HTML file to Markdown with custom options.

yaml
id: html_to_md_custom
namespace: company.team

tasks:
  - id: write_html
    type: io.kestra.plugin.core.storage.Write
    content: "<h1>Hello</h1><p>This is <strong>bold</strong> text.</p>"
    extension: ".html"

  - id: convert
    type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown
    from: "{{ outputs.write_html.uri }}"
    ignoreTags:
      - script
      - style
      - nav
Properties

Source file URI

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

Base URI for resolving relative links

When provided, relative URLs in the HTML (e.g., href and src attributes) will be resolved to absolute URLs using this base URI.

SubTypestring

List of HTML tags to ignore during conversion

Tags specified in this list will be skipped during the conversion process. Common tags to ignore include 'script', 'style', 'nav', etc.

Formaturi

URI of the generated Markdown file in Kestra's internal storage

Number of bytes generated