Active project does not start

Hello, I transferred the working version of my project to another server for constant work. And I noticed a problem, I turn on my project actively, but if the n8n process shuts down and starts, then the active project does not start, such logs are displayed

IMPORTANT! Do not share with anybody as it would give people access to your n8n instance!
n8n ready on 0.0.0.0, port 5678
Version: 0.74.0

  ================================
    Start Active Workflows:
  ================================

Editor is now accessible via:
http: // localhost: 5678 /

Perhaps I did not install some kind of package on the server.
I tried it on different servers, it didn’t start anyway.
I hope they understood me.

Did you try to run the workflow via the Editor-UI and did it run fine there?
Are all the credentials you are using also available on the new n8n instance?

Well, on the main computer where I made the project, the active project starts. Here I mean

>> n8n start --tunnel

Waiting for tunnel ...
Tunnel URL: https://foolish-goose-76.hooks.n8n.cloud/

IMPORTANT! Do not share with anybody as it would give people access to your n8n instance!
n8n ready on 0.0.0.0, port 5678
Version: 0.73.1

 ==================================
   Start Active Workflows:
 ==================================
   - moum
ADD ID (active): 1
     => Started

Editor is now accessible via:
http: // localhost: 5678 /

Press "o" to open in Browser.

On the other computer, everything starts fine too.
I bought a vps server, first ubuntu, then arch, now fedora, everywhere such a picture

[fedora @ n8n-fedora ~] $ n8n start --tunnel

Waiting for tunnel ...
Tunnel URL: https://tame-badger-95.hooks.n8n.cloud/

IMPORTANT! Do not share with anybody as it would give people access to your n8n instance!
n8n ready on 0.0.0.0, port 5678
Version: 0.74.0

 ==================================
   Start Active Workflows:
 ==================================

Editor is now accessible via:
http: // localhost: 5678 /

Press "o" to open in Browser.

So how did you transfer the workflows? You did simply copy & paste them over? If you press “Open” does it list those workflows?

Did you specifically activate the workflows again on the new server? Because that has to be done there again? Do they activate fine?

Did you copy over all the credentials and did you give them exactly the same name?

I copied the n8n folder and pasted it on the server in the user folder. The project runs through the web interface normally. I checked it differently, created an empty project through the web interface, added several elements. Made it active, it works. But when I finish the h8n process and start it again, the active project does not start automatically, I need to go to the web interface, turn off the active checkbox and turn it on again. For some reason, this error is observed on VPS servers, but everything is fine on my home computers. I hope you got what I meant.
I have several Linux computers at home, so that everything works fine, I need to install npm, n8n, transfer the .n8n folder to the user and everything works.

Hi all, i have a same problem on my dedicated server (CentOS 8.2.2004) with standalone n8n installation. I created a workflow with a telegram trigger and made it active. However, after running the n8n command "n8n start --tunnel"in the active workflow, I have nothing. In the web interface, the status of the workflow is active. Нow can I troubleshoot this?

I was done a more deep investigation and here’s what I found out. I was install n8n on my Ubuntu Desktop, but behavior of the active workflow it remains the same, it was not activated at the start. I look at the documentation and see:

It is only possible to activate a workflow which contains a Trigger or a Webhook node.

Hmmm… but telegram trigger in my workflow it is also a trigger, isn’t that right?
Okay… :face_with_raised_eyebrow: I add a cron trigger and immediately see a message in the console that the workflow has become active. After restarting the n8n process, my workflow immediately becomes active. At the same time, the cron trigger is not even connected to anything else. I believe that this behavior of telegram trigger should be described in the documentation (preferably in two places - in the trigger page and in the section about activation workflow).
@jan please, tell me, is this a bug or a feature? :slight_smile:
Thank you for your n8n!

Welcome to the community @Alex!

Sorry do not understand what you mean with:

However, after running the n8n command “n8n start --tunnel” in the active workflow, I have nothing.

How do you run that command inside of the active workflow? And what do you mean with you “have nothing”?

The TelegramTrigger-Node is a Trigger-Node. If a workflow does not contain a Trigger-Node n8n will not allow it to be activated. So it would then display you an error message.

About:

At the same time, the cron trigger is not even connected to anything else.

Yes Trigger-Nodes do not really care if they are connected to anything. If they are connected to another node they will send data in the connected nodes and do their thing. If they are not connected to anything then they will run and the workflow will then stop immediately.

I believe that this behavior of telegram trigger should be described in the documentation.

and

please, tell me, is this a bug or a feature?

Do not know what behavior you mean. If it does not work for you then it sounds more like a bug. Because it should work.

I wonder if there is maybe some confusion about testing a workflow and having it running in production. Are you aware of the difference or are you totally new to n8n?

Sorry for my bad english :upside_down_face:.
Case 1. I run command “n8n start --tunnel” in command shell. I adding cron trigger on this workflow, make a workflow active. In my cmd shell i see this:
ADD ID (active): 1
Case 2. I make a workflow (without cron trigger) active. In my command shell on server has nothing happens. In web-interface there are also have no error message at this moment.
From this cases, I conclude that the workflow with telegramm trigger does not become active when the switch “active” is active.
This is an error?

I’m totally newbie to n8n. :baby: In manual i see this:

Start with tunnel is only meant for local development and testing. It should not be used in production!

To be able to use webhooks for trigger nodes of external services like GitHub, n8n has to be reachable from the web.

My n8n has no reachable from the web. So I use the option “–tunnel”.
and this:

The types of Webhook URLs can be a test or production

In my telegram trigger type of Webhook URL is Production.

Just a short question. Now ignoring what the command-line says. Does the Telegram-Trigger nodes work? So does it display the data in the UI in development mode? And does it start the workflows fine when in production mode?

Yep, it’s work.

It display the data as in development mode and it display the data in production mode. I switch modes in this way: Telegram Trigger -> Parameters -> Webhook URLs -> switch “Display URL for…”. Is this a right way for change mode? :face_with_raised_eyebrow:

Ah no that is only to display the webhook URLs as they are different. So does actually not do anything except that. As n8n registers and deletes them on Telegram automatically you do not even have to worry about that at all.

A workflow runs in development mode if you press “Execute Workflow”. That uses the Test-Webhook and the information that gets received is visible in the UI. It also just stays active for exactly one call. Once it did receive it the webhook gets deleted.

A workflow runs in production mode when you set it active. Then the workflow registers the webhook at Telegram and does not remove it until you deactivate the workflow. For active workflows you do also not see any data in the UI at all. It runs in the background and does it’s thing.

OK, now I fully understand how one mode differs from the other (thx for excellent explanation).
In development mode telegram trigger is display the data. But it seems that the workflow does not switch to production mode if I don’t add cron trigger.

I created an empty workflow and added only a telegram trigger to it. I can’t run it in production mode. Watch this:
pastebin link for workflow

If it works in test mode it works to 99.99% also in production mode.

What do you expect in production mode?

Do you have a working bot? Does it send a response in test mode but does not answer in production mode?

Yes. The bot works great in test mode, sending a response to the request. In production, he does not send anything in response.
web-interface (workflows with telegram triggers in active):


console:
image
No Active Workflow is visible in console…

Even if it does not display anything in the console is the workflow active. If there would have been a problem activating the workflow (so registering the webhook with Telegram) it would display an error message in the UI and directly deactivate the workflow again.

Can honestly not think of a reason right now why it should work when testing but not in production.

Did just extra set up the whole Telegram stuff and tested. It works perfectly fine when testing and also in production. So can not explain why it would not work also for you. Sorry. Either both should work or both should not work. If you get a response in testing-mode you should also get a response when you activate the workflow.

I really wonder if there is still a misunderstanding how n8n works in general. Maybe it would be good to check out this basic tutorials to get a better understanding of n8n:

1 Like

Sorry, it’s my mistake :disappointed_relieved:, it really is. The workflow works great in production. The console is empty at the same time.

But when restarting the n8n service, the workflow does not work, since the bot does not respond to my messages (i was send 3 messages). At the same time, if I make the process not “active”, then “active” again, the bot will process all the messages that I sent. All 3 posts.

I think it has something to do with the webhook mechanism in the trigger.
I understand a Telegram-trigger works like this:

  1. when you click on the Active button, n8n sends a request like this:
    https://api.telegram.org/bot/setWebhook with your tunnel URL.
  2. Then the trigger processes requests.

However, in tunnel mode we are constantly changing tunnel URL. Now I stop the n8n server process (Ctrl+C on console) and start it again (n8n start --tunnel). But the active workflow does not send the setWebhook request. After the second process start, we check the getWebhookInfo method and see the old tunnel URL left over from the first service launch! So, when starting the n8n service with an active workflow (with a telegram trigger), n8n does not send a setWebhook request with a new tunnel URL!

Thanks a lot for looking into this. It seems like there is a bug in n8n right now which does not unregister the webhooks correctly anymore when n8n gets closed down. I will check it out.

Ok bug got fixed and released with [email protected] .

It will now always remove the old webhooks again correctly.

1 Like