Automate Multi File Upload Github N8N Rest Api — Complete Guide [2026]

Learn how to automate multi file upload github n8n rest api with this step-by-step guide. Includes workflow examples, tips, and best practices for 2026.
httpRequest
set
manualTrigger
+1
Workflow Identifier: 1885
NODES in Use: Manual Trigger, Set, HTTP Request, Sticky Note
Automate file upload with n8n and Github

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

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow lets user push many files to a GitHub repo in just one commit.

It fixes the problem of GitHub nodes in n8n only uploading one file each time.

User gets a faster, simpler way to update multiple files without repeated manual steps.

The workflow calls GitHub API to find the latest commit and base tree.

Then it builds a new tree with many files and commits it with custom message.

Finally, it updates the branch reference to the new commit.

This speeds up multi-file updates and lowers errors from manual work.


How This Workflow Works (Inputs → Process → Outputs)

Inputs

  • GitHub username, repo name, branch name
  • GitHub Personal Access API Key with repo content write permission
  • Text content for multiple files to upload
  • Commit message text

Processing Steps

  • Get latest commit SHA from specified branch via API
  • Fetch full commit to retrieve base tree SHA
  • Create a new git tree with multiple files using their paths and content
  • Create a new commit referencing new tree and previous commit parent
  • Update branch reference to the new commit SHA

Output

  • GitHub branch updated with all new or modified files included in one commit

Who Should Use This Workflow

People who update several files at once in a GitHub repo.

Users who want to avoid manual uploads or multiple single-file commits.

Staff managing documentation, config files, or code needing batch updates.

Anyone wanting to speed up GitHub multi-file commits using n8n.


Tools and Services Used

  • n8n: Workflow automation platform running the process.
  • GitHub REST API: For retrieving latest commit, trees, creating commits, and updating refs.
  • GitHub Personal Access Token: Authentication and permission for API to read/write repo contents.

Beginner Step-by-Step: How to Use This Workflow in n8n for Production

1. Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor (could be cloud or self-host n8n instances).
  3. Click ‘Import from File’ and choose the downloaded workflow JSON file.

2. Configure Credentials

  1. Provide the GitHub Personal Access Token with repo content read/write scopes into the Set GitHub Info node.
  2. Enter your GitHub username, repo name, target branch, and commit message in the same node.

3. Update File Contents and Paths (if needed)

  1. Modify the File 1 and File 2 nodes with your needed file content.
  2. Change file paths in the Create new tree node if uploading files to other repo folders.

4. Test the Workflow

  1. Use the Manual Trigger node to manually start the workflow.
  2. Watch the output and logs to ensure the API calls succeed and files commit properly.

5. Activate for Production

  1. Switch workflow from draft to active in n8n to enable trigger-based or scheduled runs live.
  2. Integrate with other triggers or automate push on events as needed.

Customization Ideas

  • Add more files in Create new tree node by expanding the “tree” array with each extra file object’s path and content.
  • Change branch name in Set GitHub Info node to commit to different GitHub branches.
  • Replace static texts in File 1 and File 2 nodes with dynamic data from other API responses or workflows in n8n.

Common Problems and Fixes

Unauthorized 401 error from GitHub API

This happens when API Key is wrong or missing permissions.

Fix by checking that the GitHub Personal Access Token has repo content read/write scopes and is set correctly in Set GitHub Info node.

No such ref error updating branch

This means the branch name is incorrect or does not exist.

Confirm the branch name matches exactly with the repo branches and update Set GitHub Info node if needed.


Pre-Production Checklist

  • Check GitHub Personal Access Token includes write access for repo content.
  • Verify File 1 and File 2 nodes output correct file texts for commit.
  • Run the workflow with Manual Trigger and confirm successful API responses.
  • Backup important files in GitHub repository before running commits.

Deployment Guide

After testing, activate workflow in n8n for live use.

Trigger automatically from other workflows, CRON jobs, or events.

Watch executions in n8n UI for errors and fix nodes as needed.

Automate file upload with n8n and Github

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, if the GitHub Personal Access Token has permissions to access private repositories.
Yes, because it makes multiple API requests for commits and trees, so monitor GitHub API rate limits.
Not directly; binary files must be base64 encoded and the API body updated accordingly to upload.
Check that the branch name in the Set GitHub Info node is exactly correct and exists in the GitHub repository.

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.