On this page
Sommatic Docs
Open portal

Azure - AI Document Intelligence

Execute layout analysis, form understanding, and structured extraction on complex documents using Microsoft Azure AI Document Intelligence (formerly Azure Form Recognizer).

View as Markdown
Open in
Integrations Available integrations.microsoft.azure.document-intelligence Version 1.0.0 Execution: async

Analyzes a document with Azure AI Document Intelligence using your own resource and returns its text, tables and key-value pairs. Routes to empty when no text is found.

Authenticates with your own Azure resource via connection_id (api-key credential with endpoint metadata); execution costs are billed by Azure to your subscription.

Operations (prebuilt and custom models):

  • prebuilt-layout (default): full page structure — paragraphs, tables, selection marks, reading order.
  • prebuilt-document: generic key-value and entity extraction across arbitrary forms.
  • prebuilt-invoice: typed schema for invoice fields (vendor, totals, line items, dates).
  • prebuilt-receipt: typed schema for retail receipts (merchant, totals, taxes, items).
  • prebuilt-tax.us.w2: typed schema for U.S. W-2 tax forms.
  • prebuilt-id: typed schema for government-issued identification documents.
  • prebuilt-healthInsuranceCard.us: typed schema for U.S. health insurance cards.
  • prebuilt-read: page-level OCR with handwriting and multi-language support.
  • custom-: user-trained models for specific document templates.

How it works

  1. Resolves the node config. Reads content_base64 or file_path from the config first and then from the incoming item.
  2. Requires connection_id and one of content_base64 or file_path.
  3. Resolves the credential on the server: the secret must contain apiKey (or api_key) and the endpoint is read from the credential config (endpoint) or from the secret.
  4. Runs a Python process that calls begin_analyze_document with model (default prebuilt-layout) and the optional pages range, and waits for the analysis to finish.
  5. Builds { text, chars, empty, method, metadata, tables, key_value_pairs }. Tables become grids of cell text (rows) with the page of their first region.
  6. Chooses empty when the trimmed text is empty, otherwise extracted.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-read-invoice",
  "label": "Read invoice",
  "operator_slug": "integrations.microsoft.azure.document-intelligence",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "model": "prebuilt-layout",
    "pages": "1-3"
  }
}

Configuration

connection_id string Required

Connection credential with endpoint + api-key for your Azure AI Document Intelligence resource.

model string Optional

Azure AI Document Intelligence model identifier. Use a built-in prebuilt model or a custom trained model id (custom-<id>).

Default: prebuilt-layout

Allowed values: prebuilt-layoutprebuilt-invoiceprebuilt-receiptprebuilt-tax.us.w2prebuilt-idDocumentprebuilt-healthInsuranceCard.usprebuilt-read

pages string Optional Accepts expressions

Optional page range filter (e.g. "1-3"). Leave empty for all pages.

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

connection_id
Use an object credential whose secret holds apiKey and endpoint (or put endpoint in the credential config).
model
Passed through unchanged, so any model id your resource supports works, including custom models, not only the listed ones.
content_base64 Read by the code, not declared
Undeclared in the config schema; normally comes from the incoming item. file_path works the same way and wins only when content_base64 is absent.
execution
Only timeout_ms is read (default 300000). The retry settings are not applied.

Output ports

extracted default

The analysis returned text.

Data
{
  "text": "INVOICE 2026-0418\nTotal: 129.99 USD",
  "chars": 35,
  "empty": false,
  "method": "azure-document-intelligence:prebuilt-layout",
  "metadata": {
    "model_id": "prebuilt-layout",
    "pages_analyzed": 1,
    "tables_count": 1,
    "key_value_pairs_count": 0
  },
  "tables": [
    {
      "page": 1,
      "rows": [
        [
          "Item",
          "Amount"
        ],
        [
          "Service",
          "129.99"
        ]
      ]
    }
  ],
  "key_value_pairs": []
}
empty

The analysis succeeded but found no text (for example a blank or image-only page with a model that does not read it).

Data
{
  "text": "",
  "chars": 0,
  "empty": true,
  "method": "azure-document-intelligence:prebuilt-layout",
  "metadata": {
    "model_id": "prebuilt-layout",
    "pages_analyzed": 1,
    "tables_count": 0,
    "key_value_pairs_count": 0
  },
  "tables": [],
  "key_value_pairs": []
}
error

Validation, credential resolution, the Python process or the Azure call failed. Python failures include its stderr.

Data
{
  "error": "Python timed out after 300000ms",
  "stderr": ""
}

In expressions

What a later node can read from this node's output with $("Azure - AI Document Intelligence").item.json.<path> (write your node's label instead of Azure - AI Document Intelligence). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through extracted, from the output shown in Ports.

ExpressionEditorWorker
$("Azure - AI Document Intelligence").item.json.textstring= "INVOICE 2026-0418\nTotal: 129.99 USD"
$("Azure - AI Document Intelligence").item.json.charsnumber= 35
$("Azure - AI Document Intelligence").item.json.emptyboolean= false
$("Azure - AI Document Intelligence").item.json.methodstring= "azure-document-intelligence:prebuilt-layout"
$("Azure - AI Document Intelligence").item.json.metadataobject= {…}
$("Azure - AI Document Intelligence").item.json.tablesarray= […] (1)
$("Azure - AI Document Intelligence").item.json.key_value_pairsarray= […] (0)
$("Azure - AI Document Intelligence").item.json.metadata.model_idstringNot suggested by the editor= "prebuilt-layout"—
$("Azure - AI Document Intelligence").item.json.metadata.pages_analyzednumberNot suggested by the editor= 1—
$("Azure - AI Document Intelligence").item.json.metadata.tables_countnumberNot suggested by the editor= 1—
$("Azure - AI Document Intelligence").item.json.metadata.key_value_pairs_countnumberNot suggested by the editor= 0—

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
connection_id is required. error No credential configured.
Either content_base64 or file_path is required. error The incoming item carries neither field. Also returned by Python when file_path does not exist on the orchestrator.
connection must provide endpoint + apiKey error The credential secret is not an object with apiKey, or no endpoint is stored. A plain string api-key secret does not work.
Python timed out after <ms>ms error The analysis took longer than execution.timeout_ms (default 300000).
Failed to resolve connection <connection_id>: <detail> error The credential does not exist or the backend could not be reached.

Input contract

content_base64 string Optional
file_path string Optional

Output contract

text string Optional
chars number Optional
empty boolean Optional
method string Optional
metadata object Optional
tables array Optional
key_value_pairs array Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "integrations.microsoft.azure.document-intelligence",
  "name": "Azure - AI Document Intelligence",
  "category": "integrations",
  "group": [
    {
      "key": "microsoft",
      "name": "Microsoft",
      "icon_url": "/icons/integrations/microsoft/microsoft.svg"
    },
    {
      "key": "foundry",
      "name": "Microsoft Foundry",
      "icon_url": "/icons/integrations/microsoft/foundry.webp"
    }
  ],
  "icon_url": "/icons/integrations/microsoft/microsoft.svg",
  "version": "1.0.0",
  "description": "Execute layout analysis, form understanding, and structured extraction on complex documents using Microsoft Azure AI Document Intelligence (formerly Azure Form Recognizer).\n\n  Authenticates with your own Azure resource via `connection_id` (api-key credential with `endpoint` metadata); execution costs are billed by Azure to your subscription.\n\n  **Operations (prebuilt and custom models):**\n  - **prebuilt-layout** (default): full page structure — paragraphs, tables, selection marks, reading order.\n  - **prebuilt-document:** generic key-value and entity extraction across arbitrary forms.\n  - **prebuilt-invoice:** typed schema for invoice fields (vendor, totals, line items, dates).\n  - **prebuilt-receipt:** typed schema for retail receipts (merchant, totals, taxes, items).\n  - **prebuilt-tax.us.w2:** typed schema for U.S. W-2 tax forms.\n  - **prebuilt-id:** typed schema for government-issued identification documents.\n  - **prebuilt-healthInsuranceCard.us:** typed schema for U.S. health insurance cards.\n  - **prebuilt-read:** page-level OCR with handwriting and multi-language support.\n  - **custom-<id>:** user-trained models for specific document templates.",
  "capabilities": [
    "document-intelligence",
    "ocr",
    "forms",
    "tables",
    "layout",
    "azure",
    "cloud"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string",
        "title": "Azure AI Document Intelligence Credential",
        "description": "Connection credential with endpoint + api-key for your Azure AI Document Intelligence resource.",
        "ui_widget": "connection_picker",
        "ui_options": {
          "credential_types": [
            "api-key",
            "object"
          ],
          "providers": [
            "azure"
          ]
        }
      },
      "model": {
        "type": "string",
        "title": "Model",
        "enum": [
          "prebuilt-layout",
          "prebuilt-invoice",
          "prebuilt-receipt",
          "prebuilt-tax.us.w2",
          "prebuilt-idDocument",
          "prebuilt-healthInsuranceCard.us",
          "prebuilt-read"
        ],
        "default": "prebuilt-layout",
        "description": "Azure AI Document Intelligence model identifier. Use a built-in prebuilt model or a custom trained model id (custom-<id>)."
      },
      "pages": {
        "type": "string",
        "title": "Pages",
        "description": "Optional page range filter (e.g. \"1-3\"). Leave empty for all pages.",
        "format": "expression"
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    },
    "required": [
      "connection_id"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "content_base64": {
        "type": "string"
      },
      "file_path": {
        "type": "string"
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string"
      },
      "chars": {
        "type": "number"
      },
      "empty": {
        "type": "boolean"
      },
      "method": {
        "type": "string"
      },
      "metadata": {
        "type": "object"
      },
      "tables": {
        "type": "array"
      },
      "key_value_pairs": {
        "type": "array"
      }
    }
  },
  "ports": [
    {
      "port_id": "extracted",
      "label": "Extracted",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "empty",
      "label": "Empty",
      "is_default": false,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io",
    "cloud-io"
  ],
  "tags": [
    "azure",
    "document-intelligence",
    "ocr",
    "forms",
    "layout"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://sommatic.ai",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Retries (retryOnFail)
No
Credentials
Resolved on the server from connection_id; the secret never reaches the workflow.
Capabilities
document-intelligenceocrformstableslayoutazurecloud
Tags
azuredocument-intelligenceocrformslayout

Notes and limits

  • The first run on a host installs the Python dependencies in a cached virtual environment, which can take minutes.
  • file_path must exist on the orchestrator's filesystem, for example a file written by connectors.microsoft.outlook.attachments in file mode.
  • Azure usage is billed to your own resource. The worker does not retry.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs