Testing workflow doesn't stop even when all steps are successful

Testing workflow doesn’t stop even when all steps are successful. When I click test workflow the icon spins until I click the stop icon. The message after clicking stop is ‘Workflow finished executing. It completed before it could be stopped’ The last step has the proper data and the steps succeeded under executions. Is this the expected behavior?

Workflow finished executing. It completed before it could be stopped

  • n8n version: 1.29.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system:Ubuntu 22.04.4
1 Like

same problem here.
I guess websockets never get initialized. After cancelling the testrun, I can see a websocket requests fail with 401 because of failure to authenticate.
wss://domain/rest/push 401 Unauthorized
I deleted all the cookies but did not help.

Also running

  • n8n version: 1.29.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker

I’m behind a nginx reverse proxy, are you behind a proxy?

Yes I am. Good point! I will check there

Thx for the pointer! this fixed it for me:

1 Like

Thanks for the solution!! This worked for me. I’m using nginx and after seeing this solution I researched how to proxy the websocket connection with Nginx. Here is the location block of my config.

‘’’
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # Added for WebSocket
proxy_set_header Connection “upgrade”; # Modified for WebSocket
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
}

‘’’

This worked without enabling server-sent events (sse). Hope this helps someone.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.