cds-data-pipeline
Declarative scheduled pipelines between CAP services — each one a linear READ, MAP, WRITE from a single source to a single target, with tracking, retry, delta support and a management API.
The linearity is the design: one source, one target, no branching, so a run either moved a batch or it did not and the tracking says which. Delta support and retry are what make it survive a schedule rather than a one-off script.
Facts
Where it sits
Who is behind it
In the atlas: maintains 6, contributes to 9, wrote 12@mikezaschkamaintainer
Before choosing this
Conditions
LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
- § 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.
- § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
Also, from Data federation§ 1: Section 1 restricts mass extraction to a non-SAP product and states a scoped interoperability exception. That boundary is central to a replication design and must be checked against the actual use.
What it declares
Every artifact
- Type
- CDS plugin
- Origin
- Independently maintained
- Runtime
- Node.js
As a CDS plugin
- Declared for
- >=9
- Distributed through
- npm
For data federation
- Approach
- Delta handlingWrites reach the source
- Strategy
- copy
- Refresh
- scheduledexternal trigger
- Reads from
- ODataRESTCAP service
- Writes to
- local databaseremote OData service
Connections
Reading data from another system as if it were local
Data federation for CAP via delegation, caching and replication
Download
Install
npm add cds-data-pipelineDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from mikezaschka/cds-data under MIT, readcds-data-pipeline
A CAP plugin for declarative, scheduled data pipelines between CAP services. Each pipeline moves data from one source to one target in a linear READ → MAP → WRITE flow — with tracking, retry, delta support, and a management API out of the box.
Beyond CAP
CAP already gives you the moving parts — cds.connect.to, consumption views, cds.ql, UPSERT, cds.spawn, the Event Queues scheduling API (CDS 10), and the standard before / on / after hook API on services. Reference samples assemble the read–map–write loop by hand: paging, delta watermarks, error handling, and scheduling copied into every project.
This plugin reuses those primitives and adds the orchestration layer on top:
| Reuses from CAP | Adds on top |
|---|---|
cds.connect.to for source and target I/O | Fixed READ → MAP → WRITE run envelope with PIPELINE.* events |
cds.spawn / Event Queues scheduling API / external execute | Three scheduling engines — see below |
UPSERT / INSERT / DELETE via target adapters | Delta modes, retry with backoff, concurrency guard, run history |
| Standard service hooks | Per-pipeline before / on / after on every phase — opt-in only |
| Consumption views (when used with federation) | Management OData at /pipeline, data inspector, Pipeline Console |
You call addPipeline({ source, target, … }) once; the engine owns the loop. Hooks are the CAP escape hatch when a run needs custom logic — not a requirement for every pipeline.
Install
npm add cds-data-pipeline
| Dependency | Version | Notes |
|---|---|---|
@sap/cds | >= 9 | CDS 9 and CDS 10 |
| Node.js | >= 22 |
Connect: cds.connect.to('data-pipeline'). Full feature list: Features.
Features
Pipeline intents
Intent is inferred from the config shape — no kind flag.
| Intent | Typical shape |
|---|---|
| Replicate | Remote entity → local DB table |
| Materialize | source.query (aggregates, joins) → local table |
| Move-to-service | Local/remote source → remote OData target |
| Fan-in | Multiple sources → one table via source.origin |
Source adapters
OData V2/V4, REST (cursor/offset/page), CQN, server-driven paging, custom. See Sources.
Target adapters
Local DB (default), remote OData, custom. See Targets.
Delta, scheduling, hooks
| Area | Highlights |
|---|---|
| Delta | timestamp, key, datetime-fields, or full refresh |
| Scheduling | spawn (cds.spawn), queued (Event Queues API), or external trigger — see below |
| Event hooks | PIPELINE.START → READ → MAP → WRITE → DONE via standard before / on / after |
| Housekeeping | Opt-in PipelineRuns retention (retentionDays, maxRuns) |
Scheduling engines
| Engine | CAP primitive | When to use |
|---|---|---|
spawn (default) | cds.spawn({ every }) | Dev, single instance, best-effort interval |
queued | cds.queued(srv).schedule(...).every(...) — the June 2026 scheduling API | Scaled deployments: single-winner across instances, survives restarts, cron (engine: 'queued'). On CDS 10, named tasks (.as(...)) enable live setSchedule / clearSchedule via unschedule |
| External | POST /pipeline/execute | BTP Job Scheduling Service, Kubernetes CronJob, corporate cron |
schedule: 600_000, // spawn — implicit engine
schedule: { every: '10m', engine: 'queued' }, // Event Queues: .schedule().every()
schedule: { cron: '0 2 * * *', engine: 'queued' },
Details: Internal scheduling (queued) · External scheduling · Recipes · Event hooks
Management API and observability
OData at /pipeline: pipeline list, run history, statistics, execute, flush, inspectData, configuration overrides. See Management service.
Resilience
Retry with exponential backoff on remote I/O, concurrency guard (no parallel runs), transactional batches.
Quick example
const cds = require('@sap/cds');
cds.on('served', async () => {
const pipelines = await cds.connect.to('data-pipeline');
await pipelines.addPipeline({
name: 'BusinessPartners',
source: { service: 'API_BUSINESS_PARTNER', entity: 'A_BusinessPartner' },
target: { entity: 'db.BusinessPartners' },
delta: { field: 'modifiedAt', mode: 'timestamp' },
schedule: 600_000,
});
});
module.exports = cds.server;
Step-by-step: Get started
Used by cds-data-federation
cds-data-federation composes this engine for annotation-driven sync — you install both packages, but rarely call addPipeline yourself:
@federation.replicate— federation scans consumption views at boot and registers entity-shape pipelines viapipeline-binding.js(source entity → local table, schedule, delta from annotation options).cache.strategy: 'entity'on@federation.delegate— on TTL miss, a pipeline fills a SQLite snapshot of the projected entity.
Federation-bound pipelines show up in /pipeline and the Pipeline Console alongside programmatic ones. For custom transforms on a federation pipeline, hook the pipeline by name (defaults to the entity name). See the federation README and first replication.
Event hooks (optional)
DataPipelineService is a normal cds.Service. The default path needs no handler code — register before / on / after on PIPELINE.* only when a run needs filtering, enrichment, side effects, or observability beyond the built-in MAP/WRITE. That is the usual CAP pattern: declarative wiring by default, intercept when processing gets non-trivial.
const pipelines = await cds.connect.to('data-pipeline');
// Filter source rows before rename mapping (federation replicate or addPipeline)
pipelines.before('PIPELINE.MAP', 'ReplicatedPartners', (req) => {
req.data.sourceRecords = req.data.sourceRecords.filter(r => !r.blocked);
});
// Per-batch side effect after the default WRITE commits its statistics
pipelines.after('PIPELINE.WRITE', 'Shipments', async (_results, req) => {
const { runId, batchIndex, statistics } = req.data;
await cds.tx(req).run(INSERT.into('BatchMetrics').entries({
runId, batchIndex, created: statistics?.created ?? 0,
}));
});
Full event reference: Event hooks · Management service
Pipeline Console
Pre-built UI for /pipeline — enable via config reuse or cds add pipeline-console:
{
"cds": {
"requires": {
"data-pipeline": {
"impl": "cds-data-pipeline",
"management": {
"reuse": {
"api": true,
"console": true
}
}
}
}
}
}
The console loads pinned SAPUI5 1.150.0 from ui5.sap.com. Set management.ui5Url to an HTTP(S) URL or same-origin absolute path when you host the runtime yourself.


Details: Pipeline Console · Feature activation
Documentation
- Pipeline guide — concepts, recipes, adapters
- Feature catalog
- Programmatic API
- Management service
AI assistants
Coming soon. Agent guidance (AGENTS.md) and task skills for coding assistants will ship in a future release.
SAP data extraction.
@sap/cdsships under the SAP Developer License Agreement (3.2 CAP). Section 1 limits mass extraction from an SAP product to a non-SAP product unless required for interoperability with an SAP product. When pointing a pipeline at an SAP source, stay within that carve-out.
History
Others providing
Compare all 6 on the Data federation page →- SAP Master Data IntegrationSAP Master Data IntegrationA multi-tenant cloud service that replicates master data between two or more clients, giving a hybrid landscape a consistent view of it, with filters set through SAP Business Data Orchestration service.sap official, btpCloud service replicating master data across a hybrid landscapefrom BTP/BAIP
- cds-federation-synonymscds-federation-synonymsAn experimental CAP plugin for CAP-to-CAP data federation over SAP HANA synonyms, so one project reads another's tables without the rows being copied.sap official, capCAP-to-CAP data federation over SAP HANA synonymsfrom CAP
- @cap-js-community/common@cap-js-community/commonSix independent features for CAP services in one package: replication cache, migration check, rate limiting, a Redis client broker, a local HTML5 repository and a CDM builder.community org, capSix CAP features in one package, from replication cache to rate limitsfrom CAP
- cds-data-federationcds-data-federationA data federation plugin for SAP CAP applications that declares delegation, caching and replication on a consumption view through CDS annotations, instead of hand-written handlers.independent, capData federation for CAP via delegation, caching and replicationfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:mikezaschka-cds-data-pipeline- JSON
- /artifacts/mikezaschka-cds-data-pipeline.json
- MCP
- Connecting an agent