Ten short modules. Five teach n8n basics, five build QA agents for bug triage, RCA, flaky tests, Playwright MCP and CI runs. Each module is the same: we have this, we get this, with one diagram and one workflow to download.
An agent is a chat model that can remember the conversation and call tools. This is the module students will use most at work.
Theory
What it is:Agent = Model (brain) + Memory (history) + Tools (hands). The model reads the message and decides which tool to call.
QA Analogy:A junior tester with a checklist. The system message is the checklist; tools are the apps they are allowed to open.
chatInput
What the user typed. Comes from the Chat Trigger.
sessionId
Keeps each user's memory separate.
$fromAI()
Lets the AI fill a tool parameter, like a username or a Jira key.
Tool description
The agent picks tools by reading this. Vague text means wrong picks.
Diagram
The agent sits in the middle. Green tools are the ones it can call; the model decides when.
Code
Expressions · Agent and tools
// AI Agent prompt (Define below)
{{ $json.chatInput }}
// HTTP Request tool URL: the AI fills the username
https://api.github.com/users/{{ $fromAI('username', 'GitHub username to look up', 'string') }}
// Jira tool: the AI pulls the key out of "create a ticket for VWO-123"
{{ $fromAI('issueKey', 'Jira key like VWO-123', 'string') }}
Build live
Add Chat Trigger and AI AgentOpen Chat and send "hi". Show chatInput and sessionId in the trigger output.
Attach OpenAI Chat ModelAdd the credential. Write a short system message.
Attach Simple MemoryAsk "what was my first question?" before and after adding it.
Attach two toolsCalculator, then an HTTP Request tool with $fromAI() in the URL. Open the logs to see each tool call.
🧪 QA Test Scenarios
T01Tool choice · "What is 18% of 4999?"Calculator called
T02$fromAI value · "Look up the GitHub user torvalds"username = torvalds
T03Memory · "What was my first question?"answers from history
⚠️ Common mistakes
Vague tool descriptions, so the agent never calls the tool
No system message, so answers drift
A node between trigger and agent, and memory loses sessionId
The HTTP Request node reaches any API, even ones without a native node. Add an IF node and it becomes an API test.
Theory
What it is:Send GET, POST, PUT, PATCH or DELETE with headers, query and body. Use one response's data in the next request.
QA Analogy:Postman plus assertions, but chained and scheduled. IF nodes play the role of expect().
Full Response
Turn on to get statusCode, headers and body.
Import cURL
Paste a curl command and n8n fills the node.
Credentials
Use saved credentials or Header Auth. Never hardcode tokens.
Pagination
Built-in option for APIs that return pages.
Diagram
The GET result feeds the POST body. The IF node checks two things, just like two assertions in one test.
Code
Expressions · Chained body and assertions
// POST body (JSON) built from the GET response
{{ JSON.stringify({
title: 'Created from n8n',
body: 'Copied from post ' + $json.body.id,
userId: $json.body.userId
}) }}
// IF node assertions
{{ $json.statusCode }} equals 201
{{ $json.body.title }} equals Created from n8n
Build live
GET with Full Response onCall jsonplaceholder.typicode.com/posts/1. Show statusCode, headers, body.
POST using GET dataBody type JSON, built with JSON.stringify so quotes never break it.
Add the IF assertionsTwo conditions with AND: status 201 and the title matches.
Break it on purposeChange the expected title and watch it go to FAIL.
🧪 QA Test Scenarios
T01Happy path · POST valid body201 → PASS
T02Wrong expectation · expected title changed→ FAIL branch
T03Missing resource · GET /posts/9999404 stops flow (see 05)
⚠️ Common mistakes
Full Response off, then asking "where is statusCode?"
Hand-written JSON body that breaks on a quote
API tokens pasted into the URL or headers instead of credentials
Real APIs fail. This module makes workflows retry, take a safe path when something breaks, and alert the team.
Theory
What it is:IF and Switch route items. Node settings add retries and an error output. An Error Trigger workflow catches anything left over.
QA Analogy:Happy path, negative path and recovery. Every branch is a test case you must run at least once.
Retry On Fail
Max Tries and Wait Between Tries, for flaky APIs.
On Error
Stop, Continue, or Continue using error output.
Error Trigger
Its own workflow. Set it as the Error Workflow in Settings.
Pin Data
Freeze a node's output to replay the same input while debugging.
Diagram
Three outcomes from one input: success, handled error, or missing data. The Error Trigger is the safety net.
Code
Settings · Call API node
Retry On Fail ........ ON
Max Tries ............ 2
Wait Between Tries ... 1000 ms
On Error ............. Continue (using error output)
// In the error branch
{{ $json.error.message }}
// In the Error Trigger workflow
{{ $json.workflow.name }} {{ $json.execution.lastNodeExecuted }}
Build live
Set input and extract the keyReuse the regex from Module 01. Add an IF for a missing key.
Call a failing APIhttpbin.org/status/500. Run it and let it fail first.
Add retries and error outputSettings tab of the node. Run again and show two tries in the log.
Pin data and debugPin Sample Input, open Executions, use Debug in Editor on a failed run.
🧪 QA Test Scenarios
T01API healthy · statusToSimulate = 200→ API OK
T02API down · statusToSimulate = 5002 tries → Handled Error
T03No key · chatInput without VWO-123→ Missing Key, no API call
⚠️ Common mistakes
No negative path, so bad input crashes the flow
"Continue" chosen with nothing handling the error, so failures go silent
Never opening Executions to see what actually happened
Give it failed tests. Get back a triage decision for each one, with duplicates checked.
We have, we get
We have:3 failed TTACart tests: the test name and the error.
We get:categoryseverityduplicateOfownersummary for each test.
Diagram
We have 3 failures, we get a decision for each. The tool checks open bugs so the same bug is not filed twice.
Prompt
System message · Triage Agent
1. Call search_open_bugs with key words from the failure.
2. category: product_bug, test_bug, flaky or environment. Passed on retry = flaky.
3. severity: P1 login or checkout down, P2 wrong result in a main flow,
P3 intermittent or minor, P4 test code only.
4. If an open bug matches, use its key and owner.
Reply with JSON only:
{"test":"","category":"","severity":"","duplicateOf":"","owner":"","summary":""}
Build live
Failed Tests (Code)Return 3 failures as items: test and error.
Triage Agent + search_open_bugsPaste the system message. The Code Tool is a fake Jira search, so no Jira setup is needed.
Parse ResultTurns the agent's JSON text into fields. Run it and read the 3 results.
🧪 QA Test Scenarios
T01Wrong total · checkout order totalproduct_bug · P2 · CART-101
T02Passed on retry · error_user add to cartflaky · P3 · CART-102
T03Short timeout · performance_glitch_user logintest_bug · P4 · no duplicate
Give it a failed test. Get back the root cause, plus the commit and the log line that prove it.
We have, we get
We have:1 failed test. The order total is $39.98 instead of $43.18.
We get:rootCauseevidencesuspectCommitconfidencefix
Diagram
The agent has to read commits and logs before it answers, so every claim comes with evidence.
Prompt
System message · RCA Agent
1. Always call get_recent_commits and get_app_logs first.
2. Every claim needs evidence: a commit sha or a log line.
3. Weak evidence = confidence "low". Do not guess.
Reply with JSON only:
{"rootCause":"","evidence":[""],"suspectCommit":"","confidence":"high|medium|low","fix":""}
Build live
Failed Test (Set)Three fields: test, error, failedAt.
RCA Agent + 2 Code ToolsSample commits and logs. Later, swap them for the GitHub API and your log tool.
Parse Result, then open the logsShow both tool calls in the agent's logs, then the answer.
🧪 QA Test Scenarios
T01Evidence first · run onceboth tools called
T02Right commit · tax failure9f2c1ab · high
T03Weak evidence · delete the WARN log lineconfidence drops
Give it CI history. Get back which tests are flaky, which are broken, and a fix for each flaky one.
We have, we get
We have:The last 10 CI runs of 5 TTACart tests, each a pass or a fail.
We get:A verdict per test (stablewatchflakybroken) and a Playwright fix for each flaky one.
Diagram
Code does the math. A test that keeps flipping is flaky. A test that stays red is broken: that is a real bug, so don't retry it.
Code
Rule · Score Flakiness
flips = how often the result changes between runs
flakyScore = flips / (runs - 1)
stable → never failed
flaky → flakyScore ≥ 0.3 // keeps flipping
broken → last 3 runs all failed // real bug, do not retry
watch → failed once, keep an eye on it
Build live
CI History (Code)5 tests, 10 runs each.
Score Flakiness (Code)Do the math in code, not in AI. Run it and read the 5 verdicts.
Keep Flaky → Suggest FixA Filter, then a Basic LLM Chain that writes one fix per flaky test.
Type a test in chat. The agent runs it in a real browser and tells you PASS or FAIL.
We have, we get
We have:A chat message, for example "log in as locked_out_user and tell me the error".
We get:RESULT: PASS or FAIL with the exact text the agent saw on the page.
Diagram
The agent clicks through a real browser. This is for quick checks driven from chat, not for running a regression suite (that is Module 10).
Setup
Terminal + MCP Client Tool
# 1. Start Playwright MCP and keep this terminal open
npx @playwright/mcp@latest --port 8931
# 2. MCP Client Tool settings in n8n
Endpoint: http://localhost:8931/mcp
Transport: HTTP Streamable
# n8n in Docker: use http://host.docker.internal:8931/mcp# and start MCP with --host 0.0.0.0 --allowed-hosts "*"# n8n Cloud cannot reach localhost: run n8n locally for this module
Build live
Start Playwright MCPOne command, port 8931.
Chat Trigger + Agent + MCP Client ToolSet Max Iterations to 30. The system message names the app and the test users.
Chat and watchRun T01 to T03. A browser opens and the agent clicks through.
🧪 QA Test Scenarios
T01Happy login · log in as standard_userPASS · "Products"
T02Locked user · log in as locked_out_user"Sorry, this user has been locked out."
T03Cart · add backpack and bike lightbadge shows 2