A Test Plan for Trigger-and-Callback Integrations: The 14 Areas I Check
Integrations where one system starts work in another and waits for the answer are easy to demo and hard to trust. An application triggers a workflow tool, the tool does something and calls back, and in between there are secrets, tokens, timeouts, retries and duplicate messages. "I tried it and it worked" covers one path out of dozens.
This is the test plan I used for exactly that kind of integration, as a reusable checklist: fourteen areas, how to test each one, what to expect, and what I actually saw when I ran it against a live workflow tool. The result of that run is in my field report on testing a Laravel and n8n integration. This article is the plan on its own.
What this article is, and is not
The plan is tool-neutral, and the observed results come from one run: a Laravel application and n8n 2.29.10 on my own server, with fake data. They show what the plan found. They are not a guarantee about your setup. Two sub-tests in the plan were not run in that session, and the table says which.
Before you start
- Use a separate lab environment with its own database and fake data, never production.
- Make the callback reachable. The tool must be able to reach your application. A local address will not work, so use a temporary tunnel or a staging server.
- Use two different secrets, one per direction, and keep them out of your notes and chat.
- Be able to read the other side's stored state. The tool's execution history and your own run table are your evidence.
- Decide the rule for a pass: a test passes only if you observed the result, not because the documentation says so. Otherwise record "not tested".
The fourteen areas
| # | Area | How to test | Expected | What I observed |
|---|
| 1 | The application triggers the workflow | Create a run and dispatch the job. Read the run status and the tool's execution list | The tool accepts it (HTTP 200) and the run moves to "sent" | Passed once the credentials were right. Before that, the tool answered 403 and the run failed at once with no retry |
| 2 | The tool validates the request | Send a valid payload and an empty one | Valid takes the main path, empty takes an "ignore" path | Both behaved as expected |
| 3 | Authentication in the trigger | Call the production URL with no header, a wrong header and the right one. Also the test URL | No header 403, wrong header 403, right header 200, test URL 404 when not listening | Matched. The body of the 403 was Authorization data is wrong!, and rejected calls created no execution |
| 4 | The per-run token | Read the stored request data in the tool | The run id and the token are present and the secret is not in the body | Token matched the expected value, and the run id was also sent as an Idempotency-Key header |
| 5 | The workflow runs | Open the execution | Every node succeeded | Passed |
| 6 | The success callback | Check the callback node and the response | 200 from your application | {"ok":true} |
| 7 | Callback validation | Send the callback with: no secret, a wrong secret, a forged token, an invalid result. Repeat the invalid one with and without an Accept header | 401, 401, 403, then 422 as JSON in both cases | Matched |
| 8 | The result is stored | Read the run row | Status, result and timestamps set. Rejected calls changed nothing | Matched |
| 9 | The failure callback | Make a step fail on purpose, with the error output connected | A failed callback and a failed run with the reason. Also test a failure with no error handling | The first passed. The second was not run |
| 10 | Duplicate callbacks | Send the same callback twice with different results. Dispatch the same run twice. Make the callback arrive before the job finishes | Second callback: 200 and ignored. One execution for a double dispatch. The run is not reverted | The first two passed. The race was not run on the live system |
| 11 | Timeouts and unreachable parts | Unpublish the workflow. Point the application at a closed port. Make the callback address unreachable | Immediate failure with no retry for a 4xx. Retries with backoff for a down tool. A stuck run for an unreachable callback | Matched: four attempts at 0, 10, 60 and 300 seconds, then failed. The unreachable callback left the run in "sent" |
| 12 | The synchronous variant | Valid request, a slow workflow, an invalid result, an HTTP 500 | Result, then a fallback for each failure | Valid worked. The slow one fell back after the 8-second timeout, and the other two also fell back |
| 13 | The expiry job | Backdate a stuck run and run the scheduler | A run younger than the limit is untouched, an older one is marked timed out | Matched |
| 14 | The automated tests | Run the test suite, including any example tests you publish | Pass | Passed once an import and a database setup were added to the example |
Order matters
Run the areas roughly in this order: authentication first (3), then the happy path (1, 2, 5, 6, 8), then security on the callback (7), then the failure and edge cases (9 to 13). Most setup mistakes show up in the first three, and fixing them early saves time.
The results table
Keep a results file as you go. This layout worked: one row per area, a clear result and the evidence.
| # | Area | Result | HTTP | Response | Run status | Tool execution | Log |
|---|------|--------|------|----------|-----------|----------------|-----|
| 3 | Authentication | PASS | 403 / 403 / 200 | "Authorization data is wrong!" | n/a | none created | tool log |
| 9 | Failure callback | PASS (9.1), NOT TESTED (9.2) | 200 | {"ok":true} | failed | success (error handled) | worker log |
Use exactly three results: PASS, FAIL or NOT TESTED. "Should work" is not a result.
Commands that were useful
# 3. Authentication: no header, wrong header, right header (value read from your env file, never printed)
curl -s -o /dev/null -w "%{http_code}\n" -X POST "$TOOL/webhook/my-flow" -d '{}'
curl -s -o /dev/null -w "%{http_code}\n" -X POST "$TOOL/webhook/my-flow" -H "X-Webhook-Secret: wrong-value" -d '{}'
curl -s -o /dev/null -w "%{http_code}\n" -X POST "$TOOL/webhook/my-flow" -H "X-Webhook-Secret: $TRIGGER_SECRET" -d '{}'
# 7. Callback validation: the same request with one thing wrong each time
curl -s -X POST "$APP/api/callback" -H "Accept: application/json" -H "X-Webhook-Secret: $CALLBACK_SECRET" \
-d '{"run_id":"...","token":"forged","status":"succeeded","result":{}}'
What the plan caught that reading did not
- A credential that served both directions, so the trigger secret was rejected.
- A long-running queue worker that kept the application's old address and sent the tool a dead callback URL.
- The tool storing the trigger secret in plain text in its saved executions.
- An execution marked successful even though the workflow had reported a failure, because the error was "handled".
Each of those came from running the real flow and reading what the other side had stored. None showed up on screen as an error.
What to add next time
- A step failing with no error handling at all (area 9).
- A live race between the callback and the job's last line (area 10).
- A load test, if volume matters. This plan checks behaviour, not throughput.
- A restore test: stop the tool for a while and check that nothing is lost afterwards.
Common mistakes
- Testing only the happy path.
- Marking a test as passed from documentation.
- Using one secret for both directions.
- Not looking at the other system's stored data.
- Testing on production.
- Not writing results down, so nobody can say later what was tested.
Frequently asked questions
Does this work for tools other than n8n?
The areas do. The commands and the places to look change with the tool.
How long does it take?
I did not time it, so I will not give a number. Most of the time went into setup and credentials, not the tests themselves.
Should I automate the plan?
Yes, once it has run by hand once. A script that runs the areas and prints PASS or FAIL can run after every change.
Is there a place to start?
Area 3. If authentication does not work as you expect, nothing after it can be trusted.
Where this fits
If you want an integration tested this way before it goes near customers, see API Integration & Custom Automation, or describe your integration here. More project breakdowns are collected under API Projects.