What This Workflow Does
This workflow watches a special folder in Google Drive for new n8n workflow JSON files.
When it finds one, it reads the file, cleans up the workflow data, and sends it to an n8n instance automatically.
Then, it tags the new workflow with a chosen tag and moves the file to a different Google Drive folder.
This saves time by removing the need to import and tag workflows manually.
It helps avoid mistakes in tagging or deploying workflows in n8n.
You get workflows imported quickly, correctly tagged, and your Google Drive organized without extra work.
This means less waiting and less fixing errors later.
Who Should Use This Workflow
This workflow is for people who manage many n8n workflows and want to save time.
It fits users who upload workflow JSON files to Google Drive and want them automatically imported and sorted.
It helps teams reduce manual work and avoid errors when deploying new automation workflows in n8n.
Users who want clear, organized workflows tagged properly will benefit most.
Tools and Services Used
- Google Drive: Stores workflow JSON files in “ToDeploy” and “Deployed” folders.
- n8n API: Receives cleaned workflow JSON, creates workflows, and sets tags through HTTP requests.
- n8n Google Drive Nodes: Monitor folders, download, and move files automatically.
- JavaScript Code Node: Cleans JSON data to keep only necessary settings before import.
Inputs, Processing Steps, and Outputs
Inputs
- New n8n workflow JSON files dropped in the “ToDeploy” Google Drive folder.
- Configured n8n API credentials and Google Drive OAuth credentials.
- Tag ID to apply to imported workflows.
Processing Steps
- Trigger detects new file in “ToDeploy” folder.
- Download the workflow JSON file content.
- Parse and clean the JSON, keeping only necessary workflow details like connections and essential settings.
- Send cleaned JSON to n8n API to create a new workflow.
- Tag the new workflow using the API with the selected tag ID.
- Move the processed JSON file from “ToDeploy” to “Deployed” folder in Google Drive.
Outputs
- New workflow created on n8n instance with proper configuration.
- Workflow tagged correctly using chosen tag ID.
- Source JSON file moved to “Deployed” folder to prevent re-imports.
- Logs or error capture if workflow creation fails (optional).
Beginner Step-by-Step: How to Use This Workflow in n8n
Download and Import the Workflow
- Download the workflow JSON file using the Download button on this page.
- Open your n8n editor where you want to add this automation.
- In n8n, click the main menu, select “Import from File”, and choose the downloaded JSON file.
Configure Credentials and Settings
- Add your Google Drive OAuth2 credentials inside n8n for file access.
- Set up your n8n API key credentials with the generated API key and base URL for your n8n instance.
- Open the Set n8n API URL & Tag ID variables node and enter your n8n instance URL and workflow tag ID.
- Make sure your Google Drive folder IDs for “ToDeploy” and “Deployed” folders are correct in their respective nodes.
Test and Activate the Workflow
- Place a sample valid n8n workflow JSON file inside the “ToDeploy” folder in Google Drive.
- Run the workflow manually once in n8n to test the import and tagging process.
- Check if the new workflow appears in n8n and the JSON file moves to “Deployed”.
- Activate the workflow by toggling it to Active in n8n so it works automatically.
If running self-host n8n, verify network settings allow API access correctly.
Code to Clean Workflow JSON
This JavaScript code inside the Clean JSON file ready for import node keeps only key workflow fields.
Use it as is in your workflow to avoid import errors from extra data.
const fullWorkflow = $json.data || $json;
const cleanSettings = {};
if (fullWorkflow.settings?.executionOrder) {
cleanSettings.executionOrder = fullWorkflow.settings.executionOrder;
}
if (fullWorkflow.settings?.timezone) {
cleanSettings.timezone = fullWorkflow.settings.timezone;
}
const cleanWorkflow = {
name: fullWorkflow.name,
nodes: fullWorkflow.nodes,
connections: fullWorkflow.connections,
settings: cleanSettings,
};
return { json: cleanWorkflow };
Customizations
- Change Google Drive folder IDs if you want to watch or move files in different folders.
- Use different workflow tags by finding tag IDs with the Get Existing Workflow Tags node and updating the tag variable.
- Add validation code after extracting JSON to check the workflow content before import.
- Include notification nodes such as email or Slack after error capture nodes to alert on import failures.
- Create the “ToDeploy” and “Deployed” folders automatically before running if missing, using Google Drive API calls in a pre-run step.
Troubleshooting
Problem: “401 Unauthorized on API calls”
Cause: API key is wrong or expired.
Solution: Generate new API key from n8n settings, update credentials in n8n, and retry.
Problem: “Google Drive Trigger not detecting new files”
Cause: Wrong folder ID or insufficient Google Drive permissions.
Solution: Check folder IDs and give OAuth credentials full access rights.
Problem: “Workflow JSON import fails with invalid structure”
Cause: Uploaded files are corrupted or have wrong format.
Solution: Validate workflow JSON manually or add a Code node to check before import.
Pre-Production Checklist
- Confirm Google Drive folder IDs for “ToDeploy” and “Deployed” folders are set and accessible in n8n.
- Test n8n API credentials by running Get Existing Workflow Tags node and check successful authentication.
- Copy the desired tag ID from tags node output and update it in tag variable node.
- Add a sample workflow file to “ToDeploy” and watch full import and file move process during a test run.
- Check workflow appears in n8n instance with expected tag after import.
- Backup existing workflows as a caution before starting automation to avoid accidental overwrites.
Deployment Guide
Toggle workflow to Active in n8n to start automatic monitoring for new files.
Set Google Drive Trigger polling interval to about one minute for timely detection.
Watch n8n execution logs regularly to catch any failures in import or tagging.
Check Capture Name If Fails To Create Workflow node output for debugging.
Consider adding data retention or external logging if the workflow runs in large scale or enterprise environments.
Summary
✓ Saves hours weekly by automating import and tag of n8n workflows.
✓ Reduces human errors like missing tags or wrong deployments.
✓ Keeps Google Drive clean by moving processed files.
✓ Allows quick tagging and consistent workflow setup in n8n.
✓ Works with your current Google Drive and n8n instance with minimal setup.
✓ Easy to test, customize, and deploy inside the n8n editor.
