Execute Function to Receive Ping and Execute Workflow

The idea is:

This may not be the best way to do this, however this is a way I can figure to do this

I am looking for a way to, when a device powers on, run a workflow that is SSHing and running some basic check and repair commands

This could possibly work with a module that checks

On Ping From: [server IP address]
Of Ping Size: 56

My use case:

So, say, if my server sends a ping of size 56 to my N8N instance, execute a startup workflow, but if it sends a ping size of 57, that must mean one of my docker containers has started, so run a different workflow, but if send a ping of 56, execute a completely different workflow

That way, on system startup, I can set a command to ping my n8n instance once, which will execute the workflow I have which checks and repairs a few configuration issues that sometimes arise on startup, while still allowing other pings from the same device to do other tasks with the size variable

I think it would be beneficial to add this because:

This will make it really easy to remotely execute workflows from local devices. In my case, I am self hosting N8N and using it to automate updates, and fixes

With this, anyone could easily execute a workflow, like when a command is completed a ping can be sent, or when an application starts a ping can be sent, and with the packet size variable, a default packet size of 56 can be sent to execute a variable, but 57 can execute another, so can 55, and any other packet size, allowing this to be expandable

Are you willing to work on this?

Yes, though I have no idea where to even start xD

Loving N8N though, the easiest, most powerful tool I can find for my use case, and thank god I found this because Ansible makes me want to drive my head into a screw driver :slight_smile:

Hey @Reset,

Welcome to the community :cake:

Personally I dislike pings for anything but I can see why this would be useful, Have you thought about using webhooks though? While there is a bit more network overhead it would allow you to do a lot more like posting json data instead of using a packet size.

1 Like

Hey Jon!

Webhooks have scared the shit out of me xD

I’m not super affluent in Linux, I know my commands and desktop environments, how it works functionally, the file system, enough for custom partition layouts, raid setups, things of the sort, but web tech has never been something I understand well, especially when trying to do so on Linux

I’m not even sure where to start with webhooks, and was hoping it would be as simple as “attempt to send this message to this client”, but it seems WAY more convoluted than that, needing some whole other external service running on top of my proxmox to manage webhooks, where I was just looking for a simple way to let my N8N know my server booted and to run this task, as if that service fails on startup, my N8N will never run the startup workflows

I suppose I should do more research into Webhooks, then, if that is already the intended functionality

Also, watched the N8N tutorial on using Webhook node in N8N, is it en-eight-en or n-ate-n?

I’ve been saying N8N like n-ate-n

From a linux box you can just fire off the request with curl so you could do something in cron with @reboot or if using sysd maybe a unit file for network-online.target then execstart /usr/bin/curl.

So your n8n instance can have a webhook listening for something like online/:servername then you can do a /usr/bin/curl https://n8n.yourdomain.tld/webhooks/xxx-yyy-zzz/online/hostname and will then do a simple get request and you will be good to go (just given it a test from a Pi).

When it comes to how to pronounce n8n I have heard all sorts, I go for the en eight en approach.

1 Like