Module 11Lesson 5

Lesson 5. Testing: How to Make Sure Your Agent Works

Hands-on: n8n

Lesson 5. Testing: How to Make Sure Your Agent Works#

Goal: learn to test your agent before launch to avoid problems in production.

Types of Testing#

1. Unit testing (testing individual nodes)

Verify that each node works on its own.

How:

  • in n8n click a node and press Execute Node
  • make sure the node returns the correct result

Example:

  • HTTP Request node (get Bitcoin price) → verify it returns JSON with the price
  • Set node (extract price from JSON) → verify the price field is filled

2. Integration testing (testing the chain)

Verify that the whole chain of nodes works together.

How:

  • run the entire workflow (Execute Workflow)
  • verify data is passed correctly from node to node
  • verify the final result is correct

Example:

  • workflow: Manual Trigger → HTTP Request → Set → Telegram
  • run it → verify the message arrives in Telegram with the correct price

3. User testing (End-to-End)

Verify how the agent works from the user's perspective.

How:

  • act like a real user
  • send different requests (typical, edge cases, invalid)
  • verify the agent responds correctly

Example (Telegram bot):

  • send the bot: "Hi"
  • send: "What's the Bitcoin price?"
  • send: "asdfghjkl" (nonsense message)
  • send a very long message (2000 characters)
  • verify the bot responds correctly in all cases

4. Load testing (if you expect many users)

Verify the agent can handle a large number of requests.

How:

  • use tools (e.g., JMeter, Locust, or a simple script that sends 100 requests in a row)
  • verify the agent doesn't crash or slow down

For most no-code agents this isn't critical (platforms usually scale automatically).

Pre-Launch Testing Checklist#

Basic checks:

  • Each node works on its own (unit tests)
  • The full workflow runs from start to finish (integration test)
  • Agent responds correctly to typical requests
  • Agent handles errors correctly (invalid data, API unavailable)
  • Logging is configured (all important actions are recorded)
  • Monitoring is configured (you get notifications on errors)

Security:

  • Personal data is protected (HTTPS, restricted access)
  • Consent for data processing is obtained (checkbox, privacy policy)
  • No API keys exposed in code or logs

User experience:

  • Agent responds quickly (under 5 seconds)
  • Agent clearly explains what to do (when input is needed)
  • Agent is polite and helpful (not rude, doesn't ignore)
  • Agent offers an alternative when it can't help (handoff to operator)

Fault tolerance:

  • Agent retries on API failure (Retry)
  • Agent switches to backup when primary is unavailable (Fallback)
  • Agent doesn't crash on invalid data (validation)