Demo workflow - how to use workflowStaticData
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist within workflow executions. https://doc...
🔌 Nodes & Integrations Used (1)
📖 Implementation & Setup Guide
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/](https://docs.n8n.io/code/cookbook/builtin/get-workflow-static-data/)
This can be useful for example when working with access tokens that expire after a certain time period. Using `staticData` we can keep a record of that access token and the expiry time and build our workflow logic around it.
Important
Static Data only persists across **_production_** executions, i.e. triggered by Webhooks or Schedule Triggers (not manual executions!) For this the workflow will have to be activated.
Setup
- configure HTTP Request node to fetch access token from your API (optional)
- activate workflow
- test the workflow with the webhook production link
- you can check the population of the static data in the single executions
Feedback
If you found this useful or want to report some missing information - I'd be happy to hear from you at [ria@n8n.io](mailto:ria@n8n.io)
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Demo workflow - how to use workflowStaticData__.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related General Automation Workflows
View All in General Automation →Generate Application Copy
Production-ready n8n automation template for Generate Application Copy built by AhiXLight. Seamlessly connects Execute Workflow Trigger, OpenAI with 4 configured nodes.
2-way sync Google Contacts and Notion
Sync your Google Contacts with your Notion database. You can filter contacts by label or sync all contacts. All contact information is kept in sync between G...
2D Image to 3D Model Automation
Production-ready n8n automation template for 2D Image to 3D Model Automation built by AhiXLight. Seamlessly connects HTTP Request, Google Sheets, Google Drive with 17 configured nodes.
2 way sync assignments completion between Canvas LMS and Notion
Syncs assignments and completion states to and fro between Canvas LMS and a Notion database. Automatically triggers every 2 hours during the schoolday by def...