Why is the $.respond() function not handling readable stream as stated in the documentation?

This topic was automatically generated from Slack. You can find the original thread here.

According to the documentation, $.respond() is supposed to be able to handle readable stream.
Well, sadly, the implementation seems broken, and the respond() wait for the entire stream to be cashed before executing despite saying in the body of the response “body_streamed:true”.

Here is my workflow:

And here is the related part of the documentation:
The value of the body property can be either a string, object, a Buffer
(opens new window)
(binary data), or a Readable stream
(opens new window)
. Attempting to return any other data may yield an error.
In the case where you return a Readable stream:
• You must await the $.respond function (await $.respond({ ... })
• The stream must close and be finished reading within your workflow execution timeout.
• You cannot return a Readable and use the immediate: true property of $.respond.
You can Copy this example workflow
(opens new window)
and make an HTTP request to its endpoint URL to experiment with this.

Well, sadly, the implementation seems broken, and the respond() wait for the entire stream to be cashed before executing despite saying in the body of the response “body_streamed:true”.
Hi , would you mind sharing:

  1. How to reproduce this?
  2. Your expected behavior?

1 - Step 3 of my code. Alternatively, you can create a stream using JS and the .respond() method.
2 - When using .respond() where the body is a Readable stream, the response should be sent as soon as possible. Right now, the response is sent only when the full stream has been received.

Also note that the link, for example, the workflow mentioned, is broken.

, I couldn’t access your workflow. If possible, could you create an issue here with step to reproduce steps?

Strange, my workspace is open for the support team.