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
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ edit the command's Short, Long, Example or flag usage and run `make docs`.
| [`n8n otel test-trace`](n8n_otel_test-trace.md) | Send one test span to an OTLP collector |
| [`n8n otel`](n8n_otel.md) | Manage OpenTelemetry tracing settings |
| [`n8n package export`](n8n_package_export.md) | Export agents, workflows, folders, or projects as an n8n package (beta) |
| [`n8n package import-selection`](n8n_package_import-selection.md) | Import chosen workflows from one project of an n8n package (beta) |
| [`n8n package import`](n8n_package_import.md) | Import an n8n package into a project (beta) |
| [`n8n package`](n8n_package.md) | Export and import n8n packages (beta) |
| [`n8n project create`](n8n_project_create.md) | Create a project |
Expand Down
6 changes: 5 additions & 1 deletion docs/n8n_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Export and import n8n packages (beta)

Move agents, workflows, folders, and projects between instances as gzipped tar
packages (.n8np). Start with 'export' to write a package file from this
instance, then 'import' to read one back into a project.
instance, then 'import' to read one back into a project, or
'import-selection' to cherry-pick chosen workflows from one project of a
project package.

The whole group is beta: breaking changes may still occur without a major
version bump. Export needs the licensed Packages feature. Import can need
Expand All @@ -25,6 +27,7 @@ n8n package [flags]
n8n package export --workflow-id abc123 --out workflows.n8np
n8n package export --project-id Ox8O54VQrmBrb4qL --out project.n8np --output json
n8n package import --file workflows.n8np --workflow-conflict-policy new-version --yes
n8n package import-selection --file project.n8np --project-id Ox8O54VQrmBrb4qL --workflow-id 2tUt1wbLX592XDdX --yes
```

### Options
Expand All @@ -38,4 +41,5 @@ n8n package [flags]
* [n8n](n8n.md) - Command-line client for the n8n API
* [n8n package export](n8n_package_export.md) - Export agents, workflows, folders, or projects as an n8n package (beta)
* [n8n package import](n8n_package_import.md) - Import an n8n package into a project (beta)
* [n8n package import-selection](n8n_package_import-selection.md) - Import chosen workflows from one project of an n8n package (beta)

68 changes: 68 additions & 0 deletions docs/n8n_package_import-selection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## n8n package import-selection

Import chosen workflows from one project of an n8n package (beta)

### Synopsis

Cherry-pick workflows from one source project of a project package
(.n8np) instead of importing the whole package. Send the archive with
--file FILE or --file - for stdin, name the source project with
--project-id as it appears in the package, and list the source workflows
to import with --workflow-id. The workflows are written into the
instance project with that same ID, which is created if it does not
exist yet; there is no target-project or folder flag.

Use this instead of 'n8n package import' to promote a few workflows
without touching the rest of the project. The import is additive: it
never removes a workflow the selection omits, and it deletes only the
destination workflows listed with --delete-workflow-id (archived by
default; --overwrite-deletion-policy hard-delete also drops their
executions permanently, so prefer archive). --workflow-id may be omitted
for a delete-only run. Selected IDs from another project are dropped,
absent delete IDs are a no-op, and an ID cannot be both imported and
deleted. Folder, tag, and project policies are fixed by the server; only
the workflow conflict, workflow ID, and deletion policies are settable.
A workflow package is rejected with a 400: export a project package with
'n8n package export --project-id'.

Beta: breaking changes may still occur without a major version bump.
This mutates the instance, so interactive runs ask for confirmation and
non-interactive runs require --yes; --file - also requires --yes because
stdin cannot answer. Needs workflow:import, plus workflow:delete when
deleting or when an update changes a workflow's archive state, and the
licensed Packages feature. Output is the same import result as
'n8n package import'.

```
n8n package import-selection [flags]
```

### Examples

```
n8n package import-selection --file project.n8np --project-id Ox8O54VQrmBrb4qL --workflow-id 2tUt1wbLX592XDdX --workflow-id 7pQr3sTuVwXyZaBc --yes
n8n package import-selection --file project.n8np --project-id Ox8O54VQrmBrb4qL --workflow-id 2tUt1wbLX592XDdX --delete-workflow-id 9xKp2mNqRzAbCdEf --workflow-conflict-policy fail --output json --yes
n8n package import-selection --file project.n8np --project-id Ox8O54VQrmBrb4qL --delete-workflow-id 9xKp2mNqRzAbCdEf --overwrite-deletion-policy hard-delete
```

### Options

```
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
--delete-workflow-id stringArray destination workflow ID to remove from the target project, repeatable; needs workflow:delete and must not match a --workflow-id (default: none)
--file string project package archive (.n8np) to import from: a file path, or - for stdin (required; stdin requires --yes)
-h, --help help for import-selection
--output string output format: text or json (JSON is the full import result) (default "text")
--overwrite-deletion-policy string how --delete-workflow-id removes workflows: archive (recoverable) or hard-delete (also drops executions permanently; prefer archive); needs --delete-workflow-id (default: server default archive)
--project-id string source project ID as it appears in the package; also the target project ID, created if missing (required)
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--workflow-conflict-policy string selected workflow that already exists in the target project: new-version updates it, fail rejects the import, skip leaves it unchanged (default: server default new-version)
--workflow-id stringArray source workflow ID to import from --project-id, repeatable (default: none, for a delete-only run with --delete-workflow-id)
--workflow-id-policy string ID for newly created workflows, always sent: source reuses the package ID, new mints a fresh ID (default: source) (default "source")
--yes confirm importing and deleting the listed workflows without prompting (required when stdin is not interactive)
```

### SEE ALSO

* [n8n package](n8n_package.md) - Export and import n8n packages (beta)

1 change: 1 addition & 0 deletions internal/cli/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func TestHelpSucceedsAtEveryLevel(t *testing.T) {
{"package"},
{"package", "export"},
{"package", "import"},
{"package", "import-selection"},
{"git-connection"},
{"git-connection", "list"},
{"git-connection", "create"},
Expand Down
Loading
Loading