Skip to main content

Automated Zalo OA token management with OAuth and webhook integration

Workflow preview

Workflow preview
100%
Automated Zalo OA token management with OAuth and webhook integration preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 ...

Best for

  • Engineering automation workflows
  • DevOps automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.scheduletrigger, n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Le Nguyen.

Original n8n.io source

1.1 Workflow description

Title
Automated Zalo OA token management with OAuth and webhook integration
Workflow name
Automated Zalo OA token management with OAuth and webhook integration

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 expires.
  2. Static Data cache (global) stores access/refresh tokens + expiries for reuse by any downstream node.
  3. OAuth exchange calls Zalo OAuth v4 with your app_id and secret_key to get a fresh access token.
  4. Immediate output returns the current access token to the next nodes after each refresh.
  5. Operational webhooks include:
    • A reset webhook to clear the cache when rotating credentials or testing.
    • A token peek webhook to read the currently cached token for other services.

Setup steps (estimated time ~8–15 minutes)

  1. Collect Zalo credentials (2–3 min): Obtain app_id, secret_key, and a valid refresh_token.
  2. Import & activate workflow (1–2 min): Import the JSON into n8n and activate it.
  3. Wire inputs (2–3 min): Point the “Set Refresh Token and App ID” node to your env vars (or paste values for a quick test).
  4. Adjust schedule & secure webhooks (2–3 min): Tune the run interval to your token TTL; protect the reset/peek endpoints (e.g., secret param or IP allowlist).
  5. Test (1–2 min): Execute once to populate Static Data; optionally try the token peek and reset webhooks to confirm behavior.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Store to SD & Pass token

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 2 - Refresh Token (Zalo v4)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 3

Block 3 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 4 - Execute_Node

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 5 - Clean Zalo Static Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Set Refresh Token and App ID

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Load to Static Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 9 - Load Access Token

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated Zalo OA token management with OAuth and webhook integration
Complexity intermediate
Nodes 10
Categories Engineering, DevOps
Author Le Nguyen
Published 17 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8675/8675.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated Zalo OA token management with OAuth and webhook integration do?

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 ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, DevOps use case.