Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions docs/n8n_node-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ Manage node type availability policies
### Synopsis

Read and replace the policies that decide which node types may be used, at
instance scope and per project. A policy is a default action plus an ordered
rule list; the first matching rule wins and the default applies to the rest.

Every action is a full replacement, so the workflow is get, edit, set: start
from 'get --output json', change the rules, and pass the whole document back.
The version field carries that round trip and a stale value is rejected with
409, which means someone else changed the policy first.
instance scope and per project. Preview API: n8n may change it without notice.

A scope has a default action and one or more attached policy documents, each an
ordered rule list; the first matching rule wins and the default applies to the
rest. 'get' reports the composed view: the rules of every attached document in
evaluation order. 'set' replaces only the scope's own document.

Start with 'instance get'. Writes are full replacements, so the workflow is get,
edit, set: start from 'get --output json', change the rules, and pass the whole
document back. The version field carries that round trip and a stale value is
rejected with 409, which means the policy or one of its attachments changed
first. Once a scope has more than its own document attached, a get-edit-set
round trip copies the rules of the shared documents into the scope's own
document; check the scope's attachments before editing one that has them.

Requires nodeTypePolicy:manage, n8n 2.40.0 or later, and the licensed
type-availability-policies module. Instances without it answer 404 or 503.
Expand Down
3 changes: 2 additions & 1 deletion docs/n8n_node-policy_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ only scope that accepts the delegate action, which hands a decision down to the
project policy instead of settling it.

An instance that was never configured reports no rules, an allow default, and
version 0; writing to it creates the policy document.
version 0; writing to it creates the policy document. Preview API: n8n may
change it without notice.

```
n8n node-policy instance [flags]
Expand Down
8 changes: 5 additions & 3 deletions docs/n8n_node-policy_instance_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ Get the instance node type policy
Get the composed instance node type policy: its default action and the rules of
every attached policy document, in evaluation order. Use --output json as the
starting point for a get-edit-set workflow; the version it reports is what 'set'
must send back.
must send back. 'set' writes those rules into the instance's own document, so
with shared documents attached the round trip copies their rules too.

A scope that was never configured reports no rules, defaultAction allow, and
version 0. Requires nodeTypePolicy:manage.
scopeId identifies the scope's attachments and is null until the scope is first
written. A scope that was never configured reports no rules, defaultAction allow,
and version 0. Requires nodeTypePolicy:manage.

```
n8n node-policy instance get [flags]
Expand Down
19 changes: 14 additions & 5 deletions docs/n8n_node-policy_instance_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ Fully replace the instance node type policy

### Synopsis

Replace the instance default action and every rule of its policy document from
strict JSON. This is a PUT, not a patch: rules, defaultAction, and version are
all required, and any rule left out is deleted. Start from
Replace the instance default action and every rule of its own policy document
from strict JSON. This is a PUT, not a patch: rules, defaultAction, and version
are all required, and any rule left out is deleted. Start from
'n8n node-policy instance get --output json'.

'get' reports the rules of every attached document, but 'set' writes only the
instance's own document. When shared documents are attached, remove their
rules from the input or they are copied into the own document; the attached
documents themselves are not changed.

Actions are allow, deny, or delegate. Selectors are {"kind":"name"} for one node
type or {"kind":"package"} for every node type in a package. Rule ids must be
unique and rules are evaluated in list order.
Expand All @@ -17,7 +22,11 @@ version must equal the version last read; a stale value is rejected with 409 and
nothing changes. Blocking a node type stops workflows that use it, so
interactive runs ask for confirmation and non-interactive runs require --yes.
scopeId and warnings from a previous response are accepted and ignored.
Requires nodeTypePolicy:manage.

The response lists warnings that do not fail the write: kind shadowed means an
earlier rule already decides the rule's node types, and kind notLoaded means the
rule selects node types this instance has not loaded. Preview API: n8n may
change it without notice. Requires nodeTypePolicy:manage.

```
n8n node-policy instance set [flags]
Expand All @@ -38,7 +47,7 @@ n8n node-policy instance set [flags]
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
-h, --help help for set
--input string full node type policy JSON file path, or - for stdin (required; maximum 1 MiB)
--output string output format: text or json (JSON is the stored policy plus shadowed-rule warnings) (default "text")
--output string output format: text or json (JSON is the stored policy plus warnings, each with a kind) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--yes confirm the full replacement without prompting (required when stdin is not interactive)
```
Expand Down
1 change: 1 addition & 0 deletions docs/n8n_node-policy_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ policy, so a node type can still be blocked by instance scope.

Project scope accepts allow and deny only; delegate is instance-scope. A project
that was never configured reports no rules, an allow default, and version 0.
Preview API: n8n may change it without notice.

```
n8n node-policy project [flags]
Expand Down
14 changes: 8 additions & 6 deletions docs/n8n_node-policy_project_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Get a project's node type policy
### Synopsis

Get one project's own composed node type policy: its default action and the rules
of its policy document, in evaluation order. This is not the effective decision
for the project, because the instance policy is applied on top at evaluation.

A project that was never configured reports no rules, defaultAction allow, and
version 0. Use --output json as the input for 'set'. Requires
nodeTypePolicy:manage. Find project IDs with 'n8n project list'.
of every policy document attached to the project, in evaluation order. This is
not the effective decision for the project, because the instance policy is
applied on top at evaluation.

scopeId identifies the scope's attachments and is null until the project policy
is first written. A project that was never configured reports no rules,
defaultAction allow, and version 0. Use --output json as the input for 'set'.
Requires nodeTypePolicy:manage. Find project IDs with 'n8n project list'.

```
n8n node-policy project get <project-id> [flags]
Expand Down
27 changes: 18 additions & 9 deletions docs/n8n_node-policy_project_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,30 @@ Fully replace a project's node type policy

### Synopsis

Replace one project's default action and every rule of its policy document from
strict JSON. This is a PUT, not a patch: rules, defaultAction, and version are
all required, and any rule left out is deleted. Start from
Replace one project's default action and every rule of its own policy document
from strict JSON. This is a PUT, not a patch: rules, defaultAction, and version
are all required, and any rule left out is deleted. Start from
'n8n node-policy project get <project-id> --output json'.

'get' reports the rules of every attached document, but 'set' writes only the
project's own document. When shared documents are attached, remove their rules
from the input or they are copied into the own document.

Project scope accepts allow and deny only; delegate belongs to the instance
policy and is rejected before the request is sent. Selectors are
{"kind":"name"} or {"kind":"package"}, rule ids must be unique, and rules are
evaluated in list order.

version must equal the version last read; a stale value, or a policy document
shared with another scope, is rejected with 409 and nothing changes. Blocking a
node type stops workflows in the project that use it, so interactive runs ask
for confirmation and non-interactive runs require --yes. Requires
nodeTypePolicy:manage.
version must equal the version last read; a stale value, or a project document
that is shared with another scope, is rejected with 409 and nothing changes.
Blocking a node type stops workflows in the project that use it, so interactive
runs ask for confirmation and non-interactive runs require --yes. scopeId and
warnings from a previous response are accepted and ignored.

The response lists warnings that do not fail the write: kind shadowed means an
earlier rule already decides the rule's node types, and kind notLoaded means the
rule selects node types this instance has not loaded. Preview API: n8n may
change it without notice. Requires nodeTypePolicy:manage.

```
n8n node-policy project set <project-id> [flags]
Expand All @@ -38,7 +47,7 @@ n8n node-policy project set <project-id> [flags]
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
-h, --help help for set
--input string full node type policy JSON file path, or - for stdin (required; maximum 1 MiB)
--output string output format: text or json (JSON is the stored policy plus shadowed-rule warnings) (default "text")
--output string output format: text or json (JSON is the stored policy plus warnings, each with a kind) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--yes confirm the full replacement without prompting (required when stdin is not interactive)
```
Expand Down
Loading
Loading