DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to build a multi-step workflow that waits for approval with Mastra

Use Mastra's graph workflows and suspend and resume to pause for a person before continuing.

Short answer: Scaffold a project with npm create mastra@latest; then Define the steps and chain them with .then(), .branch() and .parallel(); add a suspend point before the sensitive step, following the suspend-and-resume docs. All steps.

Who it is forA product team automating a multi-step process where one step needs a human yes before it runs.

The problemAgent-only automations either run risky steps unchecked or need custom state handling to pause.

The outcomeA workflow built with then, branch and parallel that suspends, stores its state and resumes after approval.

What you need first

  • Node.js and npm
  • An API key for a provider such as OpenAI, Anthropic, Google or xAI
  • Optional: storage for suspend and resume and memory

Steps

  1. Scaffold a project with npm create mastra@latest
  2. Define the steps and chain them with .then(), .branch() and .parallel()
  3. Add a suspend point before the sensitive step, following the suspend-and-resume docs
  4. Configure storage so execution state is remembered while paused
  5. Resume the workflow when the user approves

Prompt for your agent

Using mastra-ai/mastra, build a workflow that <step 1>, then <step 2>, and suspends for my approval before <step 3>. Store its state so it can resume later, and test the full path in Mastra Studio.

Caveat. The README links to the docs for workflow code, so plan to follow the Workflows and suspend-and-resume pages.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for mastra-ai/mastra and "Build a multi-step workflow that waits for approval"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer