Skip to content

Extraction & Structured Output

Flow-Like’s AI extractors use a configured model and a runtime schema to turn free-form content into structured JSON. The model must return the extraction through a required tool call, and the result is validated against the schema before the node succeeds.

InputNode
Free-form textAI Extractor
Model-compatible conversation historyAI Extractor from History
One document requiring text and image-aware extractionAI Extract Document
Several documentsAI Extract Documents
Predictable document content without AI enhancementExtract Document

The AI Extractor nodes accept:

  • a configured model;
  • a JSON Schema or example JSON;
  • the text or history;
  • an optional extraction hint.

They return the validated JSON value plus model usage statistics. The configured model must support the required tool or function call behavior.

NeedRecommended boundary
Classify one messageExtract a small enum and confidence explanation fields
Parse a ticket or emailExtract the normalized fields from the message body
Process a scanned invoiceExtract document text, then extract the invoice schema
Summarize a conversation into CRM fieldsUse the history extractor
Extract repeated rowsUse an array item schema and validate each item
Pull known fields from clean JSONUse deterministic JSON parsing instead of a model

Use deterministic parsing, regular expressions, or native document nodes when the source has a reliable contract. Model extraction is most useful when wording or layout varies.

A JSON Schema gives direct control over required fields, enums, nullability, and nested objects:

{
"type": "object",
"properties": {
"ticket_id": {
"type": "string",
"description": "The support ticket identifier exactly as written"
},
"priority": {
"type": "string",
"enum": ["low", "medium", "high", "urgent"]
},
"customer_email": {
"type": ["string", "null"],
"description": "Customer email, or null when none is present"
},
"summary": {
"type": "string"
}
},
"required": ["ticket_id", "priority", "customer_email", "summary"],
"additionalProperties": false
}

The extractor also accepts example JSON and infers a schema from it:

{
"vendor": "Example Ltd.",
"invoice_number": "INV-1007",
"currency": "EUR",
"total": 1280.5,
"line_items": [
{
"description": "Consulting",
"quantity": 8,
"unit_price": 160
}
]
}

Use an explicit JSON Schema for production contracts. An example is convenient for prototyping but cannot express every validation rule or missing-value decision.

If a field may be absent in the source, allow null and describe when it should be used. Do not ask the model to guess a value to satisfy a required field.

Use enum for a controlled set such as status, priority, or document type. Add a safe fallback category only when the downstream process can handle it.

Field descriptions should say whether to:

  • copy text exactly;
  • normalize casing or whitespace;
  • convert a date or amount;
  • infer from context;
  • return null when unsupported.

Start with the fields needed for the next operation. Deeply nested schemas make failures harder to diagnose and increase the chance that the model fills gaps with plausible-looking values.

Decide whether identifiers are strings or numbers, how currencies are represented, and which date format downstream nodes expect. Do not change types based on what one example happens to contain.

  1. read or extract the source content;
  2. retain a source identifier and location;
  3. select the configured model;
  4. pass the schema, content, and a narrow hint to the extractor;
  5. validate business rules that JSON Schema cannot express;
  6. route invalid or uncertain results to review;
  7. store the structured data with provenance and model configuration.

For a document, use the native or AI-assisted document reader first. The schema extractor works on text or history, while the document reader handles the file format and visual content.

Schema validation confirms shape, not truth. Add deterministic checks:

  • totals reconcile with line items;
  • dates fall in an acceptable range;
  • identifiers match the expected pattern;
  • email or URL syntax is valid;
  • enum combinations are permitted;
  • required source evidence exists;
  • duplicate records are detected;
  • high-impact fields are confirmed by a reviewer when needed.

Preserve the original value when normalization could make an audit difficult.

Use the optional hint for one narrow instruction that complements the schema, such as:

  • extract only individual line items, not subtotal rows;
  • use the email sender as the customer only when the body does not name one;
  • keep all quoted legal text verbatim;
  • classify from the supplied categories without creating new ones.

Do not duplicate a long system prompt in the hint. Put constraints in field descriptions and workflow validation where they can be reviewed precisely.

PatternExample fields
Contactname, organization, email, phone
Support ticketcategory, priority, affected product, summary
Invoicevendor, invoice number, dates, currency, line items, totals
Meetingattendees, decisions, action items, owners, due dates
Sentimentlabel, evidence excerpt, review flag
Document classificationdocument type, key identifiers, confidence explanation

For subjective outputs such as sentiment, include the evidence excerpt or rationale field needed for review. Do not represent a model-generated probability as calibrated confidence unless it has been validated as such.

Retrieve a small set of relevant passages, then extract a schema from those passages. Keep source references attached so each structured field can be audited. See RAG and knowledge bases.

Expose extraction as a bounded function tool when an agent may choose to structure content. The tool should still validate schema and authorization outside the model. See AI agents.

Use AI Extractor from History to convert an intake conversation into typed workflow data. Ask a structured follow-up when a required field is missing instead of inventing it. See Chat and conversations.

  • Send only necessary source content to the configured model.
  • Redact or mask sensitive fields before extraction when the task permits.
  • Record provider, model, schema version, and usage with the run.
  • Do not log entire documents or extracted personal data by default.
  • Define retention for source files and structured outputs.
  • Keep a review path for high-impact or low-quality records.
SymptomCheck
Model does not return structured dataTool/function-call support, model configuration
Schema input failsValid JSON, valid JSON Schema, non-empty input
Missing fieldsSource evidence, nullability, descriptions, schema size
Extra invented fieldsadditionalProperties, field descriptions, validation
Wrong typesExplicit schema types and normalization rules
Inconsistent valuesEnum constraints, examples, deterministic business checks