M
Mastraโ€ข4w ago
Sebastian

Streaming from a workflow step when using Inngest

I'm currently struggling with streaming an agent response from a workflow when running it through the Inngest Dev Server. For the Mastra workflow I'm using the workflowRoute with patched streaming support as described in this post. This works fine when using Mastra standalone and consuming it with AI-SDK on the frontend. But when I run it through Inngest, I get an error inside @mastra/inngest:
The "transform.writable" property must be an instance of WritableStream. Received undefined
The "transform.writable" property must be an instance of WritableStream. Received undefined
I found an option on the inngestServe function that I tried:
{
path: "/api/inngest",
method: "ALL",
createHandler: async ({ mastra }) => inngestServe({ mastra, inngest, registerOptions: {
streaming: "force"
}}),
},
{
path: "/api/inngest",
method: "ALL",
createHandler: async ({ mastra }) => inngestServe({ mastra, inngest, registerOptions: {
streaming: "force"
}}),
},
Unfortunately this didn't resolve the issue. I know this scenario could be considered hacky because of the patch I linked above. But I was just curious if there are any working examples for this use case and whether or not this will be supported at some point. Thanks in advance for any help!
5 Replies
Mastra Triager
Mastra Triagerโ€ข4w ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10216 ๐Ÿ” If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly. ๐Ÿ™ Thank you @Sebastian for helping us improve Mastra!
_roamin_
_roamin_โ€ข4w ago
Hey @Sebastian ! That looks like an oversight to be honest, we haven't done many updates to the Inngest integration since we shipped our new streaming features. You can follow the above GH issue for updates ๐Ÿ˜‰
Ward
Wardโ€ข3w ago
@Sebastian if you use writer.custom, it already works but in our next release we will grep all data chunks ourselves. https://github.com/mastra-ai/mastra/pull/10447
GitHub
fix/workflow step output data chunks by TheIsrael1 ยท Pull Request ...
fix(ai-sdk): propagate custom data chunks from nested workflows in branches to root stream changeset Description Fixes #10260 Fixes #10433 Related Issue(s) Type of Change Bug fix (non-breaking...
Ward
Wardโ€ข2w ago
@Sebastian we fixed this in latest beta. I don't believe we can backport this change easily @rase-
Sebastian
SebastianOPโ€ข2w ago
@Ward thanks for the info. I'll try to give the beta another spin next week.

Did you find this page helpful?