Langflow 1.12 just released!
gradient
  1. Home  /

  2. Blog  /

  3. Langflow Micro Tutorials — Document Truncator

Langflow Micro Tutorials — Document Truncator

Rodrigo Nader

Written by Rodrigo Nader

September 12, 2023

Welcome back to our Langflow micro tutorials series! We’ll continue our journey into very simple Langflow examples, highlighting ideas and the design of custom components.

This article provides a link to download the described flow. Use it to modify and understand the components in use.

Today, we focus on a basic website reading flow that uses a custom component to help truncate documents. Have fun!

Main Features

  • Document Truncator: This is a custom component designed and built from scratch. The primary function of this component is to reduce the text content of a webpage. It does so by retaining only the initial set of characters specified by the truncate_size parameter.

Objective

To help reduce the length of a webpage’s text content to a manageable size before it’s fed into a prompt. Only the beginning portion of the text, up to a specific number of characters, is retained.

For instance, if a webpage has 5,000 characters and the truncate_size is set to 1,000, the Document Truncator will output only the first 1,000 characters from the webpage, discarding the rest.

Notice that this component takes a Langchain Document as input, processes the text inside of it, and outputs a Document again, which is then sent to the Prompt Template.


Download Flow (gist)


Similar Posts

Langflow 1.12 Desktop is now available

Langflow 1.12 Desktop is now available

Langflow Dev Team

Written by Langflow Dev Team

September 16, 2026

Langflow 1.12 Desktop is now available. For the full list of new features, see the OSS release announcement.

Build the next version of Langflow with us

Build the next version of Langflow with us

Langflow Dev Team

Written by Langflow Dev Team

September 3, 2026

We are taking 25 people into early access.

Langflow 1.12 released: OpenTelemetry for service health and flow runs

Langflow 1.12 released: OpenTelemetry for service health and flow runs

Langflow Dev Team

Written by Langflow Dev Team

September 1, 2026

Langflow 1.12 adds OpenTelemetry support for sending OTLP to any compatible backend, without shipping prompts or completions.

Langflow 1.11 Desktop is now available

Langflow 1.11 Desktop is now available

Langflow Dev Team

Written by Langflow Dev Team

August 5, 2026

Langflow 1.11 Desktop is now available. For the full list of new features, see the OSS release announcement.