This Node.js script automates folder creation and file downloads based on webhook events from Monday.com. When a webhook is received (via Ngrok), it:
- Fetches pulse metadata (e.g., Status, Function, Business Unit)
- Creates a uniquely numbered folder
- Downloads any attached files from Monday.com into an
Attachmentssubfolder - Applies a green Finder label to the folder (macOS only)
- ✅ Receives Monday.com webhook events via Ngrok tunnel
- 📁 Creates structured, versioned folders
- 📎 Downloads files from Monday.com
assetIds - 🍏 Applies macOS Finder label (green) to folders
- 🔐 Uses Monday.com GraphQL API
monday-automation/
├── Monday_Automation.js # Main automation script
├── SourceFolder/ # Template folder copied for each new item
└── DestinationFolder/ # Output folder with downloaded assets
-
Clone the repo:
git clone https://github.com/LucidCodeLab/monday-automation.git cd monday-automation -
Install dependencies:
npm install
-
Start the script:
sudo node Monday_Automation.js
-
Install Ngrok if you haven't already.
-
Start Ngrok to expose your local port 80:
ngrok http 80
-
Copy the Ngrok HTTPS forwarding URL (e.g.,
https://abc123.ngrok.io). -
Add it to your Monday.com webhook automation:
When status changes to something, send webhook to https://abc123.ngrok.io
- Update the hardcoded Monday API token in the .env.example with your own.
- Customize the column titles in
targetColumnLabelTitlesandtargetValueColumnTitlesas needed.
- Monday.com sends a webhook with
pulseIdandpulseName - The script:
- Queries item data using GraphQL
- Builds a folder path like:
Function/Business Unit/0004_Function_StartDate_PulseName - Copies contents of
SourceFolderinto the new path - Downloads attached files into
/Attachments - Applies a green Finder label (macOS only)
Webhook payload:
{
"event": {
"pulseId": 123456789,
"pulseName": "Q2 Campaign Launch"
}
}Resulting folder:
DestinationFolder/
└── Marketing/Corporate/
└── 0003_Marketing_2025-08-01_Q2 Campaign Launch/
├── [copied contents of SourceFolder]
└── Attachments/
└── campaign_brief.pdf
- Only works on macOS for label coloring (uses AppleScript)
- Folder numbering is auto-incremented
- Ensure Monday.com's GraphQL schema includes
public_urlfor assets
MIT — use, modify, and enjoy.