Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗂️ Monday Automation – File & Folder Handler

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 Attachments subfolder
  • Applies a green Finder label to the folder (macOS only)

🚀 Features

  • ✅ 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

📦 Project Structure

monday-automation/
├── Monday_Automation.js      # Main automation script
├── SourceFolder/             # Template folder copied for each new item
└── DestinationFolder/        # Output folder with downloaded assets

🛠️ Installation

  1. Clone the repo:

    git clone https://github.com/LucidCodeLab/monday-automation.git
    cd monday-automation
  2. Install dependencies:

    npm install
  3. Start the script:

    sudo node Monday_Automation.js
  4. Install Ngrok if you haven't already.

  5. Start Ngrok to expose your local port 80:

    ngrok http 80
  6. Copy the Ngrok HTTPS forwarding URL (e.g., https://abc123.ngrok.io).

  7. Add it to your Monday.com webhook automation:

    When status changes to something, send webhook to https://abc123.ngrok.io
    

⚙️ Configuration

  • Update the hardcoded Monday API token in the .env.example with your own.
  • Customize the column titles in targetColumnLabelTitles and targetValueColumnTitles as needed.

🖥️ Usage Flow

  1. Monday.com sends a webhook with pulseId and pulseName
  2. The script:
    • Queries item data using GraphQL
    • Builds a folder path like:
      Function/Business Unit/0004_Function_StartDate_PulseName
    • Copies contents of SourceFolder into the new path
    • Downloads attached files into /Attachments
    • Applies a green Finder label (macOS only)

✅ Example

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

🔒 Notes

  • Only works on macOS for label coloring (uses AppleScript)
  • Folder numbering is auto-incremented
  • Ensure Monday.com's GraphQL schema includes public_url for assets

📜 License

MIT — use, modify, and enjoy.

About

Automates folder creation and file downloads based on webhook events from Monday.com.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages