404 when activating workflow with n8n benchmarking tool

Describe the problem/error/question

Hi all,

I’m trying to run benchmarking for my n8n self-hosted instance in AWS.

Followed the instructions for n8n benchmarking tool here n8n/packages/@n8n/benchmark at master · n8n-io/n8n · GitHub . I use this command from the README.md to run test scenario:

docker run ghcr.io/n8n-io/n8n-benchmark:latest run \
	--n8nBaseUrl=https://replaced.my.selfhosted.instance.url \
	[email protected] \
	--n8nUserPassword=InstanceOwnerPassword \
  --vus=5 \
	--duration=1m \
	--scenarioFilter=single-webhook

Of course, I’m using correct instance base url and user credentials.

When trying to run benchmarking tool on my laptop (Macbook Pro M1), it always fails with 404 error “Cannot POST /rest/workflows/4n8cIj3t1ucPj9Md/activate“. But when I open n8n instance, I see the workflow with exactly the same id and it is activated.

Does anyone else have similar issues with running benchmarking tool?
Can you please advise how to make benchmarking run successfully in my case?

What is the error message (if any)?

Here is the full output of benchmarking tool

Waiting for n8n https://replaced.my.selfhosted.instance.url to become online
Setting up owner
Owner already set up
Running scenario: Unnamed-SingleWebhook
Loading and importing data
[ERROR] Request failed POST /workflows/4n8cIj3t1ucPj9Md/activate <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /rest/workflows/4n8cIj3t1ucPj9Md/activate</pre>
</body>
</html>

    AxiosError: Request failed with status code 404
    Code: ERR_BAD_REQUEST

Information on your n8n setup

  • n8n version: 1.121.3
  • Database (default: SQLite): PostgreSQL
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker in AWS EKS
  • Operating system: Alpine Linux (docker images), MacOS (when running benchmarking tool)

The 404 error when activating workflows via the n8n API is a known issue that can occur due to several factors. Based on the [community.n8n.io](404 Error when trying to retrieve workflows via n8n API (Self-Hosted n8n Instance)) discussions and [GitHub issues](Activating a workflow from the API results in timeout and workflow staying Inactive · Issue #7258 · n8n-io/n8n · GitHub), this often happens with API endpoint routing problems or when the workflow activation process times out.

Try these troubleshooting steps:

• Verify your API base URL format - ensure it doesn’t have trailing slashes and uses the correct `/rest/` prefix

• Check if your self-hosted instance has proper API routing configured for the `/rest/workflows/{id}/activate` endpoint

• Test the API endpoint directly with a tool like curl or Postman to isolate if it’s a benchmarking tool issue or API configuration problem

• Consider checking your n8n logs during the activation attempt to see if there are any server-side errors

The fact that you can see and manually activate the workflow in the UI suggests the issue is specifically with the API endpoint configuration rather than the workflow itself.

Hey @achamm ,

I don’t see any /rest endpoints for n8n. I’ve used this n8n endpoints from the n8n API playround

  • POST /api/v1/workflows - create a workflow
  • POST /api/v1/workflows/{id}/activate - activate the workflow

This requests are successful when running from Postman, workflow is activated and I get response 200 OK from n8n API.

I meant /rest as in the file

Cannot POST /rest/workflows/4n8cIj3t1ucPj9Md/activate

1 Like

@achamm thanks for pointing this out.

Found that /rest endpoints are internal and used by UI primarily. They require another type of authentication, comparing to regular /api endpoints.

I’ve ended up upgrading my n8n self-hosted instance from n8n 1.* to n8n 2.* (in my case I’ve upgraded to n8n 2.4.4) and this resolved my issue. It seems that latest n8n benchmarking tool is not compatible with n8n 1.*

Nice! Happy you solved it!

1 Like