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

## Install and test

### As a pack

1. Put the item in a pack and sign it. See [Packs](/developers/packs).
2. Import it: **Platform Settings > Extensions > Import pack**, or `POST /api/extensions/packs/import`. Import runs every check on this page. A missing connector is not an import error.
3. Activate it: `POST /api/extensions/packs/{packId}/activate` with `{"version":"1.0.0","parameters":{"target_workspace":"ws-ops"}}`. **Activation is the approval.** The template is published as decided by the person who activates it. That person needs `templates.publish_own` in the bound workspace, or `templates.publish_install` when it is unbound. A template with a code step also needs `automations.use_custom_code`.
4. Deploy it: the template shows in the template gallery. The person deploying it fills in the template parameters. Deploying is refused until every connector it needs is installed.

### Inside an installation

You can also build a workflow in the designer and turn it into a template.

| Step | API | UI |
|---|---|---|
| Create a workflow from JSON | `POST /api/automations` with `{name, workspaceId, status: "draft", rootStepId, steps}` | Automations > Designer |
| Create a template draft from it | `POST /api/automations/templates/authored {workspaceId, fromFlowId, name?, locale?}` | Automations > Templates > New |
| Edit details | `PUT /api/automations/templates/authored/{id} {rev, record?, parameters?, bindings?, translations?, valueChoices?}` | template editor |
| Validate | `POST /api/automations/templates/authored/{id}/validate` returns `{ok, errors[], warnings[]}` | |
| Submit for review | `POST .../{id}/submit {rev, targetScope: "workspace" or "install", note?}` | |
| Approve or reject | `POST .../{id}/approve {rev, note?, riskClassConfirmed?}`, `POST .../{id}/reject {rev, note}` | Automations > Template reviews |
| Export as a pack | `POST .../{id}/export {}` returns a signed `.ancpack` | |

Every write (`PUT`, `submit`, `approve`, `reject`) needs the integer `rev` you last read; a stale or missing `rev` returns `TEMPLATE_REV_CONFLICT`. `riskClassConfirmed: true` is needed on approve only when the template has AI steps. The `validate` call is the quickest way to check a template while you build it. Authors cannot approve their own templates when the target is the whole installation and the installation's second-approver setting is on. Each user can hold at most 100 unpublished drafts per workspace.

An exported pack is signed with the installation's export key. To move it to a second installation, open **Platform Settings > Extensions > Trust keys** on the first one and choose **Show key for another installation**. On the second installation, add a trust key and paste it: the key id is filled in for you.

## Common errors

Pack import errors appear as `PACK_SCHEMA_INVALID` details with the path `/items/<itemId>/spec/record/...` and the code in brackets.

| Code | Message | Fix |
|---|---|---|
| `TPL_FLOW_NO_TRIGGER` | The workflow has no trigger yet. / The workflow has more than one trigger. Keep exactly one. | One `trigger` step, and `rootStepId` points at it |
| `TPL_FLOW_EMPTY` | The workflow only has a trigger. Add at least one step. | Add a step |
| `TPL_FLOW_SERIALIZE` | Connector step is missing connectorPiece. / Agent step is missing agentGoal. / First step must be a trigger. | Fix the step |
| `TPL_FLOW_SERIALIZE` | Sovereignty conflict: classification=sovereign cannot route to cloud-reasoning tier. | Use a local tier or lower the classification |
| `TPL_META_REQUIRED`, `TPL_META_LENGTH`, `TPL_META_ENUM` | Enter a name. / Keep a short description to 300 characters. / Choose an industry from the list. / The creation date is missing. | Use the values and limits above. Always send `createdAt` |
| `TPL_PARAM_INVALID` | This kind of parameter cannot have a default. / A secret cannot have a default value. / The default value does not match the parameter type. | Remove the default or fix its type |
| `TPL_BINDING_ORPHAN` | This value points to a parameter that no longer exists. | Match `parameterId` and `stepId` |
| `TPL_BINDING_PATH_FORBIDDEN` | The parameter "..." cannot fill this field of step "...". | Follow the bindings table |
| `TPL_RESIDUAL_BINDING` | This still points to something of your own installation. | Remove the resource field from the step and add a binding |
| `TPL_SECRET_FOUND` | This looks like a credential. Remove it or make the field a parameter. | No keys or tokens in any text |
| `TPL_AIACT_REQUIRED` | Choose a risk class: this template has AI steps. / State the intended purpose. | Fill `aiAct` |
| `TPL_PROHIBITED` | A template for a prohibited practice cannot be shared. | |
| `TPL_TOO_LARGE` | The template is larger than 1 MB. / at most 200 steps / at most 50 parameters | Split it |
| `TPL_PACK_WORKSPACE` | must be a pack parameter, written as {{param.<id>}} | Use a `workspace` pack parameter |
| `TPL_PACK_WORKSPACE_UNKNOWN` | the workspace it is bound to (...) does not exist here or is archived. | Bind an existing workspace at activation |
| `TPL_PACK_UNREADABLE` | its content could not be read. | Rebuild and re-sign the pack |
| `TPL_PARAM_DUPLICATE` | Two parameters share the id "...". | Make parameter ids unique |
| `TPL_FIELD_MODE` | a step field uses a field mode that is not allowed | Use one of the field modes the designer offers |
| `TPL_GUARD_MODE` | a guardrail or file-search step uses a mode that is not allowed | Use one of the modes the designer offers |
| `TEMPLATE_REV_CONFLICT` | the template changed since you read it | Read it again and send the new `rev` |

Warnings do not block: `TPL_RISK_DECLARED_BELOW_DERIVED` (see the high-risk rule above), `TPL_CATALOG_DRIFT` (the connector catalog changed since the template was built: update it from its workflow), `TPL_PARAM_UNUSED`, `TPL_CODE_STEP_PRESENT` (whoever deploys it runs that code), `TPL_PII_FOUND` (an e-mail address, phone number or IBAN in the text), `TPL_NO_HUMAN_OVERSIGHT_STEP`, `TPL_TRANSLATION_INCOMPLETE`.

## Limits and editions

- At most 200 steps, 50 parameters and 1 MB per template.
- Connector names and their action inputs depend on the connectors installed in the target installation. AANCER offers 750+ connectors.
- Templates are controlled by permissions: `templates.author_own`, `templates.publish_own`, `templates.publish_install`, `automations.use_custom_code`.
- An agent can only use a workflow that starts from a webhook, a schedule or an event if the agent is certified. This needs the Certified Agents licence feature. See [Agents](/developers/agents).
- Check your edition on [aancer.ai/pricing](https://aancer.ai/pricing).



## Agents

An agent in AANCER is a versioned, governed AI assistant that belongs to a workspace. It has instructions, a model tier, tools (connector actions, knowledge sets, workflows, other agents, web search and platform tools), conversation starters, an optional input form, optional structured output, run limits, a write-approval policy and an automated decision disclosure. You edit a **draft** and **publish** numbered versions. Each publish issues a signed passport that binds the version to a hash of its configuration.

To move an agent between installations, or to offer it to customers, you use an **agent blueprint**: a pack item of kind `agent-blueprint`. A blueprint carries content only: instructions, starters, model tier, tool references and skills. Activating a blueprint creates no agent. A person creates an agent from it with one click, and that agent is an ordinary agent of the target installation.

There are two formats on this page:

| Format | Use it for | How you send it |
|---|---|---|
| Agent blueprint | shipping an agent design in a pack | pack item `agent-blueprint`, schema version 1 |
| Agent configuration | creating or editing an agent in one installation | REST: `PUT /api/agents/{id}/draft` |

## Quick start

A blueprint that sorts invoices. It uses a mail connector action and the platform's render tool.

```json
{
  "v": 2,
  "kind": "bundle",
  "id": "acme.invoice-triage",
  "version": "1.0.0",
  "title": "Invoice triage agent",
  "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" },
  "requires": { "platform": ">=1.0.0" },
  "items": [
    {
      "kind": "agent-blueprint",
      "schemaVersion": 1,
      "id": "invoice-triage",
      "scope": "install",
      "spec": {
        "name": "Invoice triage",
        "description": "Sorts incoming invoices and drafts the booking proposal.",
        "category": "finance",
        "icon": "receipt",
        "instructions": "You sort incoming invoices. For each one, name the supplier, the amount and the cost centre, and draft a booking proposal. Never book anything yourself.",
        "starters": ["Sort today's invoices"],
        "model": { "tier": "local-standard" },
        "tools": [
          { "kind": "connector", "ref": "mail.send_email" },
          { "kind": "frame", "ref": "render" }
        ],
        "skills": [],
        "riskHint": null
      }
    }
  ]
}
```

`mail.send_email` is a placeholder. Use `<connector name>.<action name>` of a connector in the target installation.

## File layout

```text
acme-invoice-desk/
  manifest.json                       # pack manifest
  content/
    invoice-clerk.json                # agent-blueprint spec
    invoice-summary-approval.json     # template spec the blueprint uses as a tool
```

A blueprint item must use `"scope": "install"`.

Next part: https://aancer.ai/dev/parts/reference/07-field-reference.md
