← All N8N workflows
Data & databasesCodeGoogle DriveGoogle SheetsHTTP RequestIf

Line Save File to Google Drive and Log File's URL

Configured with Google Drive, Google Sheets, HTTP Request, Webhook. Review the connections and setup before adapting this template.

Workflow preview
Data storeGet ConfigGoogle SheetsFiles / mediaCreate Date FolderGoogle DriveCodeSet Date Folder IDCodeFiles / mediaCreate File Type FolderGoogle DriveFiles / mediaUpload File to GoogleDriveGoogle DriveCodeDetermine Folder InfoCodeFiles / mediaSearch Date FolderGoogle DriveTransformMerge Event and ConfigDataMergeRoutingCheck Existing DateFolderIfRoutingCheck Existing FileType FolderIfTransformMerge Final ParentFolder DataMergeFiles / mediaSearch File Type FolderGoogle DriveCodeSet File Type Folder IDCodeCodeConfigure Final ParentFolder IDCodeCodeProcess Event andConfig DataCodeWeb / APIGet File Binary ContentHTTP RequestData storeLog File Details toGoogle SheetGoogle SheetsRoutingCheck Reply EnabledFlagIfRoutingCheck if Store by Dateis EnabledIfRoutingCheck if Store by FileType is EnabledIfTriggerLINE Webhook ListenerWebhookWeb / APISend LINE Reply MessageHTTP RequestCodeValidate File TypeCode

Node categories in this workflow

  • Data store
  • Files / media
  • Code
  • Transform
  • Routing
  • Web / API
  • Trigger

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Get ConfigData storeGoogle SheetsSee node parameters
Create Date FolderFiles / mediaGoogle Drivefolder
Set Date Folder IDCodeCodeSee node parameters
Create File Type FolderFiles / mediaGoogle Drivefolder
Upload File to Google DriveFiles / mediaGoogle DriveSee node parameters
Determine Folder InfoCodeCodeSee node parameters
Search Date FolderFiles / mediaGoogle DrivefileFolder
Merge Event and Config DataTransformMergeSee node parameters
Check Existing Date FolderRoutingIfSee node parameters
Check Existing File Type FolderRoutingIfSee node parameters
Merge Final Parent Folder DataTransformMergeSee node parameters
Search File Type FolderFiles / mediaGoogle DrivefileFolder
Set File Type Folder IDCodeCodeSee node parameters
Configure Final Parent Folder IDCodeCodeSee node parameters
Process Event and Config DataCodeCodeSee node parameters
Get File Binary ContentWeb / APIHTTP RequestSee node parameters
Log File Details to Google SheetData storeGoogle Sheetsappend
Check Reply Enabled FlagRoutingIfSee node parameters
Check if Store by Date is EnabledRoutingIfSee node parameters
Check if Store by File Type is EnabledRoutingIfSee node parameters
LINE Webhook ListenerTriggerWebhookSee node parameters
Send LINE Reply MessageWeb / APIHTTP RequestPOST
Validate File TypeCodeCodeSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleDriveOAuth2Api
  • googleSheetsOAuth2Api
  • httpHeaderAuth

Workflow notes

Workflow Entry & Configuration

Workflow Entry & Configuration

This section initializes the workflow by listening to incoming requests from the LINE Messaging API and retrieving configuration details from Google Sheets. It merges the event data with the config, then determines initial folder information (such as whether to store files by date or file type). Nodes in this group:

  • LINE Webhook Listener Receives POST requests (file messages) from LINE.
  • Get Config Reads configuration data (parent folder, allowed file types, etc.) from a Google Sheet.
  • Merge Event and Config Data Combines the LINE event data and config data.
  • Determine Folder Info Calculates folder names based on the config (e.g., date folder name, file type folder name).
Folder Search & Creation

Folder Search & Creation

This section handles the logic for finding or creating the appropriate Google Drive folders. It checks if a date folder exists (when Store by Date is enabled) and whether a file type folder is required (when Store by File Type is enabled). Nodes in this group:

  • Search Date Folder / Check Existing Date Folder / Check if Store by Date is Enabled Looks for or creates a date-based folder.
  • Create Date Folder / Set Date Folder ID reates and stores the date folder ID if it doesn’t exist.
  • Search File Type Folder / Check Existing File Type Folder / Check if Store by File Type is Enabled Similarly handles file type subfolder logic.
  • Create File Type Folder / Set File Type Folder ID Creates and stores the file type folder ID.
  • Merge Final Parent Folder Data / Configure Final Parent Folder ID Merges the final folder IDs (date folder + file type folder) to determine where the file should be placed.
Upload, Log, & Reply

Upload, Log, & Reply

Once the file is validated and the correct folder determined, the workflow uploads the file to Google Drive and logs the details in a Google Sheet. Finally, it checks whether replies are enabled and, if so, sends a message back to the LINE user (either confirming a successful upload or reporting an error). Nodes in this group:

  • Upload File to Google Drive Uploads the validated file to the determined folder path.
  • Log File Details to Google Sheet Records the file name, upload date, URL, and file type in Google Sheets.
  • Check Reply Enabled Flag Verifies if replies to LINE are turned on in the config.
  • Send LINE Reply Message Sends a text reply back to the user via LINE, either containing the file’s Google Drive URL or an error message.
File Retrieval & Validation

File Retrieval & Validation

In this group, the workflow fetches the binary content of the file from the LINE API and validates whether the file type is allowed (e.g., image, audio, video). If the file type is not permitted, the workflow throws an error which will be used to send an appropriate reply message back to LINE. Nodes in this group:

  • Get File Binary Content Retrieves the actual file data from the LINE Messaging API.
  • Validate File Type Checks the file’s MIME type against an allowed list from the config and throws an error if disallowed.
Line Save File to Google Drive and Log File's URL

Line Save File to Google Drive and Log File's URL

Purpose and structure

This folder contains the Line Save File to Google Drive and Log File's URL workflow. Its executable nodes use code, googleDrive, googleSheets, httpRequest, if, merge, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

LINE Webhook Listener

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1924_Code_Webhook_Export_Webhook.json MIT; preserve source notices.

More in Data & databases