Quick Overview
This workflow polls your Dokan marketplace for vendors awaiting approval and posts each new pending vendor to Telegram with Approve/Reject actions, then updates the vendor status in Dokan via token-protected webhooks and confirms the result back in Telegram.
How it works
- Runs every 15 minutes on a schedule.
- Fetches up to 100 Dokan vendors with the
inactive status via the Dokan REST API and keeps only vendors that have not already been announced.
- Posts each newly detected vendor to a Telegram chat with inline buttons to Approve, Reject, or open the vendor profile in wp-admin.
- When Approve is clicked, receives the webhook request, validates the shared token, and sets the vendor status to
active in Dokan.
- When Reject is clicked, receives the webhook request, validates the shared token, and sets the vendor status to
inactive in Dokan.
- After an approval or rejection, clears the saved de-duplication entry so the vendor can be re-announced if they return to pending, sends a confirmation message to Telegram, and returns an HTML response to close the browser tab.
Setup
- Create an application password (or Basic Auth user) in WordPress with
manage_woocommerce permission and add it as an n8n HTTP Basic Auth credential for the Dokan API requests.
- Create a Telegram bot and provide its bot token, then set your target Telegram chat/channel ID in the Telegram sendMessage requests.
- Replace
https://your-marketplace.com with your Dokan site URL in the Dokan API requests and the wp-admin “View profile” button link.
- Replace
https://your-n8n-instance.com in the Telegram inline button URLs with your public n8n base URL.
- Set
YOUR_APPROVAL_TOKEN to a long random string and ensure it matches the token query parameter used in the Approve/Reject button URLs.