CapabilityIntegration & MessagingNode.js, read from its artifacts

Async processing

Doing work outside the request that triggered it, with a guarantee that it eventually happens — deferred jobs, retries, and periodic work. Distinct from messaging, which is about telling other systems.

Showing artifacts, examples and content with confirmed Node.js applicability. View All CAP

Overview

SAP SHIPS
@sap/cds

Queues a service's calls, inbound messages and scheduled tasks in the cds.outbox.Messages table inside the business transaction, dispatches them after commit, retries with exponential backoff and keeps failures past maxAttempts as a dead letter queue; cds.queued() wraps a service, outboxed: true does it by configuration.

A Node.js coverage assessment has not been written. View all flavors

THE COMMUNITY ADDS
cds-event-monitoring

Answers the dead-letter side: the dead-message queues named in its configuration are consumed and acknowledged, and their messages can be requeued one at a time or a whole queue at once.

A Node.js coverage assessment has not been written. View all flavors

Licence1

LicenceSAP Developer License Agreement 3.2 CAP§ 1AlwaysA covered CAP application sends SAP product data through an external broker where it is copied, saved or processed in a non-SAP product.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.

Messaging is not automatically mass extraction, but an external broker can cross the boundary named in section 1. The data flow, volume and interoperability purpose therefore need to be checked for the concrete design.

SAP Developer License Agreement 3.2 CAP →

Artifacts7

7 of 7 artifacts
ArtifactSignals
CDS plugins4
@cap-js-community/event-queueTransactional processing of asynchronous and periodic CAP events
Signals
Functional boundary+1
@odatano/watchCAP plugin watching Cardano addresses and emitting events
Signals
Use terms
cds-event-monitoringStores, browses and resends messages a CAP service receives
Signals
Use terms
cds-natsNATS messaging service for the CAP Node.js runtime
Signals
Functional boundary+1
Packages2
@cap-js-community/sap-afc-sdkSDK for SAP Advanced Financial Closing scheduling providers on CDS
Signals
none
@sap/cdsCAP Node.js runtime
Signals
none
Services1
Event MeshManaged queues and topics over AMQP, MQTT and REST
Signals
none

Details

What changed — and what it makes stale3
@sap/cds 10.0, CAP, Node.js

The queue's runners coordinate through application-level locking: a picked-up message is marked processing and the row lock is released after selection. @sap/cds 8 did not check the status column, @sap/cds 9 held a row-level lock for the whole processing.

Makes stale:

A rolling upgrade straight from @sap/cds 8 to 10, which the guide says can double-process messages; drain the queue or upgrade through 9.

@sap/cds 9.5.1, CAP, Node.js

Before this, a tenant's outbox messages were only picked up by a background job that polled across all tenants on a fixed interval, bounding delivery latency by that poll cycle. The default processing strategy changed to trigger asynchronous, per-tenant processing as part of the request that submits the message, rather than a regular sweep over every tenant; the old polling strategy is still available by setting cds.outbox.persistent.scheduler.enabled: false.

Makes stale:

Descriptions of outbox delivery as bound by a fixed cross-tenant poll interval — since this release the default path triggers processing from the submitting request instead.

@sap/cds 7.4.0, CAP, Node.js

Before this, cds.requires.outbox: true gave an in-memory outbox — events waited in process memory until commit, then sent, with nothing surviving a crash before dispatch. The default flipped to persistent-outbox: messaging services and the audit-logging service now write to a database table before dispatch, and the old in-memory behaviour survives only as an explicit opt-out.

Makes stale:

Guidance that says enabling cds.requires.outbox gives an in-memory-only queue, or that database-backed delivery needs its own separate configuration. Since November 2023, outbox: true already means persistent-outbox.

Coverage
statecore and community, CAP, Node.js, derived
also inABAP, BTP/BAIP
For your agent
Ref
capability:async-processing
JSON
/capabilities/async-processing.json
MCP
Connecting an agent