N8N Container restart notification

Thought I’d share my workflow for informing me when my self-hosted N8N instance is restarted (either on upgrade or because of some issue) it’s really simple, maybe too simple tbh It uses the n8n instance trigger ( thanks to @jon for pointing this out) and just looks to see if the tini process has been restarted in the last 5 minutes again this might be overkill.
You can swap out the slack for any notification platform you like.

Any comments welcome.

Note: Only useful for self hosted-containers n8n releases
Customise: Customise the SetConfig node for modifications of SetMessage for the text that will be displayed, you can remove the GetHostName node it just ssh’s to the docker server to get the hostname.

3 Likes

Hey @0101binary0101,

Did you try the n8n Trigger which will run when an instance is started?

image

Might not give as much control if you are doing other things but could make life a little bit easier.

1 Like

Oh that’s interesting :see_no_evil:

I was wondering if that’d get invoked depending on the style of n8n instance running e.g. ‘own’ and ‘main’ … The ‘tini’ process was the only thing I could be certain would indicate a start of the container.

@Jon - I’ve updated the original posting workflow to use the trigger rather than the scheduled check. It’s a worthy change and stops the workflow from over checking the tini process.

There also was an issue with the SetMessage that somehow had a bad reference to the N8N instance ‘friendly’ name.

Thank you for pointing out that modification.

1 Like