Live-Terminal output

Hi,
I want to use a n8n forms together with yt-dlp to automate it.

It consists of an form and some execute-command-nodes, all works fine.
The main concern I currently have, is that I cannot display any type of output during the command is being executed. As soon as the command returns, the node returns stdout, which is probably expected, however as yt-dlp commands sometimes take quite long, it would be nice, if I could display the actual stdout output live on the forms.

Are there any known workarounds for this?
Thanks!

1 Like

good day @CrazyWolf13
From what I know, that’s expected behavior, the Execute Command node returns output after the process finishes, not as a live stream. If I needed live progress, I’d run yt-dlp in the background and write status updates to a file or database, then have the form poll that status with another workflow. Another option I’d consider is a small service that streams stdout via WebSocket/SSE while n8n just triggers the job.

1 Like

Hi ,Thanks a lot for the suggestions.I have now proceeded with code, that just spawns the yt-dlp process and gives the process ID to a second flow via webhook, where the first flow is supposed to show custom html, that return the status, reported from the webhook.However I always see the following issue on my end on default firefox browser:Here my code:

  • It however seems like the webhook never gets called at all! As the forms is on the same domain, CORS should not be an issue, right?
    Do you have any idea why?
1 Like

Hi @CrazyWolf13
The workaround is fine, but return the JOBID instead of the process PID, because your log file is created as /tmp/ytjob_$JOBID.log while the polling URL is currently using $!, so the status webhook looks for the wrong file and likely fails before CORS even matters; please tag my @ in your reply so I can follow the updates.

1 Like

@tamy.santos Thank you so much!

With this help I was able to finish my flow, seems like I was already quite close :smiley:

2 Likes

happy to hear that! :blush: