Skip to main content
This example demonstrates how to take a list of raw lead notes and enrich them with structured data like industry, company size, and recommended follow-up actions.

The Scenario

You have a list of potential leads with unstructured notes. You want to turn this:
“Signed up after webinar, growth-stage SaaS, 80 employees. Wants a live demo next week.”
Into this:

Implementation

1. Define the Schema

First, we define the structure of the data we want to extract.

2. Create the Function

We use createArrayFn because we want to process multiple leads at once.

3. Prepare Data

Each row needs a unique identifier (primary key).

4. Execute and Handle Results

Why this is powerful

  1. Structured Data: You didn’t have to write regex or complex parsing logic.
  2. Type Safety: The leadInsights object is fully typed in your IDE.
  3. Caching: If you run this again with the same leads, Nuabase returns the cached results instantly for free.