Skip to content

Saving workflow clears SSH node parameters that were not edited #37688

Description

@youminlaozhang

Bug Description

When editing a workflow in the n8n UI (e.g. modifying Code nodes) and saving, SSH nodes that were not opened or edited have their parameters silently overwritten to {}. This causes all SSH commands, credentials references, and settings to be lost without any warning.

Steps to Reproduce

  1. Create a workflow with SSH nodes that have commands configured (e.g. command: "python3 -c ...", waitForResponse: true)
  2. Confirm the workflow works correctly (SSH nodes execute commands and return output)
  3. Open the workflow in the n8n editor
  4. Edit a different node (e.g. a Code node) — do NOT open or touch the SSH nodes
  5. Save the workflow
  6. Check the SSH nodes — their parameters are now {} (empty), all commands lost

Expected Behavior

Saving the workflow should preserve all node parameters, including nodes that were not opened or edited in the current session.

Actual Behavior

SSH node parameters are overwritten to {} when the workflow is saved, even though the SSH nodes were never opened or modified during the editing session.

Evidence

  • Workflow ENPdYjvVKi8RKBem on n8n 2.36.8
  • Execution 62 (before edit at 02:07): SSH node 读本地版本 returned stdout: "4.4.3.7" — correct
  • Workflow saved at 02:13 (edited Code nodes only, SSH nodes untouched)
  • Execution 63 (after edit at 02:15): same SSH node returned stdout: "" — parameters cleared
  • Direct DB query on workflow_entity table confirmed parameters: {} stored for SSH nodes after save
  • Previous version recovered from workflow_history table shows original parameters were correct:
    {"command": "python3 -c \"import json; print(json.load(open('/root/bypass-paywalls-chrome-clean/manifest.json'))['version'])\"", "waitForResponse": true}

Environment

  • n8n version: 2.36.8 (Docker via 1Panel)
  • OS: Linux (ARM64)
  • Database: SQLite
  • Node type affected: n8n-nodes-base.ssh (typeVersion 3)

Impact

This is a data-loss bug. Users can lose critical automation commands without any warning or indication. In our case, the SSH nodes silently stopped executing their commands (returning exit code 0 with empty output), which could go unnoticed for a long time if the workflow doesn't have output validation.

Workaround

  • Move SSH commands to external script files on the target machine, so the node only needs bash /path/to/script.sh
  • Before editing any workflow, export the full workflow JSON via API as backup
  • Recover lost parameters from workflow_history SQLite table: SELECT nodes FROM workflow_history WHERE versionId='<old-version-id>'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs FeedbackWaiting for further input or clarification.status:in-linearIssue or PR is now in Linearstatus:team-assignedA team has been assigned the issue or PRteam:nodesIssue is with the Nodes team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions