Workflows: 5-Minute Guide.
BetaFrom starter template to browser test run, immutable v1 publish and your first production API call.
For agents (.md & prompt)
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:
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"])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 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"
}'// 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"],
},
}// 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.
-
Create from a template in the Portal
Open Workflows in the Noirdoc Portal and choose one of three starter templates:
Template Slug Models Default Shield Support triage support-triagemistral4-119b→claude-sonnet-5-5redactInvoice extraction beleg-extraktiongemini-3.8-flash(Vision) →gpt-5.4-minioffFeedback analysis feedback-analysegpt-oss-120b→claude-sonnet-5-5redactThe draft opens on the visual canvas with five connected nodes (
IN,PII,01,02,OUT). Creating, editing, test-running, publishing and archiving workflows require theadminrole; organisationmemberusers have read-only access to workflows, versions and run metadata. -
Inspect steps, files and Shield on the canvas
Click any node to review its configuration in the inspector:
Input schemaINDefines required fields and types using JSON Schema Draft 2020-12 (required
messageand optionalchannelinsupport-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 ShieldPIISelects
off,blockorredact. When your organisation is set toenforcedunder Models → Shield,offis disabled (422shield_enforced_cannot_disable) and binary PDFs or images are rejected with 422shield_uninspectable_content.Prompt steps01 / 02Pick 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 viaattachments: ["input.receipt_file"]directly to Vision models such asgemini-3.8-flash,claude-sonnet-5-5orgpt-5.4-mini.Output schemaOUTValidates the final JSON locally against Draft 2020-12 and runs at most one automatic repair call on mismatch.
Your inputOrder #48291 for Max Weber (DE89 3704 0044 0532 0130 00) arrived damaged.
Sent to the modelOrder #48291 for [PERSON] ([IBAN]) arrived damaged.
-
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.
-
Publish version
v1Once the test run passes, click Publish as an
admin. The engine stores an immutablev1snapshot (strippingsample_inputandui_layout). Later draft edits never affect live calls tov1untilv2is published. -
Call the published workflow
Invoke the workflow using your existing
px-key atPOST /v1/workflows/{slug}/v1/run(pinned) orPOST /v1/workflows/{slug}/run(latest version) – optionally withX-Noirdoc-Tagsfor tag budgets: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"])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 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" }'{ "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
outputobject 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):
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"])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);{
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 @-{
"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.
/v1/workflows/{slug}/v1/run Keeps your application locked to immutable v1, even after an admin publishes v2 with updated prompts or models.
/v1/workflows/{slug}/run Always runs the latest published version – useful for verifying prompt and model changes without a backend deploy.