﻿# COMMIT_IN_JOINED_TRANSACTION — a callback reached a processor that would commit the transaction it joined

A compute members callback — a request carrying a transaction token — runs in the transaction of the operation that called the member out. It joins that …

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

# errors.COMMIT_IN_JOINED_TRANSACTION

## NAME

COMMIT_IN_JOINED_TRANSACTION — a write made under a transaction token ran a workflow that reached a `COMMIT_BEFORE_DISPATCH` processor, and was refused.

## SYNOPSIS

HTTP: `409` `Conflict`. Retryable: `no`.

## DESCRIPTION

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.

A `COMMIT_BEFORE_DISPATCH` processor commits the transaction it runs in before it is dispatched. When the workflow a callback's write runs — a create, an update or a transition, one entity or a collection — reaches such a processor, committing there would commit the calling operation's transaction part-way through that operation, without it knowing. The write is refused instead, at that processor: the processor is not dispatched, and the joined transaction is neither flushed nor committed. Nothing the refused write did is kept: what its workflow had already done — the audit events it recorded, and the effects of any earlier processor or transition, including their own callouts — is discarded with it. A schema extension any of them made stays (`cyoda help models`, SCHEMA EXTENSION). Both values of `startNewTxOnDispatch` are refused, because both commit the transaction first.

The refusal is a failed write that retrying cannot change, so it makes the joined transaction rollback-only: the calling operation fails with `409 TRANSACTION_ROLLBACK_ONLY`, whatever the member answers. Under an `ASYNC_NEW_TX` processor the mark stops at that processor: the processor fails, and the operation carries on.

The message names the workflow and the processor. Not retryable: the same callback reaches the same processor again. The fix is in the compute node: make that write as an independent request, without the transaction token, so it runs in a transaction of its own — the `COMMIT_BEFORE_DISPATCH` processor then commits that transaction, as designed — and let the calling processor handle the write's outcome as the business requires. Changing the inner processor's `executionMode` to `SYNC` also removes the refusal, but changes what that workflow promises (its pre-callout state is no longer durable before the callout), so do it only if that promise is not needed. Over gRPC the code is the message prefix of the `CLIENT_ERROR` envelope.

The import does not reject the combination: whether a workflow is reached from a callback is decided at run time.

## SEE ALSO

- errors
- workflows
- errors.CALLOUT_SUPERSEDED
- errors.WORKFLOW_FAILED

## 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 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 errors CALLOUT_SUPERSEDED`](/help/errors/callout_superseded/) — A compute node receives a transaction token with each processor, criterion or function request, and presents it on the API requests it makes while it works. The token is valid for that one request on that one compute node. This error fires when the token is presented after cyoda gave the same work to another compute node — because this one did not answer within its answer limit, or its connection dropped — or after the request ended: answered, failed or abandoned. The transaction itself is still open; once it has ended the answer is `TRANSACTION_NOT_FOUND` instead.
- [`cyoda help errors WORKFLOW_FAILED`](/help/errors/workflow_failed/) — During an entity create or transition operation the associated workflow processors (pre-processors, post-processors) or guard conditions ran but one of them signalled failure. The failure message from the processor is included in the error detail.

## Raw formats

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