Langflow 1.11 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.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.

Langflow 1.11.0: Multi-Vector Retrieval is Here with NextPlaid

Langflow Dev Team

Written by Langflow Dev Team

July 23, 2026

Langflow 1.11.0 ships first-class multi-vector retrieval with the lfx-nextplaid extension bundle—ColBERT-style late interaction and ColPali-style visual document retrieval out of the box.

Langflow 1.11 released: Human-in-the-Loop, A2A protocol support, AG-UI streaming, and more

Langflow 1.11 released: Human-in-the-Loop, A2A protocol support, AG-UI streaming, and more

Langflow Dev Team

Written by Langflow Dev Team

July 22, 2026

Langflow 1.11 adds Human-in-the-Loop checkpoints, A2A protocol support, AG-UI streaming for the Workflow API, and more.

Langflow 1.10 Desktop is now available

Langflow 1.10 Desktop is now available

Langflow Dev Team

Written by Langflow Dev Team

June 18, 2026

Langflow 1.10 Desktop is now available. For the full list of new features and platform updates in 1.10, see the OSS release announcement.