Deploy n8n Workflows on GitHub Push to Production (REST API)
Deploy n8n Workflows on GitHub Push to Production (REST API)
Regular price
£5.99
Regular price
£5.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
âš¡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Deploy n8n Workflows on GitHub Push to Production (REST API)
Regular price
£5.99
Regular price
£5.99
Sale price
Unit price
/
per
Deploy n8n workflows to production automatically on every GitHub push
This n8n workflow listens for GitHub push events, pulls the changed exported n8n workflow JSON from your repository, and then updates or creates the matching workflow in your production n8n instance via the n8n REST API. No manual import steps—just push to GitHub and ship.
What this workflow does
- Triggers on GitHub push and checks the push is targeting the main branch.
- Ignores branch deletion events and proceeds only if there are added or modified files.
- Uses the GitHub Contents API to request the changed workflow JSON file from the repository.
- Extracts the workflow name from the fetched JSON.
- Queries the production n8n instance via the n8n REST API to find an existing workflow with the same name.
- If found, it removes deployment-specific fields (IDs/metadata) from the GitHub JSON and updates the production workflow.
- If not found, it removes IDs/metadata and creates a new workflow in production.
Use cases
-
GitOps for n8n: store exported workflows in GitHub and deploy to production on every change to
main. - SaaS operations: keep production workflows synchronized with version-controlled updates.
- Automation engineering: reduce drift by ensuring the live n8n workflow matches the JSON committed to GitHub.
Technical details
- GitHub Trigger (push events) with GitHub OAuth2 credentials.
- HTTP Request to the GitHub Contents API to fetch workflow JSON.
- n8n REST API calls to search, update, or create workflows in the production instance.
- Workflow logic uses nodes such as if, set, and code (with supporting notes and control flow).
Setup: configure GitHub repo owner/name, set your production n8n base URL, add the required GitHub OAuth2 and n8n API credentials, and ensure the trigger is set to the branch you deploy from (e.g., main).
