Automated Zalo OA token management with OAuth and webhook integration
Ready for 3.0What this workflow does
This workflow has 9 nodes and runs when an HTTP POST request hits its webhook URL (plus 2 other triggers). It uses only n8n's built-in nodes. It also calls oauth.zaloapp.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 2 other triggers).
- Clean Zalo Static Data (Code): runs custom JavaScript code
- Set Refresh Token and App ID (Edit Fields (Set)): sets 3 fields: refresh_token, app_id, secret_key
- Load Access Token (Code): runs custom JavaScript code
- Load to Static Data (Code): runs custom JavaScript code
- Refresh Token (Zalo v4) (HTTP Request): calls oauth.zaloapp.com (POST)
- Store to SD & Pass token (Code): runs custom JavaScript code
HTTP calls to: oauth.zaloapp.com
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (5)
- Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set
From the author
Description (How it works) This workflow keeps your Zalo Official Account access token valid and easy to reuse across other flows—no external server required. High-level steps 1. Scheduled refresh runs on an interval to renew the access token before it…