integration-mock
v0.1.1
Published
Mock the APIs an n8n workflow calls: vendor packs from OpenAPI, recorded traffic, snapshot and replay, fault injection
Maintainers
Readme
integration-mock
Build and test n8n workflows without calling the real APIs. integration-mock runs on your machine and answers as Slack, Stripe, HubSpot and other services would, so a test run sends no real messages, uses no quota and needs no API key. Anything it has no answer for fails with a clear error instead of empty data.

Installation
Requires Node.js 20 or newer.
Run it without installing:
npx integration-mock --helpAdd it to a project:
npm install --save-dev integration-mockBuild from source:
git clone https://github.com/LudwigGerdes/integration-mock.git
cd integration-mock
pnpm install && pnpm buildGetting started
Start the mock, turn on the Slack pack, and post a message to it:
npx integration-mock start
npx integration-mock packs enable slack
curl -X POST http://127.0.0.1:8080/slack/api/chat.postMessageExpected output:
proxy started on :8080 (admin :8081)
enabled: slack
{"channel":"C1H9RESGL","message":{"attachments":[{"fallback":"This is an attachment's fallback","id":1,"text":"This is an attachment"}],"bot_id":"B19LU7CSY","subtype":"bot_message","text":"Here's a message for you","ts":"1503435956.000247","type":"message","username":"ecto1"},"ok":true,"ts":"1503435956.000247"}No message was sent anywhere. See what was called, then stop the mock:
npx integration-mock log
npx integration-mock stopExpected output:
2026-09-21T07:32:48.556Z POST slack /api/chat.postMessage 200 slack:POST:/api/chat.postMessage#0
stoppedIn n8n, set an HTTP Request node's URL to http://127.0.0.1:8080/slack/api/chat.postMessage to use the mock from a workflow.
Usage
See which services can be mocked, and turn some on:
integration-mock packs list
integration-mock packs enable slack hubspotGet the base URL to point a workflow at:
integration-mock url slackMake the next call fail, to test an error branch or retry settings:
integration-mock faults set slack --status 503 --onceMock an API that has no pack yet:
integration-mock packs init acme --domain api.acme.comExpected output:
created ./.integration-mock/packs/acme
next: edit routes/main.json, then `integration-mock packs validate acme`This creates:
.integration-mock/
└── packs/
└── acme/
├── pack.json
└── routes/
└── main.jsonMock nodes whose URL you cannot change, such as the Slack node, by running n8n and the mock together in Docker:
integration-mock upRun a workflow once for real, then keep testing against that recorded run:
integration-mock snapshot latest --workflow <id>Documentation
Full documentation is at workflowtools.dev/integration-mock:
License
MIT © Ludwig Gerdes
The packs are generated from the services' published OpenAPI descriptions; NOTICE lists each source. Not affiliated with n8n GmbH or with any of the services mocked.
