Files

40 KiB
Raw Permalink Blame History

package

Export and import Agents, workflows, and Skills as portable n8n packages (.n8np archives).

Beta feature: n8n packages are still under development and there may be breaking changes on APIs.

package export

Export Agents, workflows, Skills, folders, or projects into a gzipped .n8np archive. Each exported folder includes its nested folders. Combine Agent, workflow, and folder IDs in one selection. Use project IDs separately for whole-project exports.

n8n-cli package export --agent-id=reviewer --agent-id=helper --dependency-policy=include-in-package -o agents.n8np
n8n-cli package export --agent-id=reviewer --workflow-id=tool -o mixed.n8np
n8n-cli package export --skill-id=guide -o skills.n8np
n8n-cli package export --project-id=abc --include-skills -o project-with-skills.n8np
n8n-cli package export --workflow-id=abc --output=export.n8np
n8n-cli package export -w abc -w def -o team.n8np
n8n-cli package export --folder-id=xyz -o folders.n8np
n8n-cli package export --project-id=abc -o project.n8np
n8n-cli package export -p abc -p def -o projects.n8np
n8n-cli package export -w abc --include-variable-values=false -o export.n8np
n8n-cli package export -w abc --include-tags=false -o export.n8np
Flag Description
--skill-id Project or instance Skill ID to include. Repeat to select several. No Agent is required.
--include-skills Include all Skills owned by the selected projects. Requires --project-id.
--agent-id Agent ID to include. Repeat the flag to export several.
-w, --workflow-id Workflow ID to include. Repeat the flag to export several.
--folder-id Folder ID to include with its nested folders. Repeat the flag to export several.
-p, --project-id Project ID to include. Repeat the flag to export several.
-o, --output File to write the package to. Defaults to export.n8np.
--include-variable-values true (default) or false. Whether values of variables referenced by the exported Agents and workflows are bundled into the package. When false, variables still travel as name/type files (and in the package requirements), just without their values.
--include-tags true (default) or false. Whether tags assigned to the exported workflows are bundled into the package. When false, no tag data is included in the package.
--include-archived false (default) or true. Whether folder exports include archived workflows and project exports include archived workflows and agents. When true, they travel with isArchived: true and are archived on import. Workflows given by --workflow-id and agents given by --agent-id always export, also when archived.
--dependency-policy Policy for workflow and agent dependencies outside the selected package contents. fail (default) aborts when a required definition is absent from the package. include-in-package adds accessible dependencies recursively. reference-only records external requirements without including their definitions.
--version-policy Which version of each workflow and agent to export. latest (default) exports the current draft. published-strict requires a published version. prefer-published uses the published version when available and the draft otherwise. ignore-unpublished skips unpublished selections. Skills always export their latest saved version.
--credential-export-policy Which credential data is bundled into the package: expression-values-only (default on the instance) includes credential fields whose value is an n8n expression (for example ={{ $secrets.apiKey }}), plus a literal value only when it decides whether another credential field shows; older n8n versions can read the package. expressions-and-settings also includes settings: the values of toggle, dropdown, multi-select and number fields that are not password fields. The allowed domains list travels together with its mode. Secrets and other text stay out of the package, and the file names those fields in omittedFields. no-values keeps credential data out of the package, so each credential file carries only its id, name, type and description.

Provide at least one --skill-id, --agent-id, --workflow-id, --folder-id, or --project-id. Explicit Agent selections require agent:export. Workflow and folder selections require workflow:export. Mixed selections require both grants. Whole-project exports require project:export, including projects with Agents. Explicit Skill selection and --include-skills also require the skill:export API-key grant. The caller must separately have projectSkill:read permission on each selected project, or read access to the selected instance Skill.

Export summaries include Agent counts from the server, including added dependencies. JSON output includes these counts and the selected Agent IDs.

The package keeps the channels of each Agent without their credential IDs. A credential that only a channel uses is not a package requirement. The import keeps a connected destination channel. Set up each channel that the import marks setup-required. See the import section for details.

--version-policy applies to workflows and agents, including agents in a project export. The selected version supplies the definition and its references. Workflow names, settings (including errorWorkflow), and tags always use their current values. Agent IDs, names, and MCP availability also use their current values. Under ignore-unpublished, dependencies that cannot be included cause the export to fail only when --dependency-policy is fail or include-in-package. With reference-only, the export records them as external requirements.

Skills have no published versions. The package always contains the latest saved version of each selected Skill and each Skill that an exported Agent uses. This also applies under published-strict. The package does not pin a skill version.

--dependency-policy also applies to workflows and agents. Dependencies include static workflow references and disabled agent references. With fail, include the required definitions in your selection. With include-in-package, n8n adds accessible dependencies recursively. With reference-only, external dependencies are listed in the package requirements. Their definitions and dependencies must already exist on the target instance.

package import

Import Skill-only, Agent-only, mixed, or whole-project .n8np archives. The Agents module must be enabled when the archive contains Agents. Use this command for selected-Agent exports. Agent content is not supported by package import-selection, directory imports, or Promotions.

n8n-cli package import --file=agents.n8np --id-policy=source --publishing-policy=match-source
n8n-cli package import --file=export.n8np
n8n-cli package import --file=export.n8np --project-id=<id> --conflict-policy=skip
n8n-cli package import --file=export.n8np --conflict-policy=fail --credential-missing-mode=must-preexist
n8n-cli package import --file=export.n8np --project-id=<id> --credential-conflict-policy=overwrite
n8n-cli package import --file=export.n8np --conflict-policy=fail --bindings='{"credentials":{"<sourceId>":"<targetId>"}}'
Flag Description
--file Path to the .n8np package file. (required)
--skill-id Import only these Skill IDs. Repeat to select several. Omit to use the package selection.
--delete-skill-id Explicitly remove an unused destination Skill. Repeat to remove several. Unselected Skills remain.
--conflict-policy What to do when an Agent or workflow matches an existing destination. new-version (CLI default) replaces its definition. It also archives or restores a matched workflow to match the package. These transitions require workflow:delete. fail blocks the import. skip leaves it unchanged. All modes create entities without a match. The policy also applies to the skills of imported Agents: new-version saves a changed skill as a new version, skip keeps the existing skill, and fail blocks the import when a matched skill has other content. The import creates a skill that does not exist. See Skills.
-p, --project-id Target project ID. Defaults to your personal project. (alias: --project)
--folder-id Target folder ID within the project. Defaults to the project root. (alias: --folder)
--publishing-policy Publication policy for Agents and workflows. preserve-published-state (instance default) keeps new entities unpublished. It republishes an updated entity only if it was published and the package contains the source-published version. match-source publishes that version, or unpublishes when the source has no published version. Both policies leave publication unchanged when the source publishes a version absent from the package. publish-all requests publication. unpublish-all leaves imported entities unpublished. Skipped entities remain unchanged. Archived workflows remain unpublished.
--id-policy Only source is supported. New Agents and workflows use the package IDs. An ID already used by an unmatched Agent or workflow, in any project, blocks the import. Matched entities keep their destination IDs. Agent and workflow identity maps remain separate.
--missing-node-type-mode Handling for missing workflow node types and Agent node tool types or versions. fail (instance default) blocks the import before writes. import-anyway saves the definitions but blocks publication of affected entities.
--project-conflict-policy What to do when a project in the package already exists on the instance, matched by ID, and by default how its contents are treated too (project packages only): merge (instance default) is purely additive — the existing project's name, description, icon and custom span attributes are left alone and the package's contents are added alongside; overwrite makes the package authoritative, replacing those details (a detail the package omits is left as it is, not cleared) and, via --folder-conflict-policy, removing contents the package does not carry; fail rejects the import before anything is written.
--folder-conflict-policy What to do when a package folder already exists in the target project. Defaults to whatever --project-conflict-policy is, so you state the intent once; for a workflow package, which defines no projects, it defaults to merge. merge reuses the existing folder and merges the package's children into it; fail rejects the import; overwrite additionally removes workflows the package does not contain, at the project root and in package-defined folders (see --overwrite-deletion-policy), and is rejected unless --project-conflict-policy is also overwrite. Folders the package does not define are removed too, but only once nothing is left inside them, so target-only content is never swept up. The import requires a folders-enabled license only when it creates, changes or removes a folder. When overwrite removes a workflow, it requires the workflow:delete scope. When it removes a folder, it requires folder:delete.
--overwrite-deletion-policy How --folder-conflict-policy=overwrite removes a workflow the package does not contain: archive (instance default) archives it, keeping it and its execution history recoverable; hard-delete archives it — the step that unpublishes it — then deletes the workflow and its executions permanently. Each entry in removedWorkflows reports what actually happened in its deletion field, so a hard-delete whose row cannot be dropped yet (unpublishing defers trigger teardown) shows as archived rather than failing the import. Ignored unless the folder conflict policy is overwrite.
--credential-matching-mode How credential references are matched on the target instance: id-only (default, match by id), name-and-type (match by exact name and type), or type-only (match by type). For name-and-type and type-only, candidates are ranked by scope — owned by the target project, then shared into it, then global — and ties within a scope use the most recently updated credential.
--credential-missing-mode What to do when a referenced credential cannot be resolved. create-stub (instance default) creates empty placeholder credentials in the target project; create-with-values also creates them, seeded from the expression data bundled in the package (a reference the package carries no data for falls back to an empty stub). A credential created with package data is listed under credentials.seeded when the package confirms that it carries all source data, and under credentials.incomplete otherwise. The import does not publish the imported version of an Agent or workflow that uses an incomplete credential (incomplete-credential). An active earlier version stays active. create-stub and create-with-values need the credential:create scope when the import creates a credential. must-preexist requires every referenced credential to already exist.
--credential-conflict-policy What to do when a referenced credential matches an existing credential and the package has a different name or different values for it. keep-existing (instance default) never changes a matched credential. overwrite writes the package name and the expression values from the package to a matched credential that a project of the import owns, and lists it under credentials.updated. It keeps all other stored values: secrets, other fields, the OAuth connection, and array fields. It never changes a global credential that a different project owns, or a managed, end-user (resolvable) or instance-level credential. fail rejects the import when overwrite would change a matched credential. No policy writes a match that would not change. overwrite and fail compare stored values, so they need the credential:update permission on each matched credential that a project of the import owns, also when it would not change.
--data-table-matching-mode How data tables referenced by the package are matched on the target instance: by-id (default and only mode) matches the target-project table with the same id — imported tables keep their source id — and never falls back to name matching.
--data-table-missing-mode What to do when a referenced data table is absent in the target project. create (instance default) creates it from the package schema — keeping the source id, with no rows; must-preexist requires it to already exist; do-nothing skips creation. Under the keep-existing and fail schema conflict policies, matched tables are schema-validated (all package columns present with the same name and type), even under do-nothing. Under overwrite-non-destructive, a matched table blocks the import only when a change removes or retypes a column. The import never imports table rows. Matched tables change only under --data-table-schema-conflict-policy=overwrite or overwrite-non-destructive, which keep their rows.
--data-table-schema-conflict-policy How strictly a matched data table's schema is compared. Under keep-existing and fail, every package column must exist on the matched target table with the same name and type. A missing column or a type mismatch rejects the import. keep-existing (instance default) ignores additional columns the target table has of its own; fail is the strict drift-detection choice and rejects those too. keep-existing and fail never alter the matched target table. overwrite changes the matched target table to match the package. It can remove or retype columns. The values in those columns are removed. Rows and other columns are kept. When the package has column ids, a column that is only renamed keeps its values. The changes apply to all workflows that use the table. overwrite-non-destructive makes the same changes as overwrite, but rejects the import and writes nothing when a change removes or retypes a column. A target-only column counts as removed.
--variable-missing-mode What to do when a referenced variable is absent from both the target project and global scope: create-with-value (instance default) creates it with the package value and reports it under variables.created, falling back to an empty stub under variables.stubbed when the package carries no value for it; create-stub always creates an empty value; do-nothing reports unresolved names without creating anything; must-preexist rejects the import. What happens to a variable that does resolve is --variable-conflict-policy's job. Requires a variables-enabled license only when the import creates a variable.
--variable-conflict-policy What to do when a referenced variable resolves in the target project or global scope but the package bundles a different value for it. keep-existing (instance default) leaves the target value alone and reports the name under variables.matched; overwrite silently replaces the value of the existing variable at whichever scope it was found — including a global variable other projects also read — and reports the name under variables.updated; fail rejects the import. No policy touches a resolved variable when there is nothing to change: either the package bundles no value for it (values excluded at export, or an exported value that was itself empty), or the value it bundles already matches the target's. Under overwrite, a project package whose projects hold different values for a name they all resolve to one row — a global none of them shadows — is rejected: one row cannot carry both values. Requires a variables-enabled license only when the import overwrites.
--variable-parent-policy Where create-with-value and create-stub place missing variables for workflow/folder packages (project, the behaviour when omitted, uses the target project; global uses global scope). Must be omitted for project packages, which reject it with a 400 — their placement follows the package layout, so a variable bundled under a project is created in that project and one bundled at the top level is created globally.
--tag-missing-mode What to do when a tag referenced by the package's workflows is absent on the target instance — tags are matched by source id, never by name. create (instance default) creates the tag globally with its source id and name; do-nothing imports the workflows without the missing tags and lists them under tags.skipped.
--tag-conflict-policy What to do when a referenced tag conflicts on the target instance — the same-id target tag carries a different name (rename drift), or the tag's name is held by a different tag (name collision). skip (instance default) imports the workflows without the conflicted tags and lists them under tags.skipped; fail rejects the import; rename renames a drifted target tag to the package name and reconciles a name collision by re-keying the existing tag to the package (source) id, keeping its name and taggings; a drifted tag whose package name is held by another tag still rejects the import.
--bindings Explicit source→target id bindings as a JSON object keyed by entity type, e.g. {"credentials":{"<sourceId>":"<targetId>"}}. Only credentials is honoured today; these bindings are applied before --credential-matching-mode resolution runs.

Requires the API key to hold:

  • workflow:import — when the package contains workflows
  • project:create — when the import creates a project
  • project:update — when --project-conflict-policy=overwrite changes the details of an existing project. A project whose details already match needs no grant.
  • folder:create — when the import creates a folder. A folder that already exists in the target project needs no grant.
  • agent:import and agent:read — when the package contains Agents
  • agent:create, agent:update, agent:publish, or agent:unpublish — when the import plans that action. Skipped Agents require no write grants.
  • skill:create — when the import creates a project or instance skill. The skills of one Agent need only the Agent grants.
  • skill:update — when the import saves a new version of a matched project or instance skill.
  • skill:delete — when the import explicitly removes an unused Skill.

A Skill-only import needs no Agent or workflow grants. Instance Skills need no destination project. Project Skills from a loose package use --project-id or the caller’s personal project. A project package keeps its project IDs.

  • workflow:activate — when the import publishes a workflow, including a republish under the default --publishing-policy=preserve-published-state. Skipped workflows and workflows marked as archived in the package need no activation grant.
  • workflow:deactivate — when --publishing-policy=match-source or unpublish-all unpublishes a workflow. Archiving a workflow needs only workflow:delete.
  • workflow:delete — when --conflict-policy=new-version archives or restores a matched workflow, or when the effective folder conflict policy is overwrite (set directly, or inherited from --project-conflict-policy=overwrite) and the import removes a workflow
  • folder:delete — when the effective folder conflict policy is overwrite (set directly, or inherited from --project-conflict-policy=overwrite) and the import removes a folder
  • dataTable:create — when --data-table-missing-mode is create and the import creates a data table. A data table that already exists in the target project needs no grant.
  • dataTable:update — when --data-table-schema-conflict-policy is overwrite or overwrite-non-destructive and changes at least one matched table
  • variable:create — when the import actually creates a variable, i.e. --variable-missing-mode is create-with-value (the default) or create-stub and at least one referenced variable does not already resolve. A package whose variables all resolve creates nothing and needs neither this scope nor a variables-enabled license.
  • variable:update — when the import would overwrite a variable, i.e. --variable-conflict-policy=overwrite and at least one resolved variable's value differs from the package's. keep-existing (the default) never overwrites and needs neither this scope nor a variables-enabled license.
  • credential:create — when --credential-missing-mode is create-stub (the default) or create-with-values and the import creates at least one credential.
  • credential:update — when --credential-conflict-policy=overwrite and the import changes at least one matched credential.
  • tag:create — when the import would create a tag (under --tag-missing-mode create, the instance default; tags that match, are dropped, or belong only to skipped workflows need no scope)
  • tag:update — when the import would rename or reconcile a tag (under --tag-conflict-policy rename).

Mixed packages require both import grants. Destination-project permissions and dependency permissions still apply. The CLI uses the public API and its existing validation, save, and publication services.

The three main policies apply to all Agents and workflows in the archive. There are no per-kind overrides. Use --conflict-policy, --id-policy, and --publishing-policy. The old workflow-specific flag names are rejected. The API fields are conflictPolicy, idPolicy, and publishingPolicy. The API rejects the old workflow-specific and Agent-specific policy fields.

Human and JSON results include agents, bindings.agents, and counts.agents. Each Agent summary reports its source and destination IDs, name, project, active version, import status, separate publishing outcome, and channels. Publication failures retain successfully imported definitions. The command returns success for these results and reports the publication failure separately.

The import never connects a channel with a credential from the package. The external app of a channel, such as a Slack app, must send events to the destination Agent. Each entry in channels has one of these statuses:

  • reused: the destination Agent already had this channel. The import keeps its connection and applies the package settings.
  • setup-required: the import saved the package settings without a connection. Open setupUrl and set up the channel. reason is new-channel or destination-draft.

The import does not import or stub a credential that only a channel uses. When the publishing policy requests publication, a channel that needs setup blocks it with the reason channel-setup-required. The definition import stays saved. If no version of the Agent is active, publishing.state is blocked with blockedReason. If an earlier published version stays active, publishing.state is unchanged with skippedPublishReason.

For created and updated Agents, the import removes destination channels that the package does not contain. Skipped Agents stay unchanged.

When the import is blocked, the command exits non-zero and lists the blocking issues. Examples:

  • an Agent or workflow conflict under --conflict-policy=fail
  • an invalid Agent definition or an unresolved Agent dependency
  • a skill problem, for example a skill conflict under --conflict-policy=fail
  • a project that already exists under --project-conflict-policy=fail
  • a workflow that --folder-conflict-policy=overwrite would remove but you lack workflow:delete on
  • an unresolved credential under --credential-missing-mode=must-preexist
  • a matched credential that the package would change under --credential-conflict-policy=fail, or a matched credential that you cannot update under --credential-conflict-policy=overwrite or fail
  • a schema-incompatible data table
  • a workflow using a node type this instance does not have under --missing-node-type-mode=fail
  • an unresolved variable under --variable-missing-mode=must-preexist, or a creating variable mode whose new variables would exceed the instance variable limit
  • a resolved variable whose value differs from the package's under --variable-conflict-policy=fail, or, under --variable-conflict-policy=overwrite, one row the projects of a package would overwrite with different values

Under the default --credential-missing-mode=create-stub, missing credentials are stubbed instead of blocking the import.

Skills

Select Skills independently with --skill-id. Whole-project exports include all project Skills when --include-skills is set. Skills that an exported Agent uses remain dependencies. The import preserves Skill IDs, scope, frontmatter, instructions, and supported reference files.

Direct Skill imports require the skill:import API-key grant. Each change also requires its action grant: skill:create, skill:update, or skill:delete. Export requires skill:export. The caller must have access to each Skill.

Protected instances reject Skill changes during package planning and apply.

  • new-version saves changed content as a new local version. It also applies renames. skip keeps existing content. fail blocks different content. Identical content creates no version. The import does not merge text.
  • Explicit selection rejects an ID in another scope or a duplicate name. Source-managed destinations cannot be changed. Unchanged and skipped Skills remain available. These checks run before content writes.
  • New versions update consumers that follow latest. Published and pinned versions stay unchanged. Plans and results include followingAgentCount.
  • Removal is explicit. A missing or empty Skills collection removes nothing. A requested removal fails if an Agent still references the Skill, including a published version.
  • Synced Skills travel as content snapshots. Source connections, credentials, and authentication do not travel. New destination Skills have source import.
  • Results include skills and counts.skills with created, updated, unchanged, skipped, and deleted totals. Skill conflicts return HTTP 409 with a skill-conflict issue and skillId. Agent dependency conflicts retain the agent-invalid issue and skills.<skillId> path. If a later import step fails after Skill writes, the CLI shows the saved Skill outcomes and counts. With --json, it also writes them to standard output. The command exits with an error in both modes.

Explicit Skill selections use package format 2. This destination also reads format

  1. Older destinations reject format 2. Skills must be available on the destination. Unsupported formats and files fail validation before writes. The main Skill definition uses Markdown. Supporting files can use any extension, such as .md, .py, or .png, with safe paths relative to the Skill folder. Packages preserve text as text and binary content as Base64. Agents can read text files through load_skill; that tool does not list or return binary files.

The import plans Agent dependencies with their Agent. It leaves dependencies of skipped Agents unchanged unless they are also selected independently.

A package skill holds the Markdown instructions of the skill and its supporting files. A supporting file can have any extension, for example .md, .py or .png. The package keeps a text file as text and a binary file as Base64, so the import writes the same bytes. The export and the import validate the files against the shared skill schema:

  • Each path is relative to the skill folder and has 512 characters or fewer. It cannot go up a folder or replace SKILL.md.
  • A skill has 500 supporting files or fewer.
  • A text file has 1,048,576 characters or fewer. A binary file has 1,398,104 Base64 characters or fewer, which is about 1 MiB.
  • The supporting files of a skill total 2,097,152 characters or fewer. A binary file counts with its Base64 length.
  • The Markdown instructions have 65,536 characters or fewer. They do not count toward the supporting-file limits.

An Agent reads text files through load_skill. An Agent run does not load binary files, so load_skill does not list them or return their contents.

package import-selection

Import a chosen subset of workflows and Skills from a .n8np project package. Workflow and folder packages are not supported. The command imports workflows listed in --selected-workflow-ids and removes workflows listed in --deleted-workflow-ids (archived by default; see --overwrite-deletion-policy). It leaves workflows outside both lists and other projects unchanged. It can also create folders and referenced resources under the fixed policies below.

The selection belongs to one source project (--selected-project-id). The command writes selected workflows into the target instance project with the same ID. It creates that project if it does not exist. There is no separate target option.

Use --selected-skill-ids for Skill imports and --deleted-skill-ids for explicit removals. Both accept comma-separated IDs or repeated flags. Omitted Skill lists leave existing Skills unchanged.

These policies are fixed:

Resource Policy
Projects Merge the selected project with the target project.
Folders Merge all packaged folders in the selected project, including folders with no selected workflows.
Tags Create missing tags referenced by imported workflows. Skip tag conflicts.
Data tables Match referenced tables by ID. Create missing tables. Reject incompatible schemas.
Credentials Match referenced credentials by ID. They must already exist. Keep their current names and values.
Variables Referenced variables must already exist. Keep their current values.

An imported workflow's destination ID must not appear in --deleted-workflow-ids. The command rejects this overlap before any writes, including with the skip policy. It checks the destination ID even if the workflow is absent or archived.

The result lists removed workflows under removedWorkflows. Each entry has a deletion field of archived or deleted that reports what actually happened. With the default --overwrite-deletion-policy=archive the command archives each workflow, so it and its execution history stay recoverable. hard-delete also removes the workflow permanently. A workflow can stay archived under hard-delete when deferred trigger teardown blocks the delete. The command skips absent workflows and omits them from this list.

n8n-cli package export --project-id=<id> --output=project.n8np
n8n-cli package import-selection --file=project.n8np --selected-project-id=<id> --selected-workflow-ids=<id1>,<id2>
n8n-cli package import-selection --file=project.n8np --selected-project-id=<id> --selected-workflow-ids=<id1> --deleted-workflow-ids=<id3>
Flag Description
--file Path to the .n8np project package file. (required)
--selected-project-id Source project ID for the selection. The target project uses the same ID. (required)
--selected-workflow-ids Source workflow IDs to import. Comma-separate them, or repeat the flag. Only these workflows are imported.
--deleted-workflow-ids Target workflow IDs to remove. Separate IDs with commas, or repeat the flag. The removal manner follows --overwrite-deletion-policy. Absent workflows are ignored.
--conflict-policy What to do when a workflow already exists by source ID: new-version (default), fail, or skip.
--id-policy Only source is supported. New workflows use the package IDs. An ID already used by an unmatched workflow, in any project, blocks the import. Matched workflows keep their destination IDs.
--overwrite-deletion-policy How --deleted-workflow-ids removes each target workflow: archive (default) archives it, keeping it and its execution history recoverable; hard-delete archives it — the step that unpublishes it — then deletes the workflow and its executions permanently. A workflow can stay archived under hard-delete when deferred trigger teardown blocks the delete. Each removedWorkflows entry reports the actual result in its deletion field.

Requires the API key to hold:

  • workflow:import — when the package contains workflows
  • workflow:activate — when the fixed match-source publication publishes a selected workflow
  • workflow:deactivate — when the fixed match-source publication unpublishes a selected workflow
  • workflow:delete — when --deleted-workflow-ids contains IDs or an imported workflow changes between archived and unarchived
  • project:create — when the selected project does not exist. The import never changes an existing project, so it never requires project:update.
  • folder:create — when the import creates a folder for a selected workflow, or a folder above it
  • tag:create — when the import creates a missing tag referenced by an imported workflow

An import that creates a folder also requires a license that supports folders. The user must have permission to create data tables when the import creates missing tables.

When the import is blocked, the command exits non-zero and lists the blocking issues.

Preferences

Packages can transfer project, instance, and your own personal AI Preferences. Personal Preferences apply to you in all projects. Project Preferences can belong to team or personal projects. Feature settings and project roles stay local.

Export selected rows with --preference-id=<uuid>. Repeat the flag for more rows. For a project package, add --include-preferences=true to include its Preferences. Instance and user-scoped Preferences require explicit IDs. Project packages keep project IDs. A loose project Preference uses the destination named by --project-id, which can be a team or personal project. Project permissions apply.

Personal Preferences belong to the importing user. Packages do not carry user IDs. An existing UUID must belong to that user and the same scope. Otherwise, the import is blocked. Personal Preferences are excluded from Promotions.

The first two commands use a personal or instance Preference.

n8n-cli package export --preference-id=<uuid> --output=preferences.n8np
n8n-cli package import --file=preferences.n8np
n8n-cli package export --project-id=<id> --include-preferences=true --output=project.n8np
n8n-cli package import --file=preferences.n8np --project-id=<destination-id>
n8n-cli package import --file=preferences.n8np --project-id=<destination-id> --preference-conflict-policy=replace
n8n-cli package import-selection --file=project.n8np --selected-project-id=<id> --selected-preference-ids=<uuid>
CLI option API field Behavior
--preference-id preferenceIds Shared or personal UUIDs to export. Personal rows must belong to you.
--include-preferences includePreferences Include Preferences from projectIds. Defaults to false.
--preference-conflict-policy preferenceConflictPolicy fail (default), skip, or replace. Applies to changed content with the same ID.
--selected-preference-ids selectedPreferenceIds Select rows for import-selection. Omit to import no Preferences.
--deleted-preference-ids deletedPreferenceIds Explicit destination UUIDs to remove. Requires a Preferences collection.

API export fields use JSON arrays. Import and selection fields carry UUID arrays as JSON text in the multipart request. Selection imports can select personal and instance Preferences and project Preferences from the selected project. Full imports include every Preference in the package.

Identical content is a no-op. Changed content needs replace; the workflow conflictPolicy does not grant replacement. Import never combines instruction text. New rows keep the package UUID and use the destination actor with source import. Updates keep the original source and creator.

Removal affects only the named IDs. It cannot remove another user's personal Preferences or rows in other destination projects. A missing collection never requests removal. A disabled Preferences feature blocks a transfer that selects Preferences and leaves saved rows unchanged. Protected environments reject ordinary shared Preference writes, including package imports. User-scoped and personal-project Preference imports remain available. This package path grants no Promotions bypass.

Import checks permissions, ID ownership, duplicate text, content length, and the 50-row limit for each scope. Selected removals count toward the final batch. Updates and removals check the saved row in the write query. Destination changes after a preview require a new plan. New UUIDs use inserts and cannot overwrite an existing row. Writes to different rows can still pass the count or duplicate checks at the same time. A rejected Preference plan reports preference-conflict issues before package writes. Each issue has a kind: conflict, forbidden, invalid, or unavailable. Only conflict issues use HTTP 409. Other Preference issue kinds use HTTP 422. Successful results include preferences with created, updated, deleted, and skipped statuses. counts.preferences contains created, updated, removed, and skipped counts. Preferences are validated before package writes. They are saved individually after other content writes and before publication. A later failure keeps earlier changes, including new projects. Errors after Preference writes include completed Preference outcomes and counts. The CLI prints these results. Reload before retrying.

Export needs the aiPreference:export API key scope. Import needs aiPreference:import, plus the scope for each planned write: aiPreference:create, aiPreference:update, or aiPreference:delete. A no-op needs only aiPreference:import. The user must still have access to each Preference. Project permissions and permissions for other package entities still apply.

Packages with a Preferences collection use package format 2. They require an n8n destination that supports this format and has Preferences enabled. Older readers reject the package. Packages without the collection keep format 1. The source n8n version does not override the format check. A format 2 manifest with an unknown field fails before any writes. Other format numbers also fail. Do not change the format number to bypass a rejection.