Streaming Workflow Run in Chat

Hey- I am still a little confused how I can stream a workflow with in a chat when my agent triggers is. I have looked into AI SDK and Copilot kit. As I see it rn, both those platofrms have their version of a useChat hook which connects an agent to the frontend. They provide hooks for rendering uis when tools are called wtc. In mastra I have an agent with 2 workflows attached to it, and my end goal is that I want to be able to trigger a workflow, have the user accept the workflow, then stream teh workflow progress within the chat as a ui, and then produce an output that can be iterated on. I have a useWorkflowExecution hook that I ahve made to handle workflow streaming when ran in isolation, but I am still struggling how to run workflows properly within chat. Are there any working examples of this?
Was this page helpful?