•
By Paul Scanlon Introducing Background Tasks for Mastra Agents
Your agents can now respond before, during, and after long-running tool calls without blocking the agentic loop.
Background tasks are a new configuration option that allows tools to run asynchronously, letting you stream progress back to the user while the tool works in the background.
Background tasks also support parallel tool calling. When an agent calls multiple background-enabled tools, each one runs concurrently.
Enable background tasks on your Mastra instance. Requires @mastra/core@1.29.0 or later, added in PR #12557. A storage provider is required to persist state, allowing tasks to resume and survive server restarts.
Configure a tool with backgroundTasks: { enabled: true } to run it in the background.