Workflows: 5-Minute Guide.

Beta

From starter template to browser test run, immutable v1 publish and your first production API call.

For agents (.md & prompt)
View as .md All docs (llms-full.txt)

With Noirdoc Workflows, you chain typed JSON inputs, single-pass Shield inspection and multiple EU models on a visual drafting canvas, then call the entire pipeline through one synchronous endpoint.

What you call in production.

Instead of wiring two SDKs, PII redaction and JSON retry loops in your backend, five minutes of setup gets you down to a single synchronous call:

Python
import os
import httpx

key = os.environ["NOIRDOC_API_KEY"]
res = httpx.post(
    "https://api.noirdoc.de/v1/workflows/support-triage/v1/run",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "message": "Order #48291 from Max Weber arrived damaged.",
        "channel": "email",
    },
    timeout=310,
)
res.raise_for_status()
print(res.json()["output"])
TypeScript
const url = "https://api.noirdoc.de/v1/workflows/support-triage/v1/run";

const res = await fetch(url, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.NOIRDOC_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    message: "Order #48291 from Max Weber arrived damaged.",
    channel: "email",
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { output } = await res.json();
console.log(output);
curl
curl https://api.noirdoc.de/v1/workflows/support-triage/v1/run \
  -H "Authorization: Bearer $NOIRDOC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Order #48291 from Max Weber arrived damaged.",
    "channel": "email"
  }'
JSON
// 200 OK · 2 models, 1× Shield, 1 synchronous call
{
  "workflow": "support-triage",
  "version": 1,
  "output": {
    "category": "damaged_item",
    "urgency": "high",
    "reply_draft": "We are shipping a replacement for order #48291.",
  },
  "meta": {
    "duration_ms": 1842,
    "total_cost_eur": "0.006120",
    "detected_types": ["PERSON"],
  },
}
JSON
// 403 Forbidden · Shield block at ingress (€0 model cost)
{
  "error": {
    "code": "shield_violation",
    "message": "Input blocked by Noirdoc Shield policy.",
    "blocked_rule": "pii",
    "detected_types": ["PERSON", "IBAN"],
  },
  "meta": {
    "workflow": "support-triage",
    "version": 1,
    "model_cost_eur": "0.000000",
    "shield_cost_eur": "0.000020",
    "workflow_fee_eur": "0.002000",
    "total_cost_eur": "0.002020",
  },
}

One request runs input validation, single-pass Shield inspection, both model steps and local output_schema checks. The five steps to your first call take five minutes in the Portal.

Step-by-step setup.

  1. Create from a template in the Portal

    Open Workflows in the Noirdoc Portal and choose one of three starter templates:

    TemplateSlugModelsDefault Shield
    Support triagesupport-triagemistral4-119b → claude-sonnet-5-5redact
    Invoice extractionbeleg-extraktiongemini-3.8-flash (Vision) → gpt-5.4-minioff
    Feedback analysisfeedback-analysegpt-oss-120b → claude-sonnet-5-5redact

    The draft opens on the visual canvas with five connected nodes (IN, PII, 01, 02, OUT). Creating, editing, test-running, publishing and archiving workflows require the admin role; organisation member users have read-only access to workflows, versions and run metadata.

  2. Inspect steps, files and Shield on the canvas

    Click any node to review its configuration in the inspector:

    Input schema IN JSON Schema Draft 2020-12

    Defines required fields and types using JSON Schema Draft 2020-12 (required message and optional channel in support-triage). For PDFs, images or text files, mark a string property with "format": "data-url" (at most 10 MB decoded per file, 15 MB total request body).

    Noirdoc Shield PII off · block · redact

    Selects off, block or redact. When your organisation is set to enforced under Models → Shield, off is disabled (422 shield_enforced_cannot_disable) and binary PDFs or images are rejected with 422 shield_uninspectable_content.

    Prompt steps 01 / 02 Multi-model & Vision

    Pick any model from your organisation’s catalogue (mixing OpenAI, Gemini and Anthropic wires freely), reference text values with {{input.message}} and {{steps.classify.category}}, and pass file inputs via attachments: ["input.receipt_file"] directly to Vision models such as gemini-3.8-flash, claude-sonnet-5-5 or gpt-5.4-mini.

    Output schema OUT Max. 1× auto-repair

    Validates the final JSON locally against Draft 2020-12 and runs at most one automatic repair call on mismatch.

    Your input

    Order #48291 for Max Weber (DE89 3704 0044 0532 0130 00) arrived damaged.

    Sent to the model

    Order #48291 for [PERSON] ([IBAN]) arrived damaged.

  3. Run a browser test

    As an admin, click Test run in the top bar with the synthetic sample payload. Browser test runs bill against your organisation’s balance (no API key paste required) and enforce your § 203 StGB posture.

    Each node updates live with latency, executing provider, detected Shield categories and real EUR cost (model + Shield + €0.002 workflow fee). Intermediate step outputs return live in the HTTP response only – nothing is stored.

  4. Publish version v1

    Once the test run passes, click Publish as an admin. The engine stores an immutable v1 snapshot (stripping sample_input and ui_layout). Later draft edits never affect live calls to v1 until v2 is published.

  5. Call the published workflow

    Invoke the workflow using your existing px- key at POST /v1/workflows/{slug}/v1/run (pinned) or POST /v1/workflows/{slug}/run (latest version) – optionally with X-Noirdoc-Tags for tag budgets:

    Python
    import os
    import httpx
    
    url = "https://api.noirdoc.de/v1/workflows/support-triage/v1/run"
    res = httpx.post(
        url,
        headers={
            "Authorization": f"Bearer {os.environ['NOIRDOC_API_KEY']}",
            "X-Noirdoc-Tags": "support-inbox",
        },
        json={
            "message": "Order #48291 from Max Weber arrived damaged.",
            "channel": "email",
        },
        timeout=310,
    )
    res.raise_for_status()
    data = res.json()
    print(data["output"], data["meta"]["total_cost_eur"])
    TypeScript
    const url = "https://api.noirdoc.de/v1/workflows/support-triage/v1/run";
    
    const res = await fetch(url, {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.NOIRDOC_API_KEY}`,
        "Content-Type": "application/json",
        "X-Noirdoc-Tags": "support-inbox",
      },
      body: JSON.stringify({
        message: "Order #48291 from Max Weber arrived damaged.",
        channel: "email",
      }),
    });
    if (!res.ok) throw new Error(`HTTP ${res.status}`);
    const data = await res.json();
    console.log(data.output, data.meta.total_cost_eur);
    curl
    curl https://api.noirdoc.de/v1/workflows/support-triage/v1/run \
      -H "Authorization: Bearer $NOIRDOC_API_KEY" \
      -H "Content-Type: application/json" \
      -H "X-Noirdoc-Tags: support-inbox" \
      -d '{
        "message": "Order #48291 from Max Weber arrived damaged.",
        "channel": "email"
      }'
    JSON
    {
      "workflow": "support-triage",
      "version": 1,
      "run_id": "wfr_019a7f3c9d2e4b81",
      "output": {
        "category": "damaged_item",
        "urgency": "high",
        "reply_draft": "We are shipping a replacement for order #48291."
      },
      "meta": {
        "duration_ms": 1842,
        "model_cost_eur": "0.004100",
        "shield_cost_eur": "0.000020",
        "workflow_fee_eur": "0.002000",
        "total_cost_eur": "0.006120",
        "pii_mode": "redact",
        "detected_types": ["PERSON"],
        "repair_attempted": false,
        "steps": [
          {
            "key": "classify",
            "model": "mistral4-119b",
            "provider": "aki-io",
            "wire_format": "openai",
            "duration_ms": 410,
            "prompt_tokens": 184,
            "completion_tokens": 42,
            "cost_eur": "0.000400"
          },
          {
            "key": "draft",
            "model": "claude-sonnet-5-5",
            "provider": "anthropic-gcp",
            "wire_format": "anthropic",
            "duration_ms": 1418,
            "prompt_tokens": 312,
            "completion_tokens": 96,
            "cost_eur": "0.003700"
          }
        ]
      }
    }

    Production calls return only the validated output object and step metadata.

Passing PDFs & images with Vision (beleg-extraktion).

For document and image workflows such as beleg-extraktion, pass files as base64 data URLs (format: "data-url", up to 10 MB decoded per file, 15 MB total request body). Bind the field in a prompt step via attachments: ["input.receipt_file"] on a Vision model (gemini-3.8-flash, claude-sonnet-5-5 or gpt-5.4-mini):

Python
import base64
import os
import httpx

pdf_b64 = base64.b64encode(open("invoice.pdf", "rb").read()).decode()
res = httpx.post(
    "https://api.noirdoc.de/v1/workflows/beleg-extraktion/v1/run",
    headers={"Authorization": f"Bearer {os.environ['NOIRDOC_API_KEY']}"},
    json={"receipt_file": f"data:application/pdf;base64,{pdf_b64}"},
    timeout=310,
)
res.raise_for_status()
print(res.json()["output"])
TypeScript
import { readFileSync } from "node:fs";

const url = "https://api.noirdoc.de/v1/workflows/beleg-extraktion/v1/run";
const pdfB64 = readFileSync("invoice.pdf").toString("base64");
const res = await fetch(url, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.NOIRDOC_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    receipt_file: `data:application/pdf;base64,${pdfB64}`,
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { output } = await res.json();
console.log(output);
curl
{
  printf '%s' '{"receipt_file":"data:application/pdf;base64,'
  base64 < invoice.pdf | tr -d '\n'
  printf '%s\n' '"}'
} | curl https://api.noirdoc.de/v1/workflows/beleg-extraktion/v1/run \
  -H "Authorization: Bearer $NOIRDOC_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @-
JSON
{
  "workflow": "beleg-extraktion",
  "version": 1,
  "output": {
    "invoice_no": "INV-2026-412",
    "vendor": "CloudHost GmbH",
    "net_eur": 420.0,
    "vat_rate": 0.19,
    "gross_eur": 499.8
  }
}

Allowed MIME types are PDF (application/pdf), images (PNG, JPEG, WebP, GIF) and UTF-8 text files. When your organisation Shield policy is enforced, binary PDFs or images return 422 shield_uninspectable_content (€0 fee).

/run vs. /v1/run & error handling.

Pinned version for production /v1/workflows/{slug}/v1/run Recommended

Keeps your application locked to immutable v1, even after an admin publishes v2 with updated prompts or models.

Unpinned for staging /v1/workflows/{slug}/run Always latest version

Always runs the latest published version – useful for verifying prompt and model changes without a backend deploy.

Related pages.

Workflows: 5-Minute Guide
https://www.noirdoc.de/en/docs/guides/workflows.md
.md