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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Get Config | Data store | Google Sheets | See node parameters |
| Create Date Folder | Files / media | Google Drive | folder |
| Set Date Folder ID | Code | Code | See node parameters |
| Create File Type Folder | Files / media | Google Drive | folder |
| Upload File to Google Drive | Files / media | Google Drive | See node parameters |
| Determine Folder Info | Code | Code | See node parameters |
| Search Date Folder | Files / media | Google Drive | fileFolder |
| Merge Event and Config Data | Transform | Merge | See node parameters |
| Check Existing Date Folder | Routing | If | See node parameters |
| Check Existing File Type Folder | Routing | If | See node parameters |
| Merge Final Parent Folder Data | Transform | Merge | See node parameters |
| Search File Type Folder | Files / media | Google Drive | fileFolder |
| Set File Type Folder ID | Code | Code | See node parameters |
| Configure Final Parent Folder ID | Code | Code | See node parameters |
| Process Event and Config Data | Code | Code | See node parameters |
| Get File Binary Content | Web / API | HTTP Request | See node parameters |
| Log File Details to Google Sheet | Data store | Google Sheets | append |
| Check Reply Enabled Flag | Routing | If | See node parameters |
| Check if Store by Date is Enabled | Routing | If | See node parameters |
| Check if Store by File Type is Enabled | Routing | If | See node parameters |
| LINE Webhook Listener | Trigger | Webhook | See node parameters |
| Send LINE Reply Message | Web / API | HTTP Request | POST |
| Validate File Type | Code | Code | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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
googleDriveOAuth2ApigoogleSheetsOAuth2ApihttpHeaderAuth
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.