﻿# MODEL_ADMIN_IN_JOINED_TRANSACTION — model and workflow administration cannot run inside a transaction

A request carrying a transaction token — the `X-Tx-Token` header, or the `tx-token` gRPC metadata a compute member echoes on a callback — runs in the tran…

<em>cyoda-go version <a href="https://github.com/Cyoda/cyoda-go/releases/tag/v0.9.0">0.9.0</a></em>

# errors.MODEL_ADMIN_IN_JOINED_TRANSACTION

## NAME

MODEL_ADMIN_IN_JOINED_TRANSACTION — a request that carries a transaction token asked to change a model or its workflows, and was refused.

## SYNOPSIS

HTTP: `400` `Bad Request`. Retryable: `no`.

## DESCRIPTION

A request carrying a transaction token — the `X-Tx-Token` header, or the `tx-token` gRPC metadata a compute member echoes on a callback — runs in the transaction of the operation that called the member out. Model and workflow administration never runs there: a model's schema, its lock state, its change level, its unique keys, its existence and its workflows are configuration, changed by an operation of their own and never as a step of a running transition.

The refused operations are the ones that change a model or its workflows:

- `POST /model/import/{dataFormat}/{converter}/{entityName}/{modelVersion}`
- `DELETE /model/{entityName}/{modelVersion}`
- `POST /model/{entityName}/{modelVersion}/changeLevel/{changeLevel}`
- `PUT /model/{entityName}/{modelVersion}/lock`
- `PUT /model/{entityName}/{modelVersion}/unlock`
- `PUT /model/{entityName}/{modelVersion}/unique-keys`
- `POST /model/{entityName}/{modelVersion}/workflow/import`
- over gRPC, `entityModelManage` with `EntityModelImportRequest`, `EntityModelTransitionRequest`, `EntityModelDeleteRequest` or `EntityModelSetUniqueKeysRequest`

The refusal comes first: before the token is verified, before any transaction lock is taken, before the request body is read and before anything is written. A forged or expired token on one of these operations is answered with this code, not with `401` or `410`. In a cluster the node that receives the request refuses it, before it would route the request to the transaction's owning node, so the answer is the same on every node and a token naming another node is never forwarded. The transaction the token names is untouched.

An entity write in a joined transaction is not administration: it may still extend the model's schema where the model's `changeLevel` permits. That extension commits on its own and stays even if the transaction rolls back (`cyoda help models`, SCHEMA EXTENSION).

The read-only model and workflow operations — list, export, validate, workflow export, and over gRPC `EntityModelExportRequest` and `EntityModelGetAllRequest` — are not administration and are not refused.

Not retryable: the same request meets the same refusal. Make the request without the token, as an independent request of its own, and let the processor handle its outcome. Over gRPC the code is the message prefix of the `CLIENT_ERROR` envelope.

## SEE ALSO

- errors
- models
- workflows
- cluster
- errors.COMMIT_IN_JOINED_TRANSACTION

## See also

- [`cyoda help errors`](/help/errors/) — Every error response from the Cyoda REST API carries a structured `errorCode` in the `properties` object. Multiple codes may share the same HTTP status. Programmatic handling keys on `errorCode`, not HTTP status.
- [`cyoda help models`](/help/models/) — A model is a named, versioned schema registered per tenant. Every entity in the system is an instance of exactly one model. Models are identified by `(entityName, modelVersion)`. The model ID is a deterministic UUID v5 derived from that key: `UUID.newSHA1(NameSpaceURL, "{entityName}.{modelVersion}")`.
- [`cyoda help workflows`](/help/workflows/) — A workflow definition is a named finite state machine attached to an entity model. Workflows are stored per model reference `(entityName, modelVersion)`. A model may have multiple workflow definitions; the engine selects the matching one per entity using the workflow-level `criterion` field, on every operation that runs the entity's workflow (see *Workflow-level selection*). When no `criterion` matches, the engine uses the default built-in workflow.
- [`cyoda help cluster`](/help/cluster/) — Multi-node cyoda is supported only on the `postgres` storage backend. All nodes are stateless and identical: no leader election, no shard ownership, no external service-discovery infrastructure. PostgreSQL is the single coordination layer. Snapshot Isolation with first-committer-wins (`REPEATABLE READ` + commit-time validation) provides correctness; gossip provides peer awareness; HMAC-signed routing tokens bind in-flight `pgx.Tx` handles to their owning node.
- [`cyoda help errors COMMIT_IN_JOINED_TRANSACTION`](/help/errors/commit_in_joined_transaction/) — A compute member's callback — a request carrying a transaction token — runs in the transaction of the operation that called the member out. It joins that transaction; it does not own it. Only the operation that began a transaction commits it.

## Raw formats

- [`/help/errors/model_admin_in_joined_transaction.json`](/help/errors/model_admin_in_joined_transaction.json) — full descriptor (matches `GET /help/{topic}` envelope)
- [`/help/errors/model_admin_in_joined_transaction.md`](/help/errors/model_admin_in_joined_transaction.md) — body only