Calling a n8n webhook from another node

I created a workflow with a webhook trigger and It works fine when I call it from another application.

Now I would like to call it from another workflow. This new workflow will have nodes to determine the data to gives within the body of the webhook.

I get the following error:

{
"status": "rejected",
"reason": {
"message": "connect ECONNREFUSED 127.0.1.1:443",
"name": "Error",
"stack": "Error: connect ECONNREFUSED 127.0.1.1:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)",
"code": "ECONNREFUSED"
}
}

I’m using docker.

Thanks for your help

Hey @equipc,

Have you tried using port 5678 which is the local port the container listens on?

Hey @jon,

I tried that but I had another error if I specify the port

{
"status": "rejected",
"reason": {
"message": "write EPROTO 139791415663944:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: ",
"name": "Error",
"stack": "Error: write EPROTO 139791415663944:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)",
"code": "EPROTO"
}
}

Was thinking about a SSL issue but checking “Ignore SSL Issues” don’t solve this issue…

Using http://localhost:5678/webhook instead of https://mydomain/webhook works fine.

Ah yeah I forgot to mention that bit, n8n runs as an HTTP service on port 5678 to change it you would normally pop a reverse proxy in front of it like nginx or Traefik.

Glad you have it sorted now though, Happy automating :+1:

2 Likes

Hi @jon , same problem using n8n deskop. (can modify the port) Any clue how to fix?

{"status":"rejected","reason":{"message":"connect ECONNREFUSED 127.0.0.1:80","name":"Error","stack":"Error: connect ECONNREFUSED 127.0.0.1:80\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)","code":"ECONNREFUSED"}}

Hey @pradilla,

Looks like the same issue, the desktop version is not listening on port 80. Have you tried port 5678 or maybe 5679 I can’t remember what the n8n-desktop.env file has set for it.

Default was set to 5679, tried 5678 also on this file defaultEnv.js. Neither worked. Is this configured in this file or somewhere else?

const defaultEnv = `
N8N_DEPLOYMENT_TYPE='${getDeploymentType()}'
EXECUTIONS_PROCESS='main'
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER='${generateRandomString()}'
N8N_BASIC_AUTH_PASSWORD='${generateRandomString()}'
N8N_PORT=5678
`;

module.exports = { defaultEnv: defaultEnv.trim() };

// from packages/cli/commands/start.ts
function generateRandomString() {
  const availableCharacters = "abcdefghijklmnopqrstuvwxyz0123456789";
  return Array.from({ length: 24 })
    .map(() => {
      return availableCharacters.charAt(
        Math.floor(Math.random() * availableCharacters.length)
      );
    })
    .join("");
}

function getDeploymentType() {
  if (process.platform === "darwin") return "desktop_mac";
  if (process.platform === "win32") return "desktop_win";
  throw new Error("Unsupported platform");
}

If you go to your users home folder there will be a hidden .n8n folder and in there you will find the n8n-desktop.env file.

1 Like

Confirmed 5679
image
Any clue what else I can try?

What error are you getting when using port 5679?

Sound strange but this is the error.

{“status”:“rejected”,“reason”:{“message”:“connect ECONNREFUSED 127.0.0.1:80”,“name”:“Error”,“stack”:“Error: connect ECONNREFUSED 127.0.0.1:80\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)”,“code”:“ECONNREFUSED”}}

That still says you are using 80, can you share some screenshots showing how you are calling it or the workflow itself?