
Serialization HtmlToMarkdown
CertifiedConvert an HTML file from Kestra internal storage into Markdown format
Serialization HtmlToMarkdown
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.
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdownExamples
Fetch a web page and convert it to Markdown.
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.
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
from *string
Source file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150baseUri string
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.
ignoreTags array
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.
Outputs
uri string
uriURI of the generated Markdown file in Kestra's internal storage
Metrics
bytes counter
Number of bytes generated