CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

cap-n8n

Maps CAP onto n8n: a programmatic workflow API, @n8n.trigger annotations dispatched through the transactional outbox, and a typed cds import --from n8n.

Facts

Latestv0.1.0ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
Workflow integrationCAPWorkflow integrationcapabilityDriving an external workflow or automation engine from an application and reacting to what it emits — triggering runs transactionally and importing the engine’s shape as a typed model.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds≥ 8.0@sap/cdsartifactThe peer range, as published.

Who is behind it

Sören LeibachSören LeibachPersonMaintains this
In the atlas: maintains 6, contributes to 5, wrote 1
@sleibach
maintainer

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.
SAP Developer License Agreement 3.2 CAP →

What it declares

Every artifact

Type
CDS plugin
Origin
Independently maintained
Runtime
Node.js

As a CDS plugin

Declared for
>=8.0
Distributed through
npm

Connections2

cap-n8n connectionscap-n8nFUNCTIONAL→ alternative to1alternative to authored@cap-js/n8n→ provides1provides authoredWorkflow integration

Install

npm add cap-n8n

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from sleibach/cap-n8n under Apache-2.0, read
sleibach/cap-n8n/README.mdOn GitHub

cap-n8n

A SAP CAP plugin that maps the @cap-js/process shape onto n8n: a programmatic Workflow API, @n8n.trigger annotations routed through the transactional outbox, and a typed cds import --from n8n.

The only thing you need to provide is an n8n service key (a base URL + API key from any n8n instance). Everything else — seeding workflows, activating, triggering, polling executions, asserting — runs autonomously.

At a glance

Annotations — fire n8n webhooks on lifecycle events, after commit, via the transactional outbox:

@n8n.trigger: 'book-ordered'                                  // CREATE + UPDATE
entity Orders as projection on my.Orders;

@n8n.trigger: { workflow: 'book-saved', on: ['SAVE'] }        // CRUD + Fiori draft events
@odata.draft.enabled entity Books as projection on my.Books;

Programmatic API — drive workflows from your handlers:

const n8n = await cds.connect.to('n8n')
await n8n.trigger('book-ordered', { book: 'Moby Dick' })      // POST /webhook/:path
const execs = await n8n.listExecutions(workflowId)            // poll & assert results

Typed import — turn a workflow into a typed CDS service:

cds import workflow.json --from n8n
#   → action trigger(book: String, quantity: Integer) returns { executionId: String };

Console mode in development (no n8n needed), .env or BTP destination otherwise.

Getting started — the sample app

test/bookshop is the reference application: a minimal bookshop showing every feature (all annotation forms, draft events, bound actions, the typed import, and the test setup). It runs without any n8n instance:

npm install && npm run build
cd test/bookshop
npm run watch        # console mode — triggers are logged, no n8n needed
npm run watch:live   # real mode — needs an n8n service key in .env (see .env.example)

Start there: test/bookshop/README.md walks through firing each trigger with curl and using the app as a template for your own project.

Install

npm add cap-n8n

Configure connectivity

Local development — drop the service key into a .env file (gitignored):

N8N_BASE_URL=https://your-instance.app.n8n.cloud
N8N_API_KEY=eyJ...your-api-key...

By default the plugin runs in console mode (kind: n8n-console): triggers are logged and a synthetic executionId is returned, so the app runs with no instance at all. To talk to a real instance locally, run with the REST kind, e.g.:

cds watch --profile hybrid   # or set requires.n8n.kind = 'n8n-rest'

Production (BTP) — user-provided service (simplest) — create and bind a user-provided service instance carrying the service key. CAP merges its credentials into cds.requires.n8n.credentials automatically:

cf create-user-provided-service n8n -p '{"baseUrl":"https://your.n8n.cloud","apiKey":"eyJ..."}'
cf bind-service <your-app> n8n

If the instance has a different name, point CAP at it from your app config:

{ "cds": { "requires": { "n8n": { "vcap": { "name": "my-n8n" } } } } }

Production / hybrid (BTP) — destination — alternatively bind a destination named n8n. Put the base URL in the destination URL and the API key in the additional property URL.headers.X-N8N-API-KEY. The plugin resolves it via @sap-cloud-sdk/connectivity, exactly like @cap-js/notifications.

Inline credentials — you can also put credentials directly in your app config and keep the secret in an environment variable via the env: indirection:

{
  "cds": {
    "requires": {
      "n8n": {
        "credentials": { "baseUrl": "https://your.n8n.cloud", "apiKey": "env:N8N_API_KEY" }
      }
    }
  }
}

Resolution order: bound/inline credentials (incl. cds bind in hybrid mode) → BTP destination → N8N_BASE_URL/N8N_API_KEY environment variables.

Programmatic API

const n8n = await cds.connect.to('n8n')

await n8n.trigger('book-ordered', { book: 'Moby Dick', buyer: 'a@b.com' }) // POST /webhook/:path
await n8n.activate(workflowId)         // POST /api/v1/workflows/:id/activate
await n8n.deactivate(workflowId)       // POST /api/v1/workflows/:id/deactivate
await n8n.listExecutions(workflowId)   // GET  /api/v1/executions?workflowId=
await n8n.getExecution(executionId)    // GET  /api/v1/executions/:id?includeData=true
await n8n.createWorkflow(json)         // POST /api/v1/workflows  (seed helper)

Annotations

Annotate an entity or event with the n8n production-webhook path. After the surrounding transaction commits, the payload is POSTed to {baseUrl}/webhook/<path>, routed through the CAP transactional outbox for resilience:

// string shorthand — fires on CREATE and UPDATE
@n8n.trigger: 'book-ordered'
entity Orders as projection on my.Orders;

// record form — pick the lifecycle events explicitly
@n8n.trigger: { workflow: 'book-archived', on: ['DELETE'] }
entity Books as projection on my.Books;

// Fiori draft-enabled entities: draft lifecycle events are supported
@odata.draft.enabled
@n8n.trigger: { workflow: 'book-saved', on: ['SAVE'] }
entity Books as projection on my.Books actions {
  // bound actions fire when called (on the active or the draft row)
  @n8n.trigger: 'book-archived'
  action archive();
};

// unbound actions/functions and custom events work too
event OrderShipped @(n8n.trigger: 'order-shipped') { orderId: UUID; }

Supported on events (entities):

EventFiresPayload
CREATE / UPDATErow written (incl. draft activation)the resulting row
DELETErow deletedthe deleted row's keys
SAVEdraft activated (Fiori "Save") — on non-draft entities = CREATE+UPDATE shortcutthe activated data
EDITuser starts editing (draft created from active row)the row being edited
NEW / PATCH / DISCARDdraft created / field changed / discardedthe draft data

NEW/PATCH/SAVE/EDIT/DISCARD require @odata.draft.enabled (CANCEL is accepted as the legacy alias for DISCARD). Bound-action payloads are the bound row's keys merged with the action parameters; unbound actions send the call parameters.

Typed import

cds import workflow.json --from n8n

Generates a typed CDS service with a trigger action. The input contract is derived, most reliable first:

  1. A node named CAP Input Schema holding a JSON Schema (recommended convention).
  2. The webhook node's declared body fields.
  3. Pinned/sample data (*.sample.json or the node's pinData).
  4. Fallback: a single body : LargeString passthrough.

Tests

npm test
  • The console integration suite always runs (no key needed).
  • The REST integration suite runs the live seed → activate → trigger → poll → assert loop and skips gracefully unless N8N_BASE_URL + N8N_API_KEY are set.
  • For CI, run an n8nio/n8n container and point N8N_BASE_URL at it.

License

Apache-2.0

Apache-2.0, read

History

Latest

v0.1.0

2downloads per week, npm
Weekly downloads for cap-n8n26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 2.20 Apr – 26 Apr: 027 Apr – 3 May: 04 May – 10 May: 011 May – 17 May: 018 May – 24 May: 025 May – 31 May: 01 Jun – 7 Jun: 08 Jun – 14 Jun: 15015 Jun – 21 Jun: 1322 Jun – 28 Jun: 529 Jun – 5 Jul: 126 Jul – 12 Jul: 913 Jul – 19 Jul: 1020 Jul – 26 Jul: 227 Jul – 2 Aug: 13 Aug – 9 Aug: 310 Aug – 16 Aug: 317 Aug – 23 Aug: 324 Aug – 30 Aug: 831 Aug – 6 Sept: 57 Sept – 13 Sept: 414 Sept – 20 Sept: 421 Sept – 27 Sept: 228 Sept – 4 Oct: 15 Oct – 11 Oct: 012 Oct – 18 Oct: 2
Declared alternative
  1. @cap-js/n8nTriggers n8n workflows from a CAP application
Workflow integration
  1. com.sap.cds:cds-feature-n8nTriggers n8n workflows from CAP Java through the outbox
  2. @cap-js/n8nTriggers n8n workflows from a CAP application
  3. @cap-js/processStarts and manages SAP Build Process Automation processes from CAP

Details

Sources4
GitHub APIdiscovered here, sleibachchecked
npm registry, cap-n8nversion, releases, installschecked
github.com/sleibach/cap-n8ntree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

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
runtimesnode
declared for>=8.0
latestv0.1.0
first release
releases and cadence1
discovered viaGitHub API · sleibach
first seen in the atlas
ecosystem and domaincap, integration-and-messaging
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:sleibach-cap-n8n
JSON
/artifacts/sleibach-cap-n8n.json
MCP
Connecting an agent