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

Langflow 1.10 released: Assistant flow building, Memory bases, DB Providers, internationalization, and more

Langflow 1.10 released: Assistant flow building, Memory bases, DB Providers, internationalization, and more

Langflow Dev Team

Written by Langflow Dev Team

June 9, 2026

Langflow 1.10 expands Langflow Assistant to build entire flows, introduces Memory bases for long-term semantic memory, adds configurable vector database backends, brings the interface to seven languages, and more.

Scaling Langflow: Unlocking Massive Memory Savings and Bulletproof Reliability

Scaling Langflow: Unlocking Massive Memory Savings and Bulletproof Reliability

Langflow Dev Team

Written by Langflow Dev Team

June 9, 2026

The Langflow engineering team breaks down a comprehensive package of memory and stability enhancements spanning v1.9.0 through v1.10.0—achieving an ~89% reduction in memory consumption through dependency pruning, worker lifecycle management, and advanced Linux Copy-on-Write techniques.

Langflow Policies: Turning Natural-Language Rules into Guarded Tools

Langflow Policies: Turning Natural-Language Rules into Guarded Tools

Langflow Dev Team

Written by Langflow Dev Team

May 20, 2026

Langflow's new Policies feature compiles natural-language business rules into deterministic guards around agent tools—so policy violations are caught before they happen, not after.