Skip to main content

Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman

Workflow preview

Workflow preview
100%
Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman preview
Open on n8n.io

1. Workflow Overview

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 Postma...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.webhook, n8n-nodes-base.stopanderror, n8n-nodes-base.if, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.

Original n8n.io source

1.1 Workflow description

Title
Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman
Workflow name
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, 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.
  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.

Who It's For

  • API development teams
  • Mobile app teams relying on mocks
  • QA / testing engineers
  • DevOps teams managing CI/CD pipelines
  • Product teams reviewing API changes
  • Enterprises maintaining multiple consumers of internal APIs

Requirements to Use This Workflow

Accounts / Tools Needed

  • n8n account (cloud or self-hosted)
  • GitHub repository access
  • Postman account with Mock Server
  • Gmail account for notifications
  • GitHub Personal Access Token
  • GitHub Actions enabled in repository
  • OpenAPI spec files stored in repository

Recommended Files

/openapi_specs/openapi_old.yaml
/openapi_specs/openapi_new.yaml

How It Works & Set Up

Workflow Logic

GitHub Push Trigger
 ↓
Load Config
 ↓
Refresh Postman Mock
 ↓
Download Old Spec
 ↓
Download New Spec
 ↓
GitHub Actions runs openapi-diff
 ↓
Send Result to n8n Webhook
 ↓
If changes found:
 ├─ Comment on PR
 └─ Send Email
Else:
 └─ Stop execution

Setup Instructions

1. Import Workflow

Upload the JSON file into n8n.

2. Configure Credentials

Connect:

  • GitHub Header Auth
  • Postman API Key
  • Gmail OAuth2
3. Update Set: Config Node

Replace sample values with your real values:

  • postman.apiKey
  • postman.mockId
  • github.repo
  • github.token
  • github.prId
4. GitHub Webhook

Create webhook inside your repository:

POST https://your-n8n-domain/webhook/api-update

Trigger on:

  • Push events
  • Pull requests (optional)
5. GitHub Actions Setup

Use Docker image for openapi-diff and POST response to:

https://your-n8n-domain/webhook/api-diff-result
6. Activate Workflow

Turn workflow ON and test with a sample OpenAPI change.

How To Customize Nodes

Set: Config

Use environment variables or credentials instead of plain text values.

Update Postman Mock

Point to another mock server or workspace.

Comment to PR

Customize PR comment format:

  • Add markdown tables
  • Mention reviewers
  • Highlight breaking changes only

Send Summary Email

Send to:

  • Product managers
  • QA team
  • Slack email channel
  • Multiple recipients

If Node

Filter only:

  • Breaking changes
  • Path additions
  • Schema changes

Add-ons (Optional Enhancements)

  1. Slack notifications instead of email
  2. Microsoft Teams alerts
  3. Jira ticket creation for breaking changes
  4. Auto-approve PR if no breaking changes
  5. Save diff history to database
  6. Daily digest of API changes
  7. Trigger mobile regression tests automatically
  8. Publish docs automatically after merge

Use Case Examples

1. Mobile App Sync

Backend updates endpoints → mobile team receives diff instantly.

2. QA Regression Planning

Tester receives changed API list before release testing.

3. API Governance

Architecture team tracks breaking changes across repos.

4. Faster PR Reviews

Reviewers see API contract changes directly in GitHub comments.

5. Multi-Team Communication

Frontend, backend and product teams stay aligned.

There can be many more enterprise and SaaS use cases for this workflow.

Troubleshooting Guide

Issue Possible Cause Solution
Webhook not triggering Wrong GitHub webhook URL Recheck endpoint
No PR comment posted Invalid GitHub token Regenerate PAT
Mock not refreshed Wrong Postman mock ID Verify mock server ID
Email not sent Gmail OAuth expired Reconnect Gmail
No diff detected Same specs or bad file path Validate YAML files
Workflow stops early Empty diff payload Check GitHub Actions POST body

Need Help?

Need help deploying or customizing this workflow for production use?

Our n8n workflow developers at WeblineIndia can help you with:

  • n8n workflow implementation
  • GitHub CI/CD integrations
  • API governance automation
  • Postman mock lifecycle systems
  • Enterprise DevOps automations
  • Custom notification pipelines

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 - Sticky Note - How It Works

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

Block 2 - Sticky Note - GitHub Webhook

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

Block 3 - Sticky Note - Set Config

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

Block 4 - Sticky Note - Update Postman

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

Block 5 - Sticky Note - Old Spec

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

Block 6 - Sticky Note - New Spec

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

Block 7 - Sticky Note - Diff Webhook

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

Block 8 - Sticky Note - Check Empty

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

Block 9 - Sticky Note - Stop Error

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

Block 10 - Sticky Note - Get Fields

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

Block 11 - Sticky Note - Comment PR

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

Block 12 - Sticky Note - Email

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

Block 13 - Update Postman Mock

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

Block 14 - Comment to PR

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

Block 15 - Set: Config

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

Block 16 - GitHub Webhook

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

Block 17 - Download OLD OpenAPI Spec

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

Block 18 - Download NEW OpenAPI Spec

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

Block 19 - Webhook OpenAPI-diff

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 20 - Stop and Error

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

Block 21 - Get Fields

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

Block 22 - Check If data is not empty

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

Block 23 - Send Summary Email1

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

3. Summary Table

Workflow Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman
Complexity advanced
Nodes 23
Categories DevOps
Author WeblineIndia
Published 18 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15123/15123.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 Refresh API mocks and send OpenAPI diff alerts with GitHub and Postman do?

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 Postma...

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 DevOps use case.