Its possible execute remote script Windows from Linux (n8n)

0.- Start n8n in Server1

1.- Create node “Run execution” scriptLinux —>ok

2.- Create node “?” remote Server2 execution script Windows —>???


Many thanks

1 Like

Welcome to the community @rccclr!

Yes was thinking about something similar from the beginning.
To have some kind of program which would allow machines to connect to n8n and then act as a kind of worker. They could communicate via Websocket and would allow n8n to execute workflows or random commands on those machines. Sadly however was it not a priority yet so had no time to think about a proper architecture or work on the implementation yet.

1 Like

Hey @rccclr
I believe what you are looking to do is remotely manage windows devices from n8n! Neat idea!

Remote windows management is handled by a framework called Windows Management Instrumentation (or WMI) and has been around for quite some time. It is very easy to use, extensible, and very well documented.

Unfortunately, the bridge between NodeJS and WMI (node-wmi) does not look like it has been updated in years and only implements the Query option of WMI.

I like @jan’s idea of having a helper app on the windows system (maybe a mini-webhook only, no GUI version of n8n) to receive the command and execute the script.

1 Like

Thanks for your information.

I pending testing this:

I think a version for node:

Congratulations for your product!!

I have similar use case (Converting Email, Excel etc to PDF using MS Office - tried all free linux based version - nothing works better than MS Office Save to PDF for formatting), what I have done is relatively simple, take n8n as is, and just make a webhook where I have a Console App (with Excel Interop) that just loop (every 3s) and access the n8n http request to get an item to be converted to PDF, and once done post back the result to n8n.

in short:

  1. Webhook to get document to be converted to PDF (in your case script to be run)
  2. Windows VM with C#.Net Console App that set to connect to (1) every 3s to find document to be converted to PDF (in your case to find script to be run - and run the script in windows)
  3. Once completed post the PDF back to n8n (in your case letting your n8n know that the script completed)
    you will need a database to handle and store the “state” and status of the work for (1) and (3)

in this case I am using n8n as a kind of message bus