Reusable subworkflow zip multiple files dynamically (compress)
๐ฆ Zip Multiple Files Dynamically
This template enables you to dynamically bundle multiple files into a ZIP archive. Designed to be used as a Subworkflow, itโs modular, flexible, and easy to integrate into various workflows. The output is a single ZIP file with a name that includes the current date, time, and fileName.
Shoutout: Code from: Tom (mutedjam)
๐ค Who is this for?
This workflow is perfect for:
- ๐ Businesses automating file archiving tasks.
- ๐ป Developers managing files programmatically.
- ๐ Anyone needing a reusable solution for bundling files into ZIP archives.
โ What problem is this workflow solving?
Manually zipping multiple files is:
- ๐ Time-consuming.
- ๐ค Prone to errors.
This workflow automates the process and, as a Subworkflow, ensures:
- โก Consistent file archiving across different workflows.
- ๐ ๏ธ Reduced manual effort.
- ๐ Streamlined integration into existing automation.
๐ง What this workflow does
- ๐๏ธ Dynamically collects binary files from the input.
- ๐ฆ Bundles them into a single ZIP archive.
- ๐ Names the ZIP file with the current date, time, and a customizable
fileName. - โ Outputs the ZIP file, ready for storage or further processing.
โ๏ธ Setup
- ๐ Add this Subworkflow to your existing workflows.
- ๐ฅ Pass the binary files as input to the Subworkflow.
- โถ๏ธ Call the Subworkflow to generate a ZIP file.
๐ ๏ธ How to customize this workflow to your needs
- ๐ File Sources: Adjust the input nodes in your parent workflow to connect to your preferred file sources.
- ๐ File Naming: Customize the logic for the output
fileNamein the Subworkflow. - ๐ Additional Use Cases: Use this Subworkflow in various scenarios, such as:
- โ๏ธ Sending ZIP files via email.
- โ๏ธ Uploading ZIP files to cloud storage.
- ๐ Triggering further automation.
๐ Why use this as a Subworkflow?
Instead of building a fixed ZIP functionality for every workflow, this template offers a reusable solution that can be integrated into many different workflows effortlessly. Save time and ensure consistency across your automation projects! ๐ก
Reusable Subworkflow: Dynamically Compress Multiple Files
This n8n workflow demonstrates a reusable subworkflow pattern for dynamically compressing multiple files into a single ZIP archive. It's designed to be called by other workflows, providing a clean and modular way to handle file compression tasks.
What it does
This workflow performs the following steps:
- Listens for Execution: It starts when triggered by another n8n workflow using the "Execute Workflow Trigger" node. This allows it to receive input data from the calling workflow.
- Prepares File Data (Edit Fields): An "Edit Fields (Set)" node is present, likely intended for transforming or preparing the file data received from the calling workflow before compression.
- Executes Custom Logic (Code): A "Code" node is included, which can be used to implement custom JavaScript logic. In a typical scenario for this workflow, this node would likely process the input items to structure them correctly for the Compression node, such as extracting binary data and file names.
- Compresses Files: The "Compression" node takes the processed file data and compresses it into a ZIP archive.
- Provides Notes: A "Sticky Note" is included for documentation within the workflow itself.
Prerequisites/Requirements
- n8n Instance: An active n8n instance to import and run the workflow.
- Calling Workflow: Another n8n workflow that will trigger this subworkflow and provide the necessary file data for compression. The calling workflow should pass items containing binary data and associated file names.
Setup/Usage
- Import the Workflow:
- Download the provided JSON file.
- In your n8n instance, click on "Workflows" in the left sidebar.
- Click "New" -> "Import from JSON" and paste the workflow JSON or upload the file.
- Configure the Calling Workflow:
- In your main workflow, add an "Execute Workflow" node.
- Select this "Reusable Subworkflow: Dynamically Compress Multiple Files" workflow in the "Workflow" field of the "Execute Workflow" node.
- Ensure your calling workflow passes the binary file data and corresponding filenames as input to this subworkflow. The "Code" node within this subworkflow will likely need to be adapted to correctly parse the input structure from your calling workflow.
- Activate the Workflow: Toggle the workflow to "Active" in the top right corner.
This subworkflow is now ready to be called by other workflows whenever you need to dynamically compress a collection of files.
Related Templates
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chatโturn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. ๐ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing ๐ง Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation ๐ Required Credentials OpenAI API Setup Go to platform.openai.com โ API keys (sidebar) Click "Create new secret key" โ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai โ Dashboard โ API Keys Generate a new API key โ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) โ๏ธ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowโchat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" ๐ฏ Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration โ ๏ธ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions
Synchronizing WooCommerce inventory and creating products with Google Gemini AI and BrowserAct
Synchronize WooCommerce Inventory & Create Products with Gemini AI & BrowserAct This sophisticated n8n template automates WooCommerce inventory management by scraping supplier data, updating existing products, and intelligently creating new ones with AI-formatted descriptions. This workflow is essential for e-commerce operators, dropshippers, and inventory managers who need to ensure their product pricing and stock levels are synchronized with multiple third-party suppliers, minimizing overselling and maximizing profit. --- Self-Hosted Only This Workflow uses a community contribution and is designed and tested for self-hosted n8n instances only. --- How it works The workflow is typically run by a Schedule Trigger (though a Manual Trigger is also shown) to check stock automatically. It reads a list of suppliers and their inventory page URLs from a central Google Sheet. The workflow loops through each supplier: A BrowserAct node scrapes the current stock and price data from the supplier's inventory page. A Code node parses this bulk data into individual product items. It then loops through each individual product found. The workflow checks WooCommerce to see if the product already exists based on its name. If the product exists: It proceeds to update the existing product's price and stock quantity. If the product DOES NOT exist: An If node checks if the missing product's category matches a predefined type (optional filtering). If it passes the filter, a second BrowserAct workflow scrapes detailed product attributes from a dedicated product page (e.g., DigiKey). An AI Agent (Gemini) transforms these attributes into a specific, styled HTML table for the product description. Finally, the product is created in WooCommerce with all scraped details and the AI-generated description. Error Handling: Multiple Slack nodes are configured to alert your team immediately if any scraping task fails or if the product update/creation process encounters an issue. Note: This workflow does not support image uploads for new products. To enable this functionality, you must modify both the n8n and BrowserAct workflows. --- Requirements BrowserAct API account for web scraping BrowserAct n8n Community Node -> (n8n Nodes BrowserAct) BrowserAct templates named โWooCommerce Inventory & Stock Synchronizationโ and โWooCommerce Product Data Reconciliationโ Google Sheets credentials for the supplier list WooCommerce credentials for product management Google Gemini account for the AI Agent Slack credentials for error alerts --- Need Help? How to Find Your BrowseAct API Key & Workflow ID How to Connect n8n to Browseract How to Use & Customize BrowserAct Templates How to Use the BrowserAct N8N Community Node --- Workflow Guidance and Showcase STOP Overselling! Auto-Sync WooCommerce Inventory from ANY Supplier
Tax deadline management & compliance alerts with GPT-4, Google Sheets & Slack
AI-Driven Tax Compliance & Deadline Management System Description Automate tax deadline monitoring with AI-powered insights. This workflow checks your tax calendar daily at 8 AM, uses GPT-4 to analyze upcoming deadlines across multiple jurisdictions, detects overdue and critical items, and sends intelligent alerts via email and Slack only when immediate action is required. Perfect for finance teams and accounting firms who need proactive compliance management without manual tracking. ๐๏ธ๐ค๐ Good to Know AI-Powered: GPT-4 provides risk assessment and strategic recommendations Multi-Jurisdiction: Handles Federal, State, and Local tax requirements automatically Smart Alerts: Only notifies executives when deadlines are overdue or critical (โค3 days) Priority Classification: Categorizes deadlines as Overdue, Critical, High, or Medium priority Dual Notifications: Critical alerts to leadership + daily summaries to team channel Complete Audit Trail: Logs all checks and deadlines to Google Sheets for compliance records How It Works Daily Trigger - Runs at 8:00 AM every morning Fetch Data - Pulls tax calendar and company configuration from Google Sheets Analyze Deadlines - Calculates days remaining, filters by jurisdiction/entity type, categorizes by priority AI Analysis - GPT-4 provides strategic insights and risk assessment on upcoming deadlines Smart Routing - Only sends alerts if overdue or critical deadlines exist Critical Alerts - HTML email to executives + Slack alert for urgent items Team Updates - Slack summary to finance channel with all upcoming deadlines Logging - Records compliance check results to Google Sheets for audit trail Requirements Google Sheets Structure Sheet 1: TaxCalendar DeadlineID | DeadlineName | DeadlineDate | Jurisdiction | Category | AssignedTo | IsActive FED-Q1 | Form 1120 Q1 | 2025-04-15 | Federal | Income | John Doe | TRUE Sheet 2: CompanyConfig (single row) Jurisdictions | EntityType | FiscalYearEnd Federal, California | Corporation | 12-31 Sheet 3: ComplianceLog (auto-populated) Date | AlertLevel | TotalUpcoming | CriticalCount | OverdueCount 2025-01-15 | HIGH | 12 | 3 | 1 Credentials Needed Google Sheets - Service Account OAuth2 OpenAI - API Key (GPT-4 access required) SMTP - Email account for sending alerts Slack - Bot Token with chat:write permission Setup Steps Import workflow JSON into n8n Add all 4 credentials Replace these placeholders: YOURTAXCALENDAR_ID - Tax calendar sheet ID YOURCONFIGID - Company config sheet ID YOURLOGID - Compliance log sheet ID C12345678 - Slack channel ID tax@company.com - Sender email cfo@company.com - Recipient email Share all sheets with Google service account email Invite Slack bot to channels Test workflow manually Activate the trigger Customizing This Workflow Change Alert Thresholds: Edit "Analyze Deadlines" node: Critical: Change <= 3 to <= 5 for 5-day warning High: Change <= 7 to <= 14 for 2-week notice Medium: Change <= 30 to <= 60 for 2-month lookout Adjust Schedule: Edit "Daily Tax Check" trigger: Change hour/minute for different run time Add multiple trigger times for tax season (8 AM, 2 PM, 6 PM) Add More Recipients: Edit "Send Email" node: To: cfo@company.com, director@company.com CC: accounting@company.com BCC: archive@company.com Customize Email Design: Edit "Format Email" node to change colors, add logo, or modify layout Add SMS Alerts: Insert Twilio node after "Is Critical" for emergency notifications Integrate Task Management: Add HTTP Request node to create tasks in Asana/Jira for critical deadlines Troubleshooting | Issue | Solution | |-------|----------| | No deadlines found | Check date format (YYYY-MM-DD) and IsActive = TRUE | | AI analysis failed | Verify OpenAI API key and account credits | | Email not sending | Test SMTP credentials and check if critical condition met | | Slack not posting | Invite bot to channel and verify channel ID format | | Permission denied | Share Google Sheets with service account email | ๐ Professional Services Need help with implementation or customization? Our team offers: ๐ฏ Custom workflow development ๐ข Enterprise deployment support ๐ Team training sessions ๐ง Ongoing maintenance ๐ Custom reporting & dashboards ๐ Additional API integrations Discover more workflows โ Get in touch with us