Automate File Save & Logging with n8n, Google Drive & LINE

This workflow automates saving files sent from the LINE Messaging API to Google Drive, organizing them by date and file type, and logging URLs in Google Sheets. It streamlines file management and provides instant user feedback, reducing manual intervention and errors.
googleDrive
googleSheets
code
+5
Workflow Identifier: 2225
NODES in Use: googleSheets, googleDrive, code, if, merge, httpRequest, webhook, stickyNote
Automate file save with n8n and Google Drive

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow downloads files sent through LINE Messaging API automatically.

It saves files into Google Drive folders organized by date and type.

It also checks if the file type is allowed using data in Google Sheets.

The workflow logs file info like name, upload date, type, and link into Google Sheets.

You can choose if a reply message is sent back to the LINE user with the file URL or error.

This helps reduce hours of manual work, mistakes, and speeds up file handling.


Who should use this workflow

This workflow is for people who receive many files via LINE app and want to save and organize them automatically.

It helps customer support agents or teams managing images, audio, and videos daily.

It is useful if file types must be checked before saving and if organized storage and logs are needed.


Tools and services used

  • LINE Messaging API: Sends file messages to trigger the workflow.
  • Google Sheets: Holds configuration like allowed file types and logs file details.
  • Google Drive: Stores files in folders arranged by date and file type.
  • n8n: Orchestrates the entire automation workflow handling API calls and logic.
  • HTTP Header Authentication: Authenticates LINE API requests with channel access token.

Inputs, processing steps, and outputs

Inputs

  • Incoming file message events from LINE through webhook.
  • Allowed file types and configuration data from Google Sheets.

Processing Steps

  • Receive webhook event with file details.
  • Fetch config from Google Sheets (allowed types, folder IDs, flags).
  • Combine event and config data.
  • Calculate folder names based on date and file type if needed.
  • Check if date and file type folders exist in Google Drive; create them if missing.
  • Decide final Google Drive folder for uploading.
  • Download file binary content from LINE API using file message ID.
  • Validate if the file type matches the allowed list.
  • Upload the file to Google Drive into the correct folder.
  • Record file details (name, type, date, URL) in Google Sheets.
  • Optionally send a LINE reply message confirming upload or error.

Outputs

  • Files saved in organized Google Drive folders.
  • Log entries in Google Sheets with metadata for each file.
  • LINE user messages confirming upload or explaining error.

Beginner step-by-step: How to use this workflow in n8n

Importing the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor.
  3. Use Import from File option to load the downloaded workflow.

Configuration after import

  1. Add all required credentials like Google Sheets OAuth2, Google Drive OAuth2, and LINE API channel access token.
  2. Update configuration values such as Google Sheet ID, Google Drive Parent Folder ID, and LINE channel info if needed.
  3. Check flags in the config sheet like Store by Date, Store by File Type, and Reply Enabled.
  4. Review code nodes for folder naming and final folder ID logic; update if folder naming format changes.

Testing and activation

  1. Send a sample file message to the LINE channel to trigger the webhook and test the workflow.
  2. Check if the file downloads, uploads to Google Drive, and logs correctly in Google Sheets.
  3. If reply is enabled, verify that the LINE user receives a confirmation message.
  4. Activate the workflow by toggling the activation switch in n8n to run it in production.

If running self-host n8n, make sure the webhook URL is publicly accessible. See self-host n8n for help.


Edge cases and common failures

  • File type is not allowed: workflow stops upload and sends error message; update allowed types list in Google Sheets.
  • No folders found or created: check Parent Folder ID and OAuth permissions for Google Drive API.
  • Empty input errors in code nodes: verify upstream nodes and connections.
  • LINE reply messages missing: check Reply Enabled flag and channel access token correctness.

Customization ideas

  • Toggle Store by Date or Store by File Type flags in config sheet to change folder structure dynamically.
  • Change allowed file types in config sheet using pipe-separated MIME types like image/jpeg|video/mp4.
  • Edit reply message content JSON in Send LINE Reply Message node to customize user feedback.
  • Modify folder naming format by editing the Determine Folder Info code node.
  • Disable LINE reply function by setting Reply Enabled flag false in configuration.

Summary of benefits and results

✓ Saves time by automating LINE file downloads and uploads.

✓ Keeps Google Drive files organized by date and type.

✓ Prevents saving disallowed file types to protect storage.

✓ Creates clear logs in Google Sheets for easy file tracking.

✓ Improves communication with optional LINE reply messages.

→ Less manual work, fewer mistakes, and faster file management.


Automate file save with n8n and Google Drive

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow reads the list of allowed file types from a Google Sheets configuration sheet and compares incoming file types against it.
The workflow automatically creates the missing folder in Google Drive before uploading the file.
The reply message feature is controlled by the Reply Enabled flag in the Google Sheets config; setting it to false disables replies.
Yes, the workflow supports images, audio, and video file types as long as those types are listed in the allowed types configuration.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.