Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with Sticky notes created via API #9174

Open
barn4k opened this issue Apr 19, 2024 · 3 comments
Open

Bug with Sticky notes created via API #9174

barn4k opened this issue Apr 19, 2024 · 3 comments

Comments

@barn4k
Copy link

barn4k commented Apr 19, 2024

Bug Description

Seems if there are two sticky notes in one workflow created via API, one will disappear and the other one will be bugged. it won’t be possible to move it or edit unless you delete it (once). But after you have pressed the deletion button, the note will remain in its place. And now it will be movable and editable. The issue won’t happen if you edit the current sticky node via API, so it seems something messy is happening when there is no ID for the sticky notes defined

To Reproduce

  1. Copy the workflow and run it.
  2. There will be a "test gen" workflow created
  3. Try to move or edit the sticky note

Workflow:

{
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ea8ccd7cb9d9fc233a4683c7569b952c9669ba9d3ba1459d89a9944d357fa5b3"
  },
  "nodes": [
    {
      "parameters": {},
      "id": "8f833ab1-9470-4276-8915-ec3c25072791",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        1040,
        420
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "workflowObject": "{\n  \"name\": \"test gen\",\n  \"nodes\": [\n    {\n      \"parameters\": {},\n      \"name\": \"Some\",\n      \"type\": \"n8n-nodes-base.noOp\",\n      \"typeVersion\": 1,\n      \"position\": [\n        1100,\n        380\n      ]\n    },\n    {\n      \"parameters\": {},\n      \"name\": \"Start\",\n      \"type\": \"n8n-nodes-base.manualTrigger\",\n      \"typeVersion\": 1,\n      \"position\": [\n        880,\n        380\n      ]\n    },\n    {\n      \"parameters\": {\n        \"content\": \"## I'm a note \\n**my note**\",\n        \"color\": 6\n      },\n      \"name\": \"Sticky Note\",\n      \"type\": \"n8n-nodes-base.stickyNote\",\n      \"typeVersion\": 1,\n      \"position\": [\n        840,\n        140\n      ]\n    },\n    {\n      \"parameters\": {\n        \"content\": \"## my custom note\",\n        \"color\": 3\n      },\n      \"name\": \"Sticky Note\",\n      \"type\": \"n8n-nodes-base.stickyNote\",\n      \"typeVersion\": 1,\n      \"position\": [\n        1500,\n        380\n      ]\n    }\n  ],\n  \"connections\": {\n    \"Start\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Some\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    }\n  },\n  \"settings\": {\n    \"timezone\": \"Europe/London\",\n    \"saveManualExecutions\": true\n  }\n}"
      },
      "id": "4af6a693-d54f-42bf-bfab-d88c0241aef0",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        1280,
        420
      ],
      "credentials": {
        "n8nApi": {
          "id": "lL4uENu1234rVkEs",
          "name": "n8n account"
        }
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {}
}

Expected behavior

There will be two different sticky notes. Both are editable and movable.

Operating System

cloud

n8n Version

1.37.3

Node.js Version

cloud

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Apr 19, 2024

Hey @barn4k,

The issue here appears to be that you have given the sticky notes the same name and we expect node names to be different even for sticky notes. If you set the name for the second sticky note to Sticky Note 2 it then works so I don't think we have anything to really fix here other than maybe throwing an error if a node with the same exists.

@barn4k
Copy link
Author

barn4k commented Apr 19, 2024

Oh, that's an interesting part. Maybe there should be an error raised when the same name is being used for different nodes. Or to make n8n automatically add 1,2,3 postfixes like it does in the UI

@Joffcom
Copy link
Member

Joffcom commented Apr 22, 2024

Hey @barn4k,

Those are not bad ideas, How did you make the workflow in the first place are you trying to build them by hand?

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

No branches or pull requests

2 participants