New: Decision Runtime — closed-set judgments for Agent OS. Read the guide →
HazelJS LogoHazelJS

Comparison

HazelJS vs Mastra

Mastra ships agents, typed workflows, memory, and evals. HazelJS Agent OS emphasizes packaging, governance, durable HITL, and Nest-familiar HTTP/DI in one backend.

Updated October 21, 2026

HazelJS vs Mastra

TL;DR

  • Mastra is an open-source TypeScript framework for agents and workflows: typed steps, memory, MCP, evals, Studio observability, HITL suspend/resume, and optional durable runners (e.g. Inngest; Temporal experimental).
  • HazelJS Agent OS is also TypeScript, but positions as an Agent OS: DNA packages, Skillgate, Gatekeeper, Decision Runtime, crash-safe HITL, and local-first hazeld / hazel apply inside a Nest-familiar DI/HTTP app.
  • Prefer Mastra when you want a dedicated TypeScript agent+workflow framework with Studio/evals and external durable runners.
  • Prefer HazelJS when agents must share one backend with REST/DI and you need DNA + Skillgate + Gatekeeper as the operating layer — clone Meridian.

Sources: Mastra agent framework, Mastra workflows, Mastra workflow runners, Agent lifecycle.

Who this is for

TypeScript teams shortlisting agent frameworks that already speak Node and workflows.

Capability matrix

CapabilityHazelJSMastra
LanguageTypeScriptTypeScript
Primary abstractionAgent OS (DNA + runtime + local CP)Agents + typed workflows
Agent runtimeAgentRuntime (@hazeljs/​agent)Mastra Agent loop
Workflow orchestrationAgentGraph, flow package, supervisorcreateWorkflow / steps / parallel / branch
Durable executionBuilt-in DurableRunStore + hazeldWorkflow persistence; Inngest/Temporal runners for production durability
GovernanceSkillgate curated skillsProcessors, tool approvals, evals
AuthorizationGatekeeper policiesTool approval / processors (model differs)
ObservabilityInspector timelines + OTelStudio traces, scorers, evals
DeploymentLocal-first apply; cloud optionalSelf-host or Mastra Platform
Multi-agentGraphs, supervisor, A2ASubagents / workflow composition
Human-in-the-loopDurable HumanTask + GatekeeperWorkflow suspend/resume + tool approvals
Production infrastructureSame DI app as HTTP APIsAgent server + workflow runners

Both are TypeScript. The architectural difference is category: Mastra is a strong agent/workflow framework; HazelJS markets and implements an Agent OS operating layer (packaging, govern, survive) beside HTTP.

When to choose which

Choose Mastra when Studio, evals, and workflow-runner integrations (Inngest, etc.) are central to how you ship agents.

Choose HazelJS when you want Agent DNA, Skillgate OpenAPI skills, Gatekeeper authorization, and durable HITL inside the same TypeScript backend as your APIs.

Related

FAQ

Are HazelJS and Mastra both TypeScript?
Yes. The difference is category: Mastra is a TypeScript agent/workflow framework; HazelJS positions as an Agent OS with DNA, Skillgate, Gatekeeper, and local hazeld apply.
How does Mastra handle durability?
Mastra workflows can persist and suspend; production durability often uses runners such as Inngest (Temporal support has been experimental). HazelJS builds durable runs into AgentRuntime + DurableRunStore.
When should I pick Mastra?
When Studio, evals/scorers, and workflow-runner integrations are central to how you build agents.
When should I pick HazelJS?
When agents must live beside production TypeScript APIs with DNA packaging and Gatekeeper authorization.