n8n icon indicating copy to clipboard operation
n8n copied to clipboard

Timeout when accessing $getWorkflowStaticData

Open robsonrosa opened this issue 2 weeks ago • 3 comments

Describe the problem/error/question

Sometimes, I'm getting a timeout error when accessing $getWorkflowStaticData in a Code node. It doesn't happen every time, just sometimes, and I had no explanation why.

What is the error message (if any)?

Timeout error.

Please share your workflow/screenshots/recording

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "8ecec058-da33-42b3-b73c-67b6ef23ab83",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -4180,
        40
      ],
      "id": "46334350-7758-4317-a079-b049a157067f",
      "name": "Webhook",
      "webhookId": "8ecec058-da33-42b3-b73c-67b6ef23ab83"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nworkflowStaticData.agent = 'gemini';\nworkflowStaticData.model = 'gemini-1.5-flash:generateContent';\nworkflowStaticData.transcriptor = 'google';\n\nreturn workflowStaticData;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -3860,
        40
      ],
      "id": "1e1b695b-77be-4a9e-afab-729c51ad91f6",
      "name": "set-config"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "set-config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set-config": {
      "main": [
        []
      ]
    }
  }
}

Share the output returned by the last node

There's no output and I just expect to have some static variables defined.

Debug info

core

  • n8nVersion: 1.72.1
  • platform: npm
  • nodeJsVersion: 20.18.0
  • database: sqlite
  • executionMode: regular
  • concurrency: 5
  • license: community

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 168 hours
  • maxCount: 2500 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/133.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-02-11T23:26:20.523Z}

robsonrosa avatar Feb 11 '25 23:02 robsonrosa