I am invoking a PowerShell script using the 'Execute Command' node. The script runs, but the node keeps running without stopping


In my workflow, I execute a PowerShell script using the ‘Execute Command’ node with the command ‘PowerShell.exe -command C:\script…\script.ps1’. Upon execution of the node, the script is correctly called and runs as expected. However, after the script finishes, the node continues to run without stopping. I am required to manually stop it.

The script works correctly when I execute it outside of n8n. The n8n interface is on the same server as the script. I do not receive any error messages.

The version of n8n is: 1.9.3.

The workflow was functioning perfectly before the addition of this node, and it has no direct impact on the rest of the workflow.

Thank you in advance for your assistance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @jean1999,

Welcome to the community :cake:

When you run the powershell script manually does it just exit or does it wait for some kind of interaction?

Thank you for your response! No, it closes automatically, it doesn’t wait for any instruction.

I wonder if powershell needs an extra flag because of how it is being run. Have you tried the powershell community node?

I’m sorry, I’m new to using n8n, but I don’t see a ‘Powershell’ node. Are you suggesting to run the PowerShell script through the ‘Code’ node? Because I only see JavaScript and Python for that node.

Hey @jean1999,

It was more of a suggestion to use @starfallprojects/n8n-nodes-powershell - npm which should do the job.