AgentLoops
AI Nodes

Extract Data

Extract structured data from unstructured text using AI.

Extract Data

The Extract Data node uses AI to extract structured information from unstructured text. Define the fields you want to extract, and the AI will parse the input and return a structured object or array.

Overview

Use the Extract Data node when you need to:

  • Parse emails, documents, or messages for specific information
  • Convert unstructured text into structured data
  • Extract multiple data points from a single input
  • Build data pipelines that process text content

Configuration

FieldTypeRequiredDescription
modelstringYesThe AI model to use for extraction.
fieldsarrayYesList of fields to extract from the input.
isListbooleanNoWhen enabled, extracts multiple items as an array. Default: false.

Field Configuration

Each field in the fields array has the following properties:

PropertyTypeRequiredDescription
namestringYesThe field name (must be a valid identifier: start with letter/underscore, alphanumeric only).
typestringYesThe data type: "text", "number", or "boolean".
descriptionstringYesDescription of what to extract. Be specific for better accuracy.

Loop Mode

When isList is disabled, the Extract Data node supports Loop Mode:

FieldTypeDefaultDescription
loopModebooleanfalseEnable to process each item in an array input separately.
maxIterationsnumber100Maximum number of iterations when loop mode is enabled.
concurrencynumber1Number of parallel executions.
onErrorstring"stop"Error handling: "stop" or "continue".

Note: Loop Mode is automatically disabled when isList is enabled, as the node already handles multiple extractions.

Inputs

The Extract Data node accepts inputs from connected upstream nodes. All connected inputs are automatically concatenated and processed together.

Output

Single Object Mode (isList: false)

VariableTypeDescription
resultobjectAn object containing the extracted fields.

Access individual fields using dot notation: result.fieldName

List Mode (isList: true)

VariableTypeDescription
resultarrayAn array of objects, each containing the extracted fields.

Example Use Cases

Contact Information Extraction

Fields:

NameTypeDescription
nametextThe person's full name
emailtextEmail address
phonetextPhone number
companytextCompany or organization name

Input:

Hi, I'm John Smith from Acme Corp. You can reach me at john.smith@acme.com or call 555-123-4567.

Output:

{
  "name": "John Smith",
  "email": "john.smith@acme.com",
  "phone": "555-123-4567",
  "company": "Acme Corp"
}

Order Details Extraction (List Mode)

Fields:

NameTypeDescription
producttextProduct name
quantitynumberNumber of items ordered
pricenumberPrice per unit

Input:

Order contains: 2x Widget Pro ($29.99 each), 5x Basic Widget ($9.99 each), 1x Premium Widget ($49.99)

Output:

[
  { "product": "Widget Pro", "quantity": 2, "price": 29.99 },
  { "product": "Basic Widget", "quantity": 5, "price": 9.99 },
  { "product": "Premium Widget", "quantity": 1, "price": 49.99 }
]

Sentiment Analysis Fields

Fields:

NameTypeDescription
sentimenttextOverall sentiment: positive, negative, or neutral
confidencenumberConfidence score from 0 to 100
keyPhrasestextMain topics or phrases mentioned

Best Practices

  1. Write clear field descriptions: The AI uses descriptions to understand what to extract. Be specific about format and content.

  2. Use appropriate data types: Choose number for numeric values, boolean for yes/no fields, and text for everything else.

  3. Valid field names: Field names must start with a letter or underscore and contain only alphanumeric characters (e.g., customerName, order_id).

  4. Use List Mode for multiple items: When extracting multiple similar items (like order line items), enable isList instead of creating separate fields.

  5. Test edge cases: Verify extraction works with variations in input format and missing data.

On this page