# Revisions, versions and conflicts

Choose the correct concurrency token for graphs, definitions, notes and durable data.

Canonical URL: https://opennodeflow.dev/wiki/agent-revisions/
JSON reference: https://opennodeflow.dev/wiki/agent-revisions/index.json
Source snapshot: 2026-10-23

ONF uses explicit concurrency tokens to protect saved work. Different entities have independent counters. Read the selected entity before a mutation and supply the corresponding expected field.

| Entity | Guard |
| --- | --- |
| Workflow graph/settings | `expectedRevision` |
| Existing immutable library definition | `expectedVersion` |
| Workspace/workflow/frame notes | Independent document `expectedRevision` |
| Workspace variable | Variable `expectedRevision` |
| Library pack/organization | Metadata `expectedRevision` |
| Workspace pack installation | Workspace-library `expectedRevision` |
| Durable storage object | Storage `expectedVersion` |

## Graph revision versus definition version

A workflow can move from revision 7 to 8 while every node stays pinned to definition version 2. Publishing version 3 does not change that saved graph or its execution code. Upgrading one graph instance is a separate guarded edit. Custom types, executor wrappers and nested subflows also retain exact dependency pins.

This distinction matters during diagnosis. A run's historical snapshot records what executed; latest library code may differ. Reading latest documentation never silently changes a runtime pin. See [versioning](/wiki/versioning/).

## Resolve a conflict deliberately

A stale token normally returns 409 and leaves the conflicting operation unapplied. Do not fetch the new revision and immediately resend a complete replacement. Instead:

1. Read the current entity.
2. Compare fields relevant to the intended change.
3. Check that the requested action still applies.
4. Preserve unrelated edits and reconcile overlapping changes.
5. Preview or validate the revised operation where available.
6. Submit using the token from that reconciled read and inspect the saved result.

Fetch notes independently after changing a graph. Supplying a workflow revision to `onf_update_context_documentation` is incorrect even if the numbers happen to match.

## Creation and independent metadata

Variables and connection profiles require `expectedRevision:0` on creation. An existing variable's workspace and declared type remain immutable. Pack installation replaces the intended `packIds` array; retain other installed packs unless removal is requested. Codec pairing checks both organization revisions atomically.

Revision guards prevent stale local replacements. They do not provide exactly-once execution across providers. A response lost after a write, run request or credential refresh requires readback and domain-level reconciliation. Changing an expected number or inventing a new deduplication key can duplicate an already accepted effect.

Keep local concurrency repair separate from external outcome recovery. Read [execution and diagnosis](/wiki/agent-execution/) and [durable storage for agents](/wiki/agent-storage/) before designing an automatic retry strategy.

---

## Documentation provenance

- `docs/MCP.md`
- `docs/API.md`
- `docs/VARIABLES.md`
- `docs/LIBRARY-PACKS.md`
- `docs/CONTEXT-DOCUMENTATION.md`

This page describes maintained source, not a live inventory or an authorization to perform actions.
