How to wire agent.generate() with workflow suspend() in-chat approvals?
AgentMemory
Hey everyone looking for some feedback on our Mastra setup
We’re building an internal chat support agent where an operator types something like:
update field X to value Y on record 123
What we want:
• Agent understands intent and routes to the right domain • If something’s missing, it asks follow-up questions in chat • Once it has everything, it triggers a Mastra workflow • If the workflow suspend()s (for approval), the agent shows the changes in chat • Operator types approve / decline → agent resumes the workflow • Workflow finishes → result is posted back in chat
Basically: one conversational agent that both gathers data and executes workflows — fully inside chat.
Things we’re unsure about:
Workflow + agent.generate() If a workflow suspends mid-run: Does the agent receive the suspend payload and reason about it? Or does generate() block until completion?
Resume pattern After a suspend, the next user message should resume the workflow. Should we store runId + stepId and expose a resumeWorkflow tool? Or is there a more native Mastra pattern for this?
Router → domain agents (~10 domains) - What’s the cleanest approach? - Flatten all tools into one big agent? -Agent-as-tool pattern? -Native handoff/delegation?
Multiple suspends Our workflows suspend twice (review → confirm). Does Mastra handle multi-suspend conversational flows cleanly, or do we need to orchestrate state ourselves?
Long conversations (10+ turns) Is basic Mastra Memory (lastMessages: N) enough, or is there a better pattern for durable workflow-driven chats?
If anyone has implemented agent + workflow + suspend/resume fully inside chat, would really appreciate guidance