<!-- AANCER Developer Reference (English): every field, limit and error code, part 5 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Field reference

JSON Schema: [template.schema.json](https://aancer.ai/dev/schemas/template.schema.json)

### Item spec

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | 1 to 64 characters. The installation computes its own row id on import |
| `version` | integer | yes | 1 or higher |
| `workspace` | string | no | exactly `{{param.<id>}}` of a `workspace` pack parameter. A literal workspace id is refused |
| `record` | object | yes | the template record below |

### Template record

| Field | Type | Required | Rules |
|---|---|---|---|
| `name` | string | yes | 1 to 80 characters |
| `description` | string | yes | 1 to 300 characters |
| `longDescription` | string | no | detail text |
| `icon` | string | yes | 1 to 40 characters, usually an emoji |
| `industry` | string | yes | `healthcare`, `legal`, `financial`, `hr`, `manufacturing`, `retail`, `saas`, `marketing`, `operations`, `devops` |
| `industries` | string[] | no | extra tags |
| `complexity` | string | yes | `starter`, `intermediate`, `advanced` |
| `estimatedTimeSaved` | string | no | for example `"3h/week"` |
| `locale` | string | yes | at most 20 characters, for example `en` |
| `dataClassification` | string | no | free text |
| `aiAct` | object | yes | `{ riskClass, annexIiiCategory, intendedPurpose, humanOversight, transparencyNote }`. `riskClass`: `unclassified`, `minimal`, `limited`, `high`, `prohibited` |
| `compliance` | object | yes | `{ dataCategories: string[], dataSubjects: string[], lawfulBasis, retentionDays }`. `lawfulBasis`: `contract`, `consent`, `legitimate-interest`, `legal-obligation` or `""`. `retentionDays`: integer 0 to 36500, or `null` |
| `parameters` | array | yes | at most 50. See Template parameters |
| `bindings` | array | yes | which parameter fills which step field |
| `translations` | object | yes | `{ "<locale>": { name?, description?, longDescription?, parameters?: { "<paramId>": { label?, help? } } } }`. May be `{}` |
| `flow` | object | yes | `{ name, description?, rootStepId, steps }`, 2 to 200 steps |
| `builtAgainst` | object | no | `{ catalogHash, platformVersion }` |
| `createdAt` | string | yes | ISO 8601 date and time, for example `2026-11-20T00:00:00.000Z` |

Do not send `derived`. The installation computes it.

### Template parameters

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | `^[a-z][a-z0-9_]{0,39}$`, unique |
| `type` | string | yes | `connection`, `knowledgeSet`, `agent`, `persona`, `dataset`, `approvers`, `secret`, `string`, `number`, `boolean`, `select` |
| `label` | string | yes | not empty |
| `help` | string | no | |
| `required` | boolean | no | |
| `default` | string, number or boolean | no | must match the type. Not allowed for `connection`, `knowledgeSet`, `agent`, `persona`, `dataset`, `approvers`, `secret` |
| `options` | string[] | for `select` | at least one; a `select` default must be one of them |
| `connector` | string | no | for `connection`: the connector it must belong to |

These template parameters are separate from pack parameters. Pack parameters are bound when the pack is activated. Template parameters are filled each time someone deploys the template.

### Bindings

A binding is `{ "parameterId": "...", "stepId": "...", "path": "..." }`. `path` is dot-separated. A parameter may fill only these fields:

| Path | Parameter type |
|---|---|
| `connectorAuth` | `connection` |
| `knowledgeSetId` | `knowledgeSet` |
| `agentRef`, `agentId` | `agent` |
| `personaId` | `persona` |
| `datasetId` | `dataset` |
| `approvers` | `approvers` |
| `triggerAuthFields.<key>` (trigger step only) | `secret` (a secret fills nothing else) |
| `connectorInputs.<key>` (not `connectorInputs.auth`), `triggerInputs.<key>` | `string`, `number`, `boolean`, `select` |
| `systemPrompt`, `userPromptTemplate`, `routingInstructions`, `agentGoal`, `routerQuestion`, `searchQuery`, `approvalMessage`, `approvalReasoning` | `string`, `select` |

A code step is never a binding target.

**No resource may stay in the steps.** Leave these fields out of every step and bind a parameter instead: `connectorAuth`, `knowledgeSetId`, `agentRef`, `agentId`, `personaId`, `datasetId`, `approvers`, `triggerAuthFields`, `webhookPath`, `agentApprovers`, `capturedOutput`. Text must not contain `{{connections[`.

### Workflow steps

Every step has `id`, `type`, `name` and `position {x, y}`. Optional: `description`, `nextStepId` (the next step), `continueOnFailure`, `retryOnFailure`, `retryCount`, `retryDelayMs`, `fieldModes` (`{ "<field>": "manual" | "auto" | "prompt" | "none" }`).

Exactly one step has `type: "trigger"`, and `flow.rootStepId` points at it. There must be at least one other step. Refer to earlier output with `{{trigger.body.<field>}}`, `{{<stepId>}}` or `{{<stepId>.<field>}}`.

| `type` | Fields (required in bold) |
|---|---|
| `trigger` | **`triggerType`**: `webhook`, `schedule`, `event`, `piece`. `schedule` (cron), `triggerTimezone` (IANA), `triggerAuthType` (`none`, `basic`, `header`, `hmac`), `triggerPiece`, `triggerName`, `triggerInputs`, `triggerPieceVersion` for a connector trigger |
| `aancer-ai` | `modelTier` (`local-standard`, `local-advanced`, `cloud-reasoning`), `dataClassification` (`sovereign`, `internal`, `permitted`), `systemPrompt`, `userPromptTemplate`, `maxTokens` |
| `rag` | as `aancer-ai`, plus a `knowledgeSetId` binding to a `knowledgeSet` parameter |
| `agent` | **`agentGoal`**, `agentToolRefs`, `agentMaxSteps` (1 to 50, default 10), `agentMaxBudgetUsd` (default 1.00), `agentRequireApproval` (default true), `agentOutputFields` |
| `connector` | **`connectorPiece`** (connector name), `connectorAction`, `connectorInputs` |
| `approval` | `approvalMessage`, `approvalReasoning`, `approvalTimeout` (hours, default 24), `approvalOnReject` (`stop`, `continue`), plus an `approvers` binding |
| `condition` | **`conditionExpression`**, **`branches [{id, label, nextStepId}]`** (at least one) |
| `router` | **`routingInstructions`**, **`routerBranches [{id, label, nextStepId, isDefault}]`** with exactly one default |
| `ai-router` | **`routerInput`**, **`routerQuestion`**, **`routerRoutes [{id, label, description}]`** (2 to 12, ids unique and not empty, not `otherwise`; every edge must be a declared route), `routerMode` (`single`, `multi`), `routerConfidenceFloor` (0 to 1) |
| `loop` | **`loopExpression`**, `loopBodyStepId` |
| `code` | `codeLanguage` (`javascript`; `python` with pandas, sandboxed and without network by default, is coming in this release), `codeSource`, `codeInputs {name: "{{ref}}"}` |
| `guardrails` | `guardTarget`, `guardOnFail` (`block`, `annotate`) |
| `file-search` | `searchQuery`, `searchMode` (`hybrid`, `vector`), `searchMaxHits` (1 to 20), plus a `knowledgeSetId` binding |
| `publish` | `publishMode` (`append`, `upsert`, `replace`), `publishRows`, `whenFull` (`remove_oldest`, `fail`), plus a `datasetId` binding |
| `output` | no required fields |

A step with `dataClassification: "sovereign"` cannot use `modelTier: "cloud-reasoning"`.

### AI Act fields

If the template has AI steps (`aancer-ai`, `rag`, `agent`, `router`, `ai-router`), set `aiAct.riskClass` to `minimal`, `limited` or `high` and fill `aiAct.intendedPurpose`.

AANCER treats a template as high risk when `riskClass` is `high`, or when its industry, name or description (including translations) contains one of these terms: `hr` (as a word), `rrhh`, `talent`, `employ`, `hiring`, `recruit`, `candidate`, `screen`, `performance review`, `offboard`, `onboard`, `education`, `edu` (as a word), `proctor`, `grading`, `student`, `exam`. The match is a plain substring test, so words such as "screenshot", "employee" and "example" also count. A high-risk template with AI steps needs `aiAct.annexIiiCategory` (not `none`) and `aiAct.humanOversight`, and should contain an approval step. If the declared `riskClass` is lower than this rule derives, you get the warning `TPL_RISK_DECLARED_BELOW_DERIVED` and the template is treated as high risk.

### What the installation works out for you

Do not send these. AANCER derives them from the steps: which steps run locally, in the cloud, call a connector or wait for approval; whether the template is fully sovereign, mixed or sends data to a connector; the connectors it needs; and the hosts named in connector inputs.

## Full examples

### Local AI summary, human approval, then post

```json
{
  "kind": "template", "schemaVersion": 1, "id": "invoice-summary-approval", "scope": "install",
  "spec": {
    "id": "tpl-acme-invoice-summary",
    "version": 1,
    "workspace": "{{param.target_workspace}}",
    "record": {
      "name": "Invoice summary with approval",
      "description": "Summarises an incoming invoice with a local model, asks a person to approve, then posts the summary to a chat channel.",
      "icon": "🧾", "industry": "financial", "complexity": "intermediate", "locale": "en",
      "aiAct": {
        "riskClass": "limited", "annexIiiCategory": "none",
        "intendedPurpose": "Summarise supplier invoices for a person who approves them.",
        "humanOversight": "A person approves every summary in an approval step before it is posted.",
        "transparencyNote": "The summary is written by an AI model."
      },
      "compliance": { "dataCategories": ["invoice data"], "dataSubjects": [], "lawfulBasis": "contract", "retentionDays": 90 },
      "parameters": [
        { "id": "approvers_1", "type": "approvers", "label": "Who approves the summary", "required": true },
        { "id": "conn_1", "type": "connection", "label": "Chat connection", "required": true, "connector": "connector-chat" },
        { "id": "channel", "type": "string", "label": "Channel to post to", "required": true, "default": "finance" }
      ],
      "bindings": [
        { "parameterId": "approvers_1", "stepId": "approve", "path": "approvers" },
        { "parameterId": "conn_1", "stepId": "post", "path": "connectorAuth" },
        { "parameterId": "channel", "stepId": "post", "path": "connectorInputs.channel" }
      ],
      "translations": {},
      "flow": {
        "name": "Invoice summary with approval",
        "rootStepId": "t",
        "steps": [
          { "id": "t", "type": "trigger", "name": "Invoice received", "position": { "x": 0, "y": 0 }, "triggerType": "webhook", "nextStepId": "sum" },
          { "id": "sum", "type": "aancer-ai", "name": "Summarise", "position": { "x": 0, "y": 120 },
            "modelTier": "local-standard", "dataClassification": "internal",
            "systemPrompt": "You summarise supplier invoices: supplier, amount, due date, cost centre.",
            "userPromptTemplate": "{{trigger.body.text}}", "maxTokens": 600, "nextStepId": "approve" },
          { "id": "approve", "type": "approval", "name": "Approve summary", "position": { "x": 0, "y": 240 },
            "approvalMessage": "Approve this invoice summary?", "approvalReasoning": "{{sum}}", "approvalTimeout": 24, "nextStepId": "post" },
          { "id": "post", "type": "connector", "name": "Post to channel", "position": { "x": 0, "y": 360 },
            "connectorPiece": "connector-chat", "connectorAction": "send", "connectorInputs": { "text": "{{sum}}" } }
        ]
      },
      "builtAgainst": { "catalogHash": "", "platformVersion": "1.0.0" },
      "createdAt": "2026-11-20T00:00:00.000Z"
    }
  }
}
```

### Weekly scheduled answer from a knowledge set, with a German translation

```json
{
  "kind": "template", "schemaVersion": 1, "id": "weekly-policy-digest", "scope": "install",
  "spec": {
    "id": "tpl-acme-weekly-policy-digest",
    "version": 1,
    "record": {
      "name": "Weekly policy digest",
      "description": "Every Monday, answers a fixed question from a knowledge set with a local model and keeps the answer in the run history.",
      "icon": "📚", "industry": "operations", "complexity": "starter", "locale": "en",
      "aiAct": { "riskClass": "minimal", "annexIiiCategory": "none", "intendedPurpose": "Summarise internal policy changes for staff.", "humanOversight": "", "transparencyNote": "" },
      "compliance": { "dataCategories": [], "dataSubjects": [], "lawfulBasis": "", "retentionDays": null },
      "parameters": [
        { "id": "ks_1", "type": "knowledgeSet", "label": "Policy knowledge set", "required": true },
        { "id": "question", "type": "string", "label": "Question to answer each week", "required": true, "default": "What changed in our policies this week?" }
      ],
      "bindings": [
        { "parameterId": "ks_1", "stepId": "ask", "path": "knowledgeSetId" },
        { "parameterId": "question", "stepId": "ask", "path": "userPromptTemplate" }
      ],
      "translations": {
        "de": {
          "name": "Wöchentlicher Richtlinien-Überblick",
          "description": "Beantwortet jeden Montag eine feste Frage aus einer Wissenssammlung.",
          "parameters": { "ks_1": { "label": "Wissenssammlung" }, "question": { "label": "Wöchentliche Frage" } }
        }
      },
      "flow": {
        "name": "Weekly policy digest",
        "rootStepId": "t",
        "steps": [
          { "id": "t", "type": "trigger", "name": "Every Monday 08:00", "position": { "x": 0, "y": 0 },
            "triggerType": "schedule", "schedule": "0 8 * * 1", "triggerTimezone": "Europe/Berlin", "nextStepId": "ask" },
          { "id": "ask", "type": "rag", "name": "Answer from policies", "position": { "x": 0, "y": 120 },
            "modelTier": "local-standard", "dataClassification": "internal",
            "systemPrompt": "Answer only from the retrieved passages. Say when nothing changed.", "maxTokens": 800 }
        ]
      },
      "builtAgainst": { "catalogHash": "", "platformVersion": "1.0.0" },
      "createdAt": "2026-11-20T00:00:00.000Z"
    }
  }
}
```

There is no `workspace` here, so activation publishes it for the whole installation. A translation needs a name, a description and every parameter label, otherwise you get the warning `TPL_TRANSLATION_INCOMPLETE`.

Next part: https://aancer.ai/dev/parts/reference/06-install-and-test.md
