hitlintermediate15 min setupby Mantle

Extract with human clarification on low confidence

Extract structured data from text; when the model is unsure it pauses and asks a person to pick from candidates, then the record is posted.

Text inExtract (pause iPost order line

Drag to pan, pinch to zoom. This is the real graph the template installs.

Purpose

Extract structured data from text; when the model is unsure it pauses and asks a person to pick from candidates, then the record is posted.

How it works

What it does

  • Webhook extract-in → Extract (pause if unsure): on_ambiguity: pause with confidence_threshold: 0.75. When the model's self-reported confidence is low, or it returns several candidates, the run pauses and a person picks the right one in the run panel.
  • Post order line sends the (possibly human-corrected) fields.

Nodes 3

  1. 01Text intrigger.webhookTrigger
  2. 02Extract (pause if unsure)ai.extractAI
  3. 03Post order linehttp.requestHTTP
View template JSON
{
  "format": "mantle-workflow/v1",
  "id": "hitl-extract-with-clarification",
  "name": "Extract with human clarification on low confidence",
  "graph": {
    "nodes": [
      {
        "id": "webhook",
        "type": "trigger.webhook",
        "label": "Text in",
        "config": {
          "slug": "extract-in",
          "input_schema": {
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string"
              }
            }
          }
        },
        "worker_type": "generic-worker",
        "position": {
          "x": 60,
          "y": 220
        }
      },
      {
        "id": "ai_extract",
        "type": "ai.extract",
        "label": "Extract (pause if unsure)",
        "config": {
          "model": "claude-sonnet-4-5",
          "temperature": 0,
          "text": "{{ $json.text }}",
          "schema": {
            "type": "object",
            "required": [
              "product",
              "quantity"
            ],
            "properties": {
              "product": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "candidates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "on_ambiguity": "pause",
          "confidence_threshold": 0.75,
          "confidence_path": "confidence",
          "candidates_path": "candidates",
          "candidate_label_field": "label",
          "ambiguity_question": "Which product did the customer mean?",
          "timeout_seconds": 86400
        },
        "worker_type": "ai-worker",
        "position": {
          "x": 380,
          "y": 220
        }
      },
      {
        "id": "post_order",
        "type": "http.request",
        "label": "Post order line",
        "config": {
          "method": "POST",
          "url": "https://example.com/order-lines",
          "headers": {
            "Content-Type": "application/json"
          },
          "json": {
            "product": "steps.ai_extract.response.product",
            "quantity": "steps.ai_extract.response.quantity"
          }
        },
        "worker_type": "generic-worker",
        "position": {
          "x": 700,
          "y": 220
        }
      }
    ],
    "edges": [
      {
        "from": "webhook",
        "to": "ai_extract"
      },
      {
        "from": "ai_extract",
        "to": "post_order"
      }
    ]
  }
}

Requirements

The connections and permissions each step needs, from the node contracts in the catalog.

  • AnthropicAPI key

    Used by Extract (pause if unsure).

    Credential: {"api_key"}

    • The provider adapter is chosen from the connection; `model` must belong to it.

Setup

  • AI connection on the extractor; adjust the schema, threshold and destination url.

Sample input and output

Synthetic examples: node-contract samples or placeholders, never customer data.

Input

The fields the template declares or reads from the request body. Values are placeholders.

{
  "text": "<text>"
}

Output

Post order line http.request

{
  "body": null,
  "headers": {},
  "status_code": 0
}

Failure handling

What the graph does when a step fails, read from its retry settings, error branches and error policies.

  • Extract (pause if unsure): a paused extraction fails if the reviewer does not answer within 1 day.
  • A step that fails, after any retries, fails the run. The failed step is kept with its input and error.

See it run, then make it yours.

Templates install as drafts. Edit any step, and Workflow Health re-checks the graph on every save.