Demo workflow - how to use workflowStaticData()
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This workflow has 7 nodes and runs when an HTTP GET request hits its webhook URL (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: When an HTTP GET request hits its webhook URL (plus 1 other trigger).
- 1. initiate static data (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- get new accessToken (HTTP Request): calls an HTTP API
- 2. set token in static data (Code): runs custom JavaScript code
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Webhook
n8n-nodes-base.webhook - No Operation, do nothing
n8n-nodes-base.noOp - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Schedule Trigger
n8n-nodes-base.scheduleTrigger - If
n8n-nodes-base.if
From the author
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist within workflow executions. https://docs.n8n.io/code/cookbook/builtin/get-workflow-static-data/ This can be useful for example when working…