Mastra projects

Deploy an existing Mastra application on Constal without changing its framework imports or orchestration code.

Constal hosts an existing Mastra project as an immutable, governed deployment. Your application continues to import @mastra/core, provider packages, Tools, workflows, networks, storage types, middleware, and clients normally. You do not replace those imports with @constal/sdk, add a Constal manifest, or translate the application into another graph format.

sh
npm install -g @constal/cli
printf '%s' "$CONSTAL_API_KEY" | constal auth login --token-stdin
constal deploy .

What gets deployed

Constal detects the exported Mastra instance, runs the installed Mastra build through the Constal deployer, and publishes one immutable Worker artifact. Each registered Agent, workflow, legacy network, and vNext network becomes an addressable Constal Agent entry. If the project starts an Express or Node HTTP server, the same deployment also publishes a server Agent and a Channel that targets it.

The deployment does not add another scheduler or storage service. Mastra behavior executes inside ordinary customer-scoped Sessions and Runs. Model calls, external Tools, Credentials, cost, and approvals use the existing Constal Resource and code-Policy boundaries.

Choose a guide

GoalGuide
Deploy a repository or local projectDeploy a Mastra project
Understand the runtime mappingHow Mastra maps to Constal
Check versions, features, limits, and failuresMastra compatibility and operations
Configure model or service authorityGateways and Models
Give each customer different ResourcesScoped bindings

Existing clients remain valid

Point @mastra/client-js at the deployed Agent compatibility URL and keep its Agent, workflow, memory, Tool, vector, scorer, MCP, voice, and streaming calls:

ts
import { MastraClient } from "@mastra/client-js";

const client = new MastraClient({
  baseUrl: "https://platform.constal.ai/v1/namespaces/production/agents/support/mastra",
  headers: { authorization: `Bearer ${process.env.CONSTAL_API_KEY}` },
  retries: 0,
});

const result = await client.getAgent("support").generate("Resolve ticket 42");

Provider retries remain disabled at this boundary because Constal recovers the settled operation from the Run journal instead of asking the provider to repeat a paid or externally visible effect.

Next steps

Start with the deployment tutorial, then review runtime mapping before attaching customer Credentials or external services.