Flow.Documentation

Building block: Extract text (regex)

6 steps± 4 minVideoVerified 22 Oct 2026
  1. Step 1 · Open your development environment
  2. Step 2 · Create the building block
  3. Step 3 · Write the pattern
  4. Step 4 · Test with an e-mail
  5. Step 5 · Publish a version
  6. Step 6 · Give it to an agent

Extract text pulls patterns out of text, such as order numbers, postcodes or IBANs, with a regular expression: without code and without AI, so fast and the same every time. This kind of building block comes from a plugin; plugins can add their own kinds to the toolbox this way.

Watch the whole guide as a video6 steps in one film
Step 1 / 6

Open your development environment

In the portal, under Environments, click Development, and there Open. Flow opens in a new tab and you are signed in straight away.

  1. Click Development
Open your development environment · Click Development
  1. Click Open ↗
Open your development environment · Click Open ↗
Step 2 / 6

Create the building block

Click + next to General and choose Extract text (regex). Under Definition give it a name and a description. The input field text is already there: the text to search.

  1. Click Add to General
Create the building block · Click Add to General
  1. Click Extract text (regex)
Create the building block · Click Extract text (regex)
  1. In Name, type Find order numbers
  2. In Description, type Finds order numbers (ORD- and four digits) in a text.
Create the building block · In Name, type Find order numbers; In Description, type Finds order numbers (ORD- and four digits) in a text.
Create the building block · The input field text.
Step 3 / 6

Write the pattern

Under Settings you write the regular expression. ORD-\d{4} means: ORD-, followed by exactly four digits. Save the draft; Flow refuses an expression that is not valid straight away.

  1. Click Settings
Write the pattern · Click Settings
  1. In Regular expression, type ORD-\d{4}
Write the pattern · In Regular expression, type ORD-\d{4}
  1. Click Save draft
Write the pattern · Click Save draft
Step 4 / 6

Test with an e-mail

Under Test, paste a sample text and click Run test. You see the matches and their count. ORD-12 does not count: that is only two digits.

  1. Click Test
Test with an e-mail · Click Test
  1. Click Code
Test with an e-mail · Click Code
  1. In Input, type {"text": "Good afternoon, could you check the status of ORD-1042 and ORD-1077? Order number ORD-12 is wrong, sorry."}
Test with an e-mail · In Input, type {"text": "Good afternoon, could you check the status of ORD-1042 and ORD-1077? Order number ORD-12 is wrong, sorry."}
  1. Click ▷ Run test
Test with an e-mail · Click ▷ Run test
Test with an e-mail · In the logs: 2 matches.
Test with an e-mail · The matches ORD-1042 and ORD-1077.
Step 5 / 6

Publish a version

Publish a fixed version; workflows use it as a Building block step, agents as a tool.

  1. Click Publish version →
Publish a version · Click Publish version →
Publish a version · Version v1 is published and active.
Step 6 / 6

Give it to an agent

Open an agent and tick the building block under Brain → Tools. Set it to Reads with the button next to it: it changes nothing, so the agent may use it even without write rights.

  1. Click Agents
Give it to an agent · Click Agents
  1. Click the agent ‘Mail sorter’
Give it to an agent · Click the agent ‘Mail sorter’
  1. Click Find order numbers
Give it to an agent · Click Find order numbers
  1. Click Save
Give it to an agent · Click Save
Give it to an agent · The building block is on as one of the agent's tools.
  1. Click Changes → Reads
Give it to an agent · Click Changes → Reads
  1. Click Save
Give it to an agent · Click Save
Give it to an agent · The building block is on as a reading tool.

This guide was carried out step by step on 22 Oct 2026 by an automated test on Flow (version 3e563176).