Structured Output (STRUCTURED_OUTPUT)

Lets an AI model pull data out of free text and pass it on as a structured list — for example all orders mentioned in an email, each with date and amount.

Category: Data Sources · Deployed: yes · Tool-capable: no

Ports

Port Kind Purpose

Text (in_text)

Input

The free text to read

Result (out_result)

Output

A JSON list of the extracted items

Properties

Use Select AI Server & Model to fill in all model fields at once.

Field Required Meaning

Input (inputText)

No

Meant as a text to use when no previous module sends one. Currently it has no effect — the module always reads the previous module’s result

Model Provider (model.provider)

Yes

OLLAMA, OPEN_AI, ANTHROPIC or GEMINI

Model Name (model.name)

Yes

The model, for example qwen3:latest or gpt-4o

Model URL (model.url)

Yes

The address of the model server, for example localhost:11434. For ANTHROPIC and GEMINI the provider’s own address is used, but the field must still be filled in. localhost and 127.0.0.1 are changed to host.docker.internal, so the agent server’s container reaches your computer

API Key (model.apiKey)

No

Needed for OPEN_AI, ANTHROPIC and GEMINI. Leave empty for OLLAMA. Not part of an export

Model Timeout (min) (model.timeoutMinutes)

No

How long to wait for one answer of the model, 1–120 minutes. Default: 20. Higher → long texts can finish. Lower → a stuck call fails sooner

Expected JSON Schema (jsonSchema)

No

The shape every list entry must have, as a JSON Schema (which fields, which types). With a schema → every entry has the same fields, so the next modules can rely on them. Empty → the model chooses the fields itself, and they can differ between runs

How it works

The model gets the text with the instruction to put the relevant items into a JSON list. There is no field for your own instruction — the schema is how you say what to extract. Field names and descriptions in the schema guide the model.

  • Without a schema, any JSON list the model writes is accepted.

  • With a schema, every entry is checked against it. If the model’s first answer does not fit, it gets the errors and one more try. If that also fails, the run stops with an error.

  • If the model finds nothing, the result is []. An empty input also gives [], without a model call.

  • If the model answers without any JSON list, the run stops with an error.

Example schema for orders:

{
  "type": "object",
  "properties": {
    "date":   { "type": "string", "description": "order date, YYYY-MM-DD" },
    "amount": { "type": "number" }
  },
  "required": ["date", "amount"]
}

Use cases

  • Turning prose into rows: an email or report becomes a list you can process entry by entry.

  • Before a check: produce JSON, so a Validator in CONDITION mode has a field to test.

  • One shape for varied input: different documents become entries with the same fields.

Notes

Without a schema, field names can change between runs, and later modules fail silently. A Validator or Template that expects a fixed name then quietly stops working. Set an Expected JSON Schema whenever a later module uses the field names.

  • An invalid schema stops the whole pipeline. If the Expected JSON Schema is not valid JSON, the agent server refuses the pipeline when it is registered.

  • The result is always a list, even for a single item. Use Iterator to handle the entries one by one.

  • This is a model call, with its cost and waiting time — with a schema, up to three calls. For mechanical reshaping, a Python Script is cheaper and gives the same result every time.