Skip to main content

Process incoming files and notify via email with GitHub storage

Workflow preview

Workflow preview
100%
Process incoming files and notify via email with GitHub storage preview
Open on n8n.io

1. Workflow Overview

File Processing Pipeline with Email and GitHub This workflow automatically ingests newly uploaded files, validates and transforms their contents, stores the processed files in a GitHub repository, ...

Best for

  • File Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.splitinbatches, n8n-nodes-base.set, n8n-nodes-base.github

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by vinci-king-01.

Original n8n.io source

1.1 Workflow description

Title
Process incoming files and notify via email with GitHub storage
Workflow name
Process incoming files and notify via email with GitHub storage

File Processing Pipeline with Email and GitHub

This workflow automatically ingests newly-uploaded files, validates and transforms their contents, stores the processed files in a GitHub repository, and sends email notifications upon completion. It is ideal for teams that regularly receive data drops and need an auditable, automated pipeline to clean, version, and distribute those files.

Pre-conditions/Requirements

Prerequisites

  • n8n instance (self-hosted or n8n cloud)
  • GitHub and SMTP credentials with appropriate permissions
  • Basic understanding of JavaScript for custom validation/transform code

Required Credentials

Credential Purpose Minimum Scope
GitHub OAuth2 Commit transformed files to a repository repo
SMTP (Email Send) Dispatch success/failure notifications send

Repository & Email Setup Requirements

Item Example Notes
GitHub Repository [email protected]:org/data-pipeline.git Branch must exist (default: main)
Email Recipients [email protected], [email protected] Comma-separated list

How it works

This workflow automatically ingests newly-uploaded files, validates and transforms their contents, stores the processed files in a GitHub repository, and sends email notifications upon completion. It is ideal for teams that regularly receive data drops and need an auditable, automated pipeline to clean, version, and distribute those files.

Key Steps:

  • Schedule Trigger: Executes the pipeline on a defined schedule (e.g., hourly).
  • HTTP Request: Pulls a file manifest or fetches file blobs from an upstream service.
  • SplitInBatches: Iterates over each file individually for isolated processing.
  • Code (Validate): Runs custom JavaScript to ensure file integrity and schema compliance.
  • If (Validation Pass?): Routes good files forward and diverts failures.
  • Code (Transform): Performs any data re-formatting, enrichment, or cleansing.
  • Set: Prepares commit metadata (file path, commit message).
  • GitHub: Creates or updates a file in the target repository/branch.
  • Email Send: Notifies stakeholders of overall job status, including summary metrics.

Set up steps

Setup Time: 10-15 minutes

  1. Clone the Workflow: Import the JSON file or copy from the n8n community templates gallery.
  2. Configure Schedule Trigger: Set your desired cron expression (e.g., 0 * * * * for hourly).
  3. HTTP Request Node:
  • Enter the endpoint that lists or returns your new uploads.
  • Add authentication headers if required.
  1. Adjust Validation Code: Open the first Code node and replace the schema rules with your own logic.
  2. Modify Transformation Logic: In the second Code node, apply formatting (e.g., CSV → JSON) or enrichment steps.
  3. GitHub Node:
  • Select your GitHub OAuth2 credential.
  • Specify repository, branch, and file path template (e.g., processed/{{ $json.filename }}).
  1. Email Send Node:
  • Set SMTP credential.
  • Add recipients and customize subject/body with variables.
  1. Test Run: Click “Execute Workflow” to ensure end-to-end success.
  2. Activate: Toggle workflow to “Active” for autonomous execution.

Node Descriptions

Core Workflow Nodes:

  • Sticky Note – Documentation and inline comments for maintainers.
  • Schedule Trigger – Initiates the automation on a fixed timetable.
  • HTTP Request – Retrieves incoming file list or contents.
  • SplitInBatches – Paginates large manifests to conserve memory.
  • Code (Validate / Transform) – Custom JS powering data quality checks and format conversion.
  • If – Branching logic for pass/fail handling.
  • Set – Crafts commit metadata and email summaries.
  • GitHub – Commits each transformed file to the repository.
  • Email Send – Dispatches completion notices or error alerts.

Data Flow:

  1. Schedule TriggerHTTP RequestSplitInBatchesCode (Validate)If
  • trueCode (Transform)SetGitHub
  • falseSet (Error)
  1. Both branches converge → Email Send

Customization Examples

Custom Validation Rule

// Reject files larger than 5 MB or missing required columns
if (items[0].binary.data.size > 5 * 1024 * 1024) {
 throw new Error('File exceeds 5MB limit');
}
const required = ['id', 'email', 'created_at'];
required.forEach(col => {
 if (!items[0].json.headers.includes(col)) {
 throw new Error(`Missing column: ${col}`);
 }
});
return items;

Dynamic Commit Path Based on Date

const date = new Date().toISOString().split('T')[0]; // YYYY-MM-DD
item.json.gitPath = `archive/${date}/${item.json.filename}`;
return item;

Data Output Format

The workflow outputs structured JSON data:

{
 "filename": "orders_2023-10-01.csv",
 "status": "committed",
 "commitSha": "a1b2c3d4",
 "linesProcessed": 523,
 "errors": []
}

Troubleshooting

Common Issues

  1. GitHub authentication error – Ensure OAuth app is approved and the token has repo scope.
  2. Email not delivered – Verify SMTP host, port, and that “less secure apps” are allowed (if using Gmail).

Performance Tips

  • Batch large manifests (e.g., 100 records) to avoid memory spikes.
  • Enable n8n queue mode for parallel processing on self-hosted instances.

Pro Tips:

  • Use environment variables ({{ $env["VAR_NAME"] }}) for endpoints and secrets.
  • Configure branch protection in GitHub to enforce pull requests instead of direct commits.
  • Aggregate success vs. failure counts in the Email body for quick health checks.

This is a community n8n workflow template provided “as-is.” Always review and adapt the workflow to meet your security, compliance, and operational requirements.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Workflow Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Trigger & Fetch

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Processing & Validation

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Storage & Notification

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Daily File Check

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1

Block 6 - Fetch File List

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 7 - Check File Count

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Any New Files?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 9 - Prepare File Items

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Iterate Files

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 11 - Download File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 12 - Is CSV?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 13 - Parse CSV

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Validate Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Validation Passed?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 16 - Prepare GitHub Commit

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3

Block 17 - Create/Update File

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 18 - Success Email Content

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3

Block 19 - Send Success Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2

Block 20 - Error Email Content

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3

Block 21 - Send Error Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2

3. Summary Table

Workflow Process incoming files and notify via email with GitHub storage
Complexity advanced
Nodes 21
Categories File Management
Author vinci-king-01
Published 03 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13192/13192.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process incoming files and notify via email with GitHub storage do?

File Processing Pipeline with Email and GitHub This workflow automatically ingests newly uploaded files, validates and transforms their contents, stores the processed files in a GitHub repository, ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management use case.