How to test n8n webhook workflows locally without triggering live APIs
Developers at Weio, Inc. have outlined a method for testing n8n webhook workflows without making real calls to services like WhatsApp, Google Sheets, or Slack. The approach centers on adding a dry_run flag to webhook requests, which a Switch node uses to route traffic either to real action nodes or directly to a response node. All business logic is isolated inside a single Code node that returns a plain object, making it independently testable through fixture JSON files and CLI assertions. The pattern also covers running n8n in a temporary Docker container for isolated test environments, with specific warnings about timing traps such as waiting for full database readiness before importing workflows. Common CLI pitfalls around workflow activation in non-queue mode are also documented to help teams avoid silent failures during automated test runs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in