Skip to content

fix(package): align export/import with upstream spec 1.1.1 - #27

Merged
SomeoneWithOptions merged 1 commit into
mainfrom
fix/package-export-import
Oct 21, 2026
Merged

SomeoneWithOptions merged 1 commit into
mainfrom
fix/package-export-import

Conversation

@SomeoneWithOptions

Copy link
Copy Markdown
Owner

Fixes drift between the n8n package commands and the upstream n8n Public API spec 1.1.1 (/n8n-packages/export, /n8n-packages/import). Before this change, every export run with a policy flag failed with a 400.

Export

  • Breaking fix: the request body now uses dependencyPolicy / versionPolicy, replacing missingWorkflowDependencyPolicy / workflowVersionPolicy. The body has additionalProperties: false, so the old names returned 400. The enum values are unchanged.
  • New flags: --dependency-policy and --version-policy. The old flags (--missing-workflow-dependency-policy, --workflow-version-policy) still work as hidden, deprecated aliases. Setting both the new and the old flag is rejected before transport.
    • The export command's flag set writes to stderr. Cobra's default would print the deprecation notice on stdout, which would corrupt --out - and the JSON summary.
  • --input accepts the new names. A document that still uses an old name is rejected locally with an error that names the replacement, and no request is sent.
  • New agentIds field and repeatable --agent-id flag. Agents belong to the loose group, so they can't be combined with --project-id.
  • All ID lists, including projectIds, are capped at 300 locally.
  • A 403 now names only the scopes the selection needs (agent:export / workflow:export / project:export). The 400 hint uses the new flag names.

Import

  • New enum values are accepted locally: credentialMissingMode=create-with-values, dataTableSchemaConflictPolicy=overwrite|overwrite-non-destructive. I re-checked every other import enum against the spec and none changed.
  • --data-table-schema-policy overwrite can drop the values in removed or retyped columns, so the confirmation prompt adds a stronger warning. Help and Long text explain what it destroys.
  • New result fields credentials.seeded, credentials.incomplete, and dataTables.updated are decoded and shown in text output. Incomplete credentials print a stderr hint with their target IDs and the next step (n8n credential update).
  • ImportPackageResult keeps the raw response, so unknown fields (nested ones included) survive --output json. This follows the existing ImportBlockingIssue pattern.
  • Fixed a stale comment about conflicting workflowIdPolicy defaults; the spec now says source in both places. The field is still always sent.
  • newImportBlockedError takes the endpoint path as a parameter, to prepare for import-selection (chore(release): document PR-first, tag-after-merge flow #9).

Verification

  • Spec-derived (openapi.upstream.yml 1.1.1): every change above.
  • Live-verified: none. The optional live export check against a non-prod instance was not run.
  • make docs && make check green. go test -race -shuffle=on green for cli/n8n/coverage.

🤖 Generated with Claude Code

@SomeoneWithOptions
SomeoneWithOptions merged commit e617520 into main Oct 21, 2026
4 checks passed
@SomeoneWithOptions
SomeoneWithOptions deleted the fix/package-export-import branch October 21, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant