Block 1 - Get latest commit SHA
- Type / Role
- n8n-nodes-base.httpRequest - httpRequest
- Config choices
- Version 4.2
This workflow is provided as-is. Please review and test before using in production.
Introduction This workflow offers a streamlined solution for uploading multiple files to a GitHub repository simultaneously using GitHub's REST API. It addresses a significant limitation of n8n's n...
n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.stickynote
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Custom Workflows AI.
Original n8n.io sourceThis workflow offers a streamlined solution for uploading multiple files to a GitHub repository simultaneously using GitHub's REST API. It addresses a significant limitation of n8n's native GitHub node, which only supports single-file uploads at a time. By leveraging GitHub's Git Data API, this workflow creates a new Git tree containing multiple files, commits this tree, and updates the target branch—all in a single automated process.
The workflow is particularly valuable for automation scenarios that require batch file operations, such as deploying website updates, publishing documentation, or maintaining configuration files across repositories. It eliminates the need for multiple separate API calls when working with multiple files, making your automation more efficient and less prone to partial update issues.
By abstracting the complexities of GitHub's Git Data API into a reusable workflow, it provides a practical solution for developers, content managers, and DevOps professionals who need to programmatically manage repository content at scale.
This workflow is designed for:
Users should have basic familiarity with GitHub concepts (repositories, branches, commits) and should be comfortable obtaining and using GitHub Personal Access Tokens. While the workflow handles the API complexity, users should understand the fundamentals of version control to effectively utilize and customize it.
This workflow addresses several key challenges:
Limited batch operations: n8n's native GitHub node only supports uploading one file at a time, making multi-file operations cumbersome and inefficient.
API complexity: GitHub's Git Data API requires multiple sequential calls with interdependent data to create commits with multiple files, which is complex to implement manually.
Automation bottlenecks: Without this workflow, automating multi-file updates would require either multiple separate API calls (risking partial updates) or custom scripting outside of n8n.
Consistency issues: When files need to be updated together (e.g., code and corresponding documentation), this workflow ensures they're committed in a single atomic operation.
By solving these issues, the workflow enables reliable, atomic updates of multiple files, maintaining repository consistency and simplifying automation processes.
This workflow uses GitHub's REST API to push multiple files to a repository in a single operation. It follows Git's internal model by:
Initialization: The workflow starts with a manual trigger and sets up GitHub credentials and repository information.
File Content Definition: Two "Set" nodes define the content for the files to be uploaded.
Repository State Retrieval:
Tree Creation: A new Git tree is created that includes both files (file1.txt and file2.txt), specifying their paths and content.
Commit Creation: A new commit is created with the specified commit message, referencing the new tree and the parent commit.
Branch Update: Finally, the branch reference is updated to point to the new commit, making the changes visible in the repository.
To use this workflow:
Import the workflow: Download the workflow JSON and import it into your n8n instance.
Create a GitHub Personal Access Token:
Configure the workflow:
Define file content:
Adjust file paths if needed:
Save and run the workflow: Click "Test workflow" to execute the process.
This workflow can be adapted in several ways:
Add more files:
Change file locations:
Dynamic file content:
Conditional file updates:
Scheduled updates:
Error handling:
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.
| Workflow | Push multiple files to GitHub repository via Github REST API |
|---|---|
| Complexity | intermediate |
| Nodes | 10 |
| Categories | DevOps |
| Author | Custom Workflows AI |
| Published | 24 Mar 2025 |
Use the JSON export at /data/workflows/3308/3308.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
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.
Introduction This workflow offers a streamlined solution for uploading multiple files to a GitHub repository simultaneously using GitHub's REST API. It addresses a significant limitation of n8n's n...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
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 DevOps use case.