Skip to content

[Bug] Convert to sub-workflow: child workflow not placed in parent folder and internal node connections lost (regression vs 2.6.3) #28751

@NanGePlus

Description

@NanGePlus

Bug Description

After upgrading from n8n 2.6.3 to 2.16.1, using Convert to sub-workflow on a valid node selection produces a new workflow with two problems:

  1. Folder: The new sub-workflow is not created inside the same folder as the parent workflow (e.g. under Personal → test). It appears at the root of the workflow list instead.
  2. Connections: Inside the generated sub-workflow, edges between nodes are missing on the canvas (nodes exist but are not wired as in the selection).

On 2.6.3, the same workflow and the same operation did not exhibit either issue.

To Reproduce

  1. Open Personal (or equivalent project space).
  2. Create a folder, e.g. test.
  3. Inside test, create a new workflow and add several ordinary nodes (e.g. Set → HTTP Request → Set) with normal linear connections (no Merge as single entry, no If/Switch branching out of the selection if possible).
  4. Select the last contiguous segment of nodes (or the full chain you intend to extract).
  5. Right-click the canvas background → Convert to sub-workflow.
  6. Open the newly created workflow from the sidebar.

Expected behavior

  1. The new sub-workflow should be created in the same folder as the parent workflow (test), or at least the behavior should match 2.6.3 (where it did).
  2. The sub-workflow should preserve all internal connections between the moved nodes, matching the graph before conversion.

Actual behavior

  1. The sub-workflow is created under the root of the workflow list (not inside test).
  2. The sub-workflow does not show connections between nodes (broken or empty graph wiring in the UI).

Environment

  • n8n version: 2.16.1 (previously 2.6.3 without this issue)
  • Deployment: [self-hosted Docker]
  • Database: [SQLite]
  • Browser: [Chrome]
  • OS: [macOS]

To Reproduce

  1. Open Personal (or equivalent project space).
  2. Create a folder, e.g. test.
  3. Inside test, create a new workflow and add several ordinary nodes (e.g. Set → HTTP Request → Set) with normal linear connections (no Merge as single entry, no If/Switch branching out of the selection if possible).
  4. Select the last contiguous segment of nodes (or the full chain you intend to extract).
  5. Right-click the canvas background → Convert to sub-workflow.
  6. Open the newly created workflow from the sidebar.

Expected behavior

  1. The new sub-workflow should be created in the same folder as the parent workflow (test), or at least the behavior should match 2.6.3 (where it did).
  2. The sub-workflow should preserve all internal connections between the moved nodes, matching the graph before conversion.

Debug Info

  1. The sub-workflow is created under the root of the workflow list (not inside test).
  2. The sub-workflow does not show connections between nodes (broken or empty graph wiring in the UI).

Operating System

macOS

n8n Version

2.16.1

Node.js Version

24.14.1

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions