Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman
API Mock Auto-Refresh with GitHub, Postman & OpenAPI Diff Alerts This n8n workflow automates the full API specification update lifecycle whenever changes are pushed to GitHub. It refreshes a Postman mock server, downl...
Template notes
API Mock Auto-Refresh with GitHub, Postman & OpenAPI Diff Alerts
This n8n workflow automates the full API specification update lifecycle whenever changes are pushed to GitHub. It refreshes a Postman mock server, downloads the old and new OpenAPI specs, compares them using openapi-diff, then posts detected API changes directly to the GitHub Pull Request and emails the team. This helps engineering teams instantly validate API contract changes, catch breaking updates early and keep testers/mobile developers synced automatically.
Quick Start Setup
1. [Import the workflow JSON into your n8n account](https://n8n.partnerlinks.io/om1efg2qgvwi). 2. Add your GitHub, Postman and Gmail credentials. 3. Update values inside Set: Config node. 4. Create a GitHub webhook pointing to /webhook/api-update. 5. Configure GitHub Actions to run openapi-diff and POST results to /webhook/api-diff-result. 6. Activate the workflow. 7. Push an API spec update and test the automation.
What It Does
Managing API changes across backend, QA, mobile and frontend teams can become messy when OpenAPI specs are updated manually. This workflow solves that by creating an automated pipeline between GitHub, Postman and your internal notification channels.
Whenever code or spec changes are pushed to the develop branch, the workflow first refreshes your Postman Mock Server so testers can immediately work with the latest API behavior. It then downloads both old and new API spec files.
Next, an external GitHub Actions process runs openapi-diff to compare the specs and sends the result back into n8n. If changes exist, the workflow cleans the output, posts it as a GitHub Pull Request comment and emails the summary to stakeholders.