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

$getWorkflowStaticData is not defined #12125

Closed
remi-bartas-hc opened this issue Dec 10, 2024 · 7 comments
Closed

$getWorkflowStaticData is not defined #12125

remi-bartas-hc opened this issue Dec 10, 2024 · 7 comments
Assignees
Labels
in linear Issue or PR has been created in Linear for internal review Released

Comments

@remi-bartas-hc
Copy link

Bug Description

Hi, I have switched today from The n8n version (v1.46.0) on my headchannel workspace as I have been prompted that it soon will end its lifetime to the latest stable version.

Unfortunately, all of my workflows stopped working, as I get the $getWorkflowStaticData is not defined error.

I have built many workflows in the past, using a lot of Code nodes in each of them. In those nodes, I was using the mentioned function to save some important information and easily access them. I never had any issues with testing the flows manually, which apparently changed in the latest version. Moreover - even when I tried running them on Schedule or triggered via the webhook, it still produces the same error.

I hope there is an easy way to fix all my workflows.

I am sending a few of them with the problems I mentioned:
https://headchannel.app.n8n.cloud/workflow/MVKdqjKE7bLb4nyX/executions/45778
https://headchannel.app.n8n.cloud/workflow/wcHpGQn8DSDK7UvK/executions/45789
https://headchannel.app.n8n.cloud/workflow/bNqiH902xAxWlPEo/executions/45799
https://headchannel.app.n8n.cloud/workflow/wpz3HiMVxnUTJPdW/executions/45797

To Reproduce

  1. Review historical executions of the flows:
    https://headchannel.app.n8n.cloud/workflow/MVKdqjKE7bLb4nyX/executions/45778
    https://headchannel.app.n8n.cloud/workflow/wcHpGQn8DSDK7UvK/executions/45789
    https://headchannel.app.n8n.cloud/workflow/bNqiH902xAxWlPEo/executions/45799
    https://headchannel.app.n8n.cloud/workflow/wpz3HiMVxnUTJPdW/executions/45797

Expected behavior

At least, to fix the issues when the workflow is triggered on schedule and via Webhook.
Ideally, allow using the same concept while manually testing the workflow (as it used to work), as it would make things a lot more complicated to have to always test it via sending a webhook trigger.

Operating System

Cloud

n8n Version

latest stable (1.70.3)

Node.js Version

.

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Dec 10, 2024

Hey @remi-bartas-hc,

We have created an internal ticket to look into this which we will be tracking as "N8N-7933"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Dec 10, 2024
@riascho riascho self-assigned this Dec 10, 2024
@riascho
Copy link
Contributor

riascho commented Dec 10, 2024

Hi @remi-bartas-hc
this is likely due to the new task runner feature. We've disabled that for your instance for now, so your workflows should be working again, while we fix this bug internally.
Let us know if you're still seeing issues related to it.

Thanks!

@remi-bartas-hc
Copy link
Author

remi-bartas-hc commented Dec 11, 2024 via email

@remi-bartas-hc
Copy link
Author

remi-bartas-hc commented Dec 11, 2024 via email

@riascho riascho closed this as completed Dec 11, 2024
@MikaelX
Copy link

MikaelX commented Dec 11, 2024

We have the same on our on-prem instance running version: 1.70.3

image

Now you just have to trust me that the data is there normally :)

@riascho
Copy link
Contributor

riascho commented Dec 11, 2024

Hey @MikaelX

Thanks for reporting this! Although I have never seen a return like this.

It does work if you assign the global static property inside the json.

image

// initialize staticData object
const workflowStaticData = $getWorkflowStaticData('global');

// if (!workflowStaticData.hasOwnProperty('Answers')) {
//   workflowStaticData.Answers = '42'
// }

return [
  {
    answers: workflowStaticData.Answers
  }
]
  ;

@janober
Copy link
Member

janober commented Dec 12, 2024

Fix got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review Released
Projects
None yet
Development

No branches or pull requests

5 participants