Skip to main content
An operation is a named business change, such as cancelling an order or correcting an invoice. It runs its preparation in an ordinary mutation transaction, and it can ask for work in an external system by submitting durable external calls. Everything an operation prepares commits together, or not at all. Here is an operation that cancels an order and asks a billing system to void its invoice:
bijection/orders.ts
When this operation is accepted, the order’s new status and the intent to void the invoice are committed in one transaction. The billing system is called afterwards, and its answer is recorded separately.

Operations, mutations and actions

Operations are built on the functions you already know. An operation does not replace mutations or actions, and action keeps its ordinary meaning: a function that can call third-party APIs directly with fetch. Reach for an operation when a change matters to the business: when it must be retried without being applied twice, when a person should be able to preview it first, or when it has to ask an external system to do something.

What happens when you call an operation

1

Preview (optional)

A preview runs the same preparation on the current data, reports the changes and external calls it would make, and then discards them. Nothing is accepted, reserved or sent.
2

Acceptance

The caller submits the operation with a request key. Preparation runs in one transaction. Its local changes, its external calls and the retained request commit together, and the caller receives an acceptance receipt.
3

Delivery

After the commit, each external call is delivered to its destination through the integration command it names. Delivery follows the destination’s declared contract, not a generic retry loop.
4

Outcome

Each call ends with an outcome the destination’s evidence supports: for example delivered, refused, or unknown. An unknown outcome stays unknown until it is reconciled.
An acceptance receipt proves that your local changes committed. It is not evidence that an external system applied anything. Follow each call’s status for that.

Learn more

Defining operations

Declare an operation with defineOperation: its object type, target, arguments, result and preparation.

Calling operations

Request keys, previews, recovery after a lost response, and status.

External calls

Submit durable external calls and follow their lifecycle and outcomes.

Operation interfaces

Share one operation shape across object types and discover implementations.

Durable waits

Commit work at a business-time boundary with defineWait, and require source freshness with sourceBarrier.

CLI and console

Run, preview and recover operations with bijection run, and follow them in the console.
External calls are delivered through the commands of an integration. Who may call an operation is decided by access rules and grants.