@mastra/mcp-docs-server 1.0.0-beta.13 → 1.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +78 -78
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +173 -173
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +248 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +338 -338
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +139 -139
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +102 -102
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Freact.md +77 -70
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +218 -218
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +195 -195
- package/.docs/organized/changelogs/create-mastra.md +13 -13
- package/.docs/organized/changelogs/mastra.md +56 -56
- package/.docs/organized/code-examples/agent-v6.md +210 -0
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +10 -6
- package/.docs/raw/agents/agent-approval.mdx +5 -6
- package/.docs/raw/agents/agent-memory.mdx +22 -30
- package/.docs/raw/agents/guardrails.mdx +60 -50
- package/.docs/raw/agents/networks.mdx +8 -12
- package/.docs/raw/agents/overview.mdx +39 -23
- package/.docs/raw/agents/processors.mdx +20 -19
- package/.docs/raw/agents/structured-output.mdx +11 -7
- package/.docs/raw/agents/using-tools.mdx +4 -5
- package/.docs/raw/deployment/mastra-server.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -1
- package/.docs/raw/deployment/web-framework.mdx +4 -6
- package/.docs/raw/deployment/workflow-runners.mdx +14 -0
- package/.docs/raw/evals/custom-scorers.mdx +9 -6
- package/.docs/raw/evals/overview.mdx +3 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +30 -30
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
- package/.docs/raw/guides/deployment/amazon-ec2.mdx +9 -9
- package/.docs/raw/guides/deployment/aws-lambda.mdx +11 -11
- package/.docs/raw/guides/deployment/azure-app-services.mdx +2 -2
- package/.docs/raw/guides/deployment/cloudflare-deployer.mdx +5 -6
- package/.docs/raw/guides/deployment/digital-ocean.mdx +10 -10
- package/.docs/raw/guides/deployment/index.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +444 -0
- package/.docs/raw/guides/deployment/netlify-deployer.mdx +4 -4
- package/.docs/raw/guides/deployment/vercel-deployer.mdx +5 -6
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +7 -7
- package/.docs/raw/guides/getting-started/hono.mdx +18 -18
- package/.docs/raw/guides/getting-started/next-js.mdx +19 -20
- package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +21 -21
- package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
- package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
- package/.docs/raw/guides/guide/research-assistant.mdx +13 -13
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +8 -8
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +41 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/mastra-cloud/deployment.mdx +39 -0
- package/.docs/raw/mastra-cloud/observability.mdx +9 -15
- package/.docs/raw/mastra-cloud/overview.mdx +14 -44
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/mcp/overview.mdx +31 -13
- package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
- package/.docs/raw/memory/memory-processors.mdx +9 -9
- package/.docs/raw/memory/message-history.mdx +69 -0
- package/.docs/raw/memory/overview.mdx +34 -76
- package/.docs/raw/memory/semantic-recall.mdx +58 -49
- package/.docs/raw/memory/storage.mdx +188 -0
- package/.docs/raw/memory/working-memory.mdx +7 -7
- package/.docs/raw/observability/logging.mdx +9 -10
- package/.docs/raw/observability/overview.mdx +0 -1
- package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
- package/.docs/raw/observability/tracing/overview.mdx +23 -25
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/rag/chunking-and-embedding.mdx +6 -6
- package/.docs/raw/rag/graph-rag.mdx +7 -7
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +21 -22
- package/.docs/raw/rag/vector-databases.mdx +22 -22
- package/.docs/raw/reference/agents/agent.mdx +3 -3
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -2
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +2 -2
- package/.docs/raw/reference/agents/getLLM.mdx +2 -2
- package/.docs/raw/reference/agents/getMemory.mdx +2 -2
- package/.docs/raw/reference/agents/getModel.mdx +2 -2
- package/.docs/raw/reference/agents/getTools.mdx +2 -2
- package/.docs/raw/reference/agents/getVoice.mdx +2 -2
- package/.docs/raw/reference/agents/listAgents.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +2 -2
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/network-route.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +2 -2
- package/.docs/raw/reference/auth/auth0.mdx +1 -2
- package/.docs/raw/reference/auth/clerk.mdx +1 -2
- package/.docs/raw/reference/auth/firebase.mdx +2 -4
- package/.docs/raw/reference/auth/jwt.mdx +1 -2
- package/.docs/raw/reference/auth/supabase.mdx +1 -2
- package/.docs/raw/reference/auth/workos.mdx +1 -2
- package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
- package/.docs/raw/reference/cli/mastra.mdx +9 -9
- package/.docs/raw/reference/client-js/agents.mdx +1 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +1 -1
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
- package/.docs/raw/reference/core/getMemory.mdx +2 -2
- package/.docs/raw/reference/core/getServer.mdx +1 -1
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
- package/.docs/raw/reference/core/listMemory.mdx +2 -2
- package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +2 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
- package/.docs/raw/reference/memory/createThread.mdx +2 -2
- package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +3 -3
- package/.docs/raw/reference/memory/query.mdx +2 -2
- package/.docs/raw/reference/memory/recall.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +2 -2
- package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
- package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
- package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +40 -19
- package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +2 -2
- package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
- package/.docs/raw/reference/server/create-route.mdx +13 -13
- package/.docs/raw/reference/server/express-adapter.mdx +6 -7
- package/.docs/raw/reference/server/hono-adapter.mdx +6 -7
- package/.docs/raw/reference/server/mastra-server.mdx +20 -20
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +7 -5
- package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
- package/.docs/raw/reference/storage/convex.mdx +6 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
- package/.docs/raw/reference/storage/lance.mdx +6 -5
- package/.docs/raw/reference/storage/libsql.mdx +72 -54
- package/.docs/raw/reference/storage/mongodb.mdx +84 -9
- package/.docs/raw/reference/storage/mssql.mdx +8 -6
- package/.docs/raw/{memory → reference}/storage/overview.mdx +12 -110
- package/.docs/raw/reference/storage/postgresql.mdx +82 -9
- package/.docs/raw/reference/storage/upstash.mdx +74 -2
- package/.docs/raw/reference/streaming/agents/stream.mdx +5 -5
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
- package/.docs/raw/reference/templates/overview.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +1 -4
- package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
- package/.docs/raw/reference/vectors/astra.mdx +3 -3
- package/.docs/raw/reference/vectors/chroma.mdx +3 -3
- package/.docs/raw/reference/vectors/convex.mdx +12 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
- package/.docs/raw/reference/vectors/lance.mdx +4 -4
- package/.docs/raw/reference/vectors/libsql.mdx +61 -11
- package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
- package/.docs/raw/reference/vectors/pg.mdx +53 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
- package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
- package/.docs/raw/reference/vectors/upstash.mdx +55 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +6 -6
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow.mdx +3 -3
- package/.docs/raw/server/auth/auth0.mdx +20 -14
- package/.docs/raw/server/auth/clerk.mdx +16 -9
- package/.docs/raw/server/auth/firebase.mdx +21 -15
- package/.docs/raw/server/auth/jwt.mdx +14 -7
- package/.docs/raw/server/auth/supabase.mdx +16 -9
- package/.docs/raw/server/auth/workos.mdx +19 -13
- package/.docs/raw/server/custom-adapters.mdx +10 -10
- package/.docs/raw/server/custom-api-routes.mdx +2 -4
- package/.docs/raw/server/mastra-client.mdx +24 -13
- package/.docs/raw/server/mastra-server.mdx +3 -3
- package/.docs/raw/server/middleware.mdx +7 -7
- package/.docs/raw/server/request-context.mdx +31 -30
- package/.docs/raw/server/server-adapters.mdx +6 -6
- package/.docs/raw/streaming/events.mdx +14 -7
- package/.docs/raw/streaming/overview.mdx +21 -10
- package/.docs/raw/streaming/tool-streaming.mdx +6 -6
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
- package/.docs/raw/tools-mcp/overview.mdx +9 -10
- package/.docs/raw/voice/overview.mdx +2 -2
- package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
- package/.docs/raw/workflows/control-flow.mdx +27 -40
- package/.docs/raw/workflows/error-handling.mdx +15 -22
- package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
- package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
- package/.docs/raw/workflows/overview.mdx +34 -23
- package/.docs/raw/workflows/snapshots.mdx +16 -45
- package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
- package/.docs/raw/workflows/time-travel.mdx +16 -16
- package/.docs/raw/workflows/workflow-state.mdx +5 -8
- package/CHANGELOG.md +16 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/stdio.js +53 -0
- package/package.json +3 -3
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -102
- package/.docs/raw/memory/conversation-history.mdx +0 -24
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
|
@@ -8,23 +8,22 @@ description: "Learn how to deploy a Mastra application to Cloudflare using the M
|
|
|
8
8
|
The `CloudflareDeployer` class handles deployment of standalone Mastra applications to Cloudflare Workers. It manages configuration, deployment, and extends the base [Deployer](/reference/v1/deployer/) class with Cloudflare specific functionality.
|
|
9
9
|
|
|
10
10
|
:::warning
|
|
11
|
-
Cloudflare Workers do not support filesystem access. Remove any usage of [LibSQLStore](/
|
|
11
|
+
Cloudflare Workers do not support filesystem access. Remove any usage of [LibSQLStore](/reference/v1/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
12
12
|
:::
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
```bash
|
|
16
|
+
```bash
|
|
17
17
|
npm install @mastra/deployer-cloudflare@beta
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Usage example
|
|
21
21
|
|
|
22
|
-
```typescript title="src/mastra/index.ts"
|
|
22
|
+
```typescript title="src/mastra/index.ts"
|
|
23
23
|
import { Mastra } from "@mastra/core";
|
|
24
24
|
import { CloudflareDeployer } from "@mastra/deployer-cloudflare";
|
|
25
25
|
|
|
26
26
|
export const mastra = new Mastra({
|
|
27
|
-
// ...
|
|
28
27
|
deployer: new CloudflareDeployer({
|
|
29
28
|
projectName: "hello-mastra",
|
|
30
29
|
env: {
|
|
@@ -42,13 +41,13 @@ Manual deployments are also possible using the [Cloudflare Wrangler CLI](https:/
|
|
|
42
41
|
|
|
43
42
|
With the Wrangler CLI installed, login and authenticate with your Cloudflare logins:
|
|
44
43
|
|
|
45
|
-
```bash
|
|
44
|
+
```bash
|
|
46
45
|
npx wrangler login
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
Run the following to build and deploy your application to Cloudflare
|
|
50
49
|
|
|
51
|
-
```bash
|
|
50
|
+
```bash
|
|
52
51
|
npm run build && wrangler deploy --config .mastra/output/wrangler.json
|
|
53
52
|
```
|
|
54
53
|
|
|
@@ -98,7 +98,7 @@ Deployment
|
|
|
98
98
|
You can now access your deployed application at the URL provided by Digital Ocean.
|
|
99
99
|
|
|
100
100
|
:::warning
|
|
101
|
-
The Digital Ocean App Platform uses an ephemeral file system, meaning that any files written to the file system are short-lived and may be lost. Remove any usage of [LibSQLStore](/
|
|
101
|
+
The Digital Ocean App Platform uses an ephemeral file system, meaning that any files written to the file system are short-lived and may be lost. Remove any usage of [LibSQLStore](/reference/v1/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
102
102
|
:::
|
|
103
103
|
|
|
104
104
|
</TabItem>
|
|
@@ -131,7 +131,7 @@ Connect to your Droplet and clone your repository:
|
|
|
131
131
|
<Tabs>
|
|
132
132
|
<TabItem value="public" label="Public Repository">
|
|
133
133
|
|
|
134
|
-
```bash
|
|
134
|
+
```bash
|
|
135
135
|
git clone https://github.com/<your-username>/<your-repository>.git
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -139,7 +139,7 @@ git clone https://github.com/<your-username>/<your-repository>.git
|
|
|
139
139
|
|
|
140
140
|
<TabItem value="private" label="Private Repository">
|
|
141
141
|
|
|
142
|
-
```bash
|
|
142
|
+
```bash
|
|
143
143
|
git clone https://<your-username>:<your-personal-access-token>@github.com/<your-username>/<your-repository>.git
|
|
144
144
|
```
|
|
145
145
|
|
|
@@ -148,7 +148,7 @@ git clone https://<your-username>:<your-personal-access-token>@github.com/<your-
|
|
|
148
148
|
|
|
149
149
|
Navigate to the repository directory:
|
|
150
150
|
|
|
151
|
-
```bash
|
|
151
|
+
```bash
|
|
152
152
|
cd "<your-repository>"
|
|
153
153
|
```
|
|
154
154
|
|
|
@@ -158,7 +158,7 @@ cd "<your-repository>"
|
|
|
158
158
|
|
|
159
159
|
Install dependencies
|
|
160
160
|
|
|
161
|
-
```bash
|
|
161
|
+
```bash
|
|
162
162
|
npm install
|
|
163
163
|
```
|
|
164
164
|
|
|
@@ -170,13 +170,13 @@ Set up environment variables
|
|
|
170
170
|
|
|
171
171
|
Create a `.env` file and add your environment variables:
|
|
172
172
|
|
|
173
|
-
```bash
|
|
173
|
+
```bash
|
|
174
174
|
touch .env
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
Edit the `.env` file and add your environment variables:
|
|
178
178
|
|
|
179
|
-
```bash
|
|
179
|
+
```bash
|
|
180
180
|
OPENAI_API_KEY=<your-openai-api-key>
|
|
181
181
|
# Add other required environment variables
|
|
182
182
|
```
|
|
@@ -187,7 +187,7 @@ OPENAI_API_KEY=<your-openai-api-key>
|
|
|
187
187
|
|
|
188
188
|
Build the application
|
|
189
189
|
|
|
190
|
-
```bash
|
|
190
|
+
```bash
|
|
191
191
|
npm run build
|
|
192
192
|
```
|
|
193
193
|
|
|
@@ -197,7 +197,7 @@ npm run build
|
|
|
197
197
|
|
|
198
198
|
Run the application
|
|
199
199
|
|
|
200
|
-
```bash
|
|
200
|
+
```bash
|
|
201
201
|
node --env-file=".env" .mastra/output/index.mjs
|
|
202
202
|
```
|
|
203
203
|
|
|
@@ -219,7 +219,7 @@ You can now connect to your Mastra server from your client application using a `
|
|
|
219
219
|
|
|
220
220
|
Refer to the [`MastraClient` documentation](/docs/v1/server/mastra-client) for more information.
|
|
221
221
|
|
|
222
|
-
```typescript
|
|
222
|
+
```typescript
|
|
223
223
|
import { MastraClient } from "@mastra/client-js";
|
|
224
224
|
|
|
225
225
|
const mastraClient = new MastraClient({
|
|
@@ -28,5 +28,5 @@ Before deploying to a cloud provider, ensure you have:
|
|
|
28
28
|
- Basic familiarity with server setup (e.g. Nginx, environment variables)
|
|
29
29
|
|
|
30
30
|
:::warning
|
|
31
|
-
`LibSQLStore` writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like AWS Lambda, Netlify, Azure App Services, or Digital Ocean App Platform, you must remove all usage of [LibSQLStore](/
|
|
31
|
+
`LibSQLStore` writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like AWS Lambda, Netlify, Azure App Services, or Digital Ocean App Platform, you must remove all usage of [LibSQLStore](/reference/v1/storage/libsql) with file URLs. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
32
32
|
:::
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Inngest | Deployment"
|
|
3
|
+
description: "Deploy Mastra workflows with Inngest"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Inngest workflow
|
|
7
|
+
|
|
8
|
+
[Inngest](https://www.inngest.com/docs) is a developer platform for building and running background workflows, without managing infrastructure.
|
|
9
|
+
|
|
10
|
+
For a complete example with advanced flow control features, see the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest).
|
|
11
|
+
|
|
12
|
+
## How Inngest works with Mastra
|
|
13
|
+
|
|
14
|
+
Inngest and Mastra integrate by aligning their workflow models: Inngest organizes logic into functions composed of steps, and Mastra workflows defined using `createWorkflow()` and `createStep()` map directly onto this paradigm. Each Mastra workflow becomes an Inngest function with a unique identifier, and each step within the workflow maps to an Inngest step.
|
|
15
|
+
|
|
16
|
+
The `serve()` function bridges the two systems by registering Mastra workflows as Inngest functions and setting up the necessary event handlers for execution and monitoring.
|
|
17
|
+
|
|
18
|
+
When an event triggers a workflow, Inngest executes it step by step, memoizing each step's result. This means if a workflow is retried or resumed, completed steps are skipped, ensuring efficient and reliable execution. Control flow primitives in Mastra, such as loops, conditionals, and nested workflows are seamlessly translated into the same Inngest's function/step model, preserving advanced workflow features like composition, branching, and suspension.
|
|
19
|
+
|
|
20
|
+
Real-time monitoring, suspend/resume, and step-level observability are enabled via Inngest's publish-subscribe system and dashboard. As each step executes, its state and output are tracked using Mastra storage and can be resumed as needed.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
Install the required packages:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install @mastra/inngest@beta inngest @inngest/realtime
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Building an Inngest workflow
|
|
31
|
+
|
|
32
|
+
This guide walks through creating a workflow with Inngest and Mastra, demonstrating a counter application that increments a value until it reaches 10.
|
|
33
|
+
|
|
34
|
+
### Inngest initialization
|
|
35
|
+
|
|
36
|
+
Initialize the Inngest integration to obtain Mastra-compatible workflow helpers. The `createWorkflow()` and `createStep()` functions are used to create workflow and step objects that are compatible with Mastra and inngest.
|
|
37
|
+
|
|
38
|
+
In development:
|
|
39
|
+
|
|
40
|
+
```ts title="src/mastra/inngest/index.ts"
|
|
41
|
+
import { Inngest } from "inngest";
|
|
42
|
+
import { realtimeMiddleware } from "@inngest/realtime/middleware";
|
|
43
|
+
|
|
44
|
+
export const inngest = new Inngest({
|
|
45
|
+
id: "mastra",
|
|
46
|
+
baseUrl: "http://localhost:8288",
|
|
47
|
+
isDev: true,
|
|
48
|
+
middleware: [realtimeMiddleware()],
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
In production:
|
|
53
|
+
|
|
54
|
+
```ts title="src/mastra/inngest/index.ts"
|
|
55
|
+
import { Inngest } from "inngest";
|
|
56
|
+
import { realtimeMiddleware } from "@inngest/realtime/middleware";
|
|
57
|
+
|
|
58
|
+
export const inngest = new Inngest({
|
|
59
|
+
id: "mastra",
|
|
60
|
+
middleware: [realtimeMiddleware()],
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Creating steps
|
|
65
|
+
|
|
66
|
+
Define the individual steps that will compose your workflow:
|
|
67
|
+
|
|
68
|
+
```ts title="src/mastra/workflows/index.ts"
|
|
69
|
+
import { z } from "zod";
|
|
70
|
+
import { inngest } from "../inngest";
|
|
71
|
+
import { init } from "@mastra/inngest";
|
|
72
|
+
|
|
73
|
+
// Initialize Inngest with Mastra, pointing to your local Inngest server
|
|
74
|
+
const { createWorkflow, createStep } = init(inngest);
|
|
75
|
+
|
|
76
|
+
// Step: Increment the counter value
|
|
77
|
+
const incrementStep = createStep({
|
|
78
|
+
id: "increment",
|
|
79
|
+
inputSchema: z.object({
|
|
80
|
+
value: z.number(),
|
|
81
|
+
}),
|
|
82
|
+
outputSchema: z.object({
|
|
83
|
+
value: z.number(),
|
|
84
|
+
}),
|
|
85
|
+
execute: async ({ inputData }) => {
|
|
86
|
+
return { value: inputData.value + 1 };
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Creating the workflow
|
|
92
|
+
|
|
93
|
+
Compose the steps into a workflow using the `dountil` loop pattern. The `createWorkflow()` function creates a function on Inngest server that is invocable.
|
|
94
|
+
|
|
95
|
+
```ts title="src/mastra/workflows/index.ts"
|
|
96
|
+
// workflow that is registered as a function on inngest server
|
|
97
|
+
const workflow = createWorkflow({
|
|
98
|
+
id: "increment-workflow",
|
|
99
|
+
inputSchema: z.object({
|
|
100
|
+
value: z.number(),
|
|
101
|
+
}),
|
|
102
|
+
outputSchema: z.object({
|
|
103
|
+
value: z.number(),
|
|
104
|
+
}),
|
|
105
|
+
}).then(incrementStep);
|
|
106
|
+
|
|
107
|
+
workflow.commit();
|
|
108
|
+
|
|
109
|
+
export { workflow as incrementWorkflow };
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Configuring the Mastra instance
|
|
113
|
+
|
|
114
|
+
Register the workflow with Mastra and configure the Inngest API endpoint:
|
|
115
|
+
|
|
116
|
+
```ts title="src/mastra/index.ts"
|
|
117
|
+
import { Mastra } from "@mastra/core";
|
|
118
|
+
import { serve } from "@mastra/inngest";
|
|
119
|
+
import { incrementWorkflow } from "./workflows";
|
|
120
|
+
import { inngest } from "./inngest";
|
|
121
|
+
import { PinoLogger } from "@mastra/loggers";
|
|
122
|
+
|
|
123
|
+
export const mastra = new Mastra({
|
|
124
|
+
workflows: { incrementWorkflow },
|
|
125
|
+
server: {
|
|
126
|
+
host: "0.0.0.0",
|
|
127
|
+
apiRoutes: [
|
|
128
|
+
{
|
|
129
|
+
path: "/api/inngest",
|
|
130
|
+
method: "ALL",
|
|
131
|
+
createHandler: async ({ mastra }) => {
|
|
132
|
+
return serve({ mastra, inngest });
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
logger: new PinoLogger({ name: "Mastra", level: "info" }),
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Running workflows
|
|
142
|
+
|
|
143
|
+
### Running locally
|
|
144
|
+
|
|
145
|
+
1. Run `npx mastra dev` to start the Mastra server locally on port 4111
|
|
146
|
+
2. Start the Inngest Dev Server. In a new terminal, run:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
npx inngest-cli@latest dev -u http://localhost:4111/api/inngest
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
:::note
|
|
153
|
+
The URL after `-u` tells the Inngest dev server where to find your Mastra `/api/inngest` endpoint
|
|
154
|
+
:::
|
|
155
|
+
|
|
156
|
+
3. Open the Inngest Dashboard at [http://localhost:8288](http://localhost:8288) and go to the **Apps** section in the sidebar to verify your Mastra workflow is registered
|
|
157
|
+
|
|
158
|
+
4. Invoke the workflow by going to **Functions**, selecting your workflow, and clicking **Invoke** with the following input:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"data": {
|
|
163
|
+
"inputData": {
|
|
164
|
+
"value": 5
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
5. Monitor the workflow execution in the **Runs** tab to see step-by-step execution progress
|
|
171
|
+
|
|
172
|
+
### Running in production
|
|
173
|
+
|
|
174
|
+
Before you begin, make sure you have:
|
|
175
|
+
|
|
176
|
+
- Vercel account and Vercel CLI installed (`npm i -g vercel`)
|
|
177
|
+
- Inngest account
|
|
178
|
+
- Vercel token
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
1. Set your Vercel token in your environment:
|
|
182
|
+
|
|
183
|
+
```sh title=".env"
|
|
184
|
+
export VERCEL_TOKEN=your_vercel_token
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
2. Add `VercelDeployer` to Mastra instance
|
|
188
|
+
|
|
189
|
+
```ts title="src/mastra/index.ts"
|
|
190
|
+
import { VercelDeployer } from "@mastra/deployer-vercel";
|
|
191
|
+
|
|
192
|
+
export const mastra = new Mastra({
|
|
193
|
+
deployer: new VercelDeployer({
|
|
194
|
+
teamSlug: "your_team_slug",
|
|
195
|
+
projectName: "your_project_name",
|
|
196
|
+
// you can get your vercel token from the vercel dashboard by clicking on the user icon in the top right corner
|
|
197
|
+
// and then clicking on "Account Settings" and then clicking on "Tokens" on the left sidebar.
|
|
198
|
+
token: process.env.VERCEL_TOKEN,
|
|
199
|
+
}),
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
3. Build the mastra instance
|
|
205
|
+
|
|
206
|
+
```sh
|
|
207
|
+
npx mastra build
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
4. Deploy to Vercel
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
cd .mastra/output
|
|
214
|
+
vercel login
|
|
215
|
+
vercel --prod
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
5. Sync with the [Inngest dashboard](https://app.inngest.com/env/production/apps) by clicking **Sync new app with Vercel** and following the instructions
|
|
219
|
+
|
|
220
|
+
6. Invoke the workflow by going to **Functions**, selecting `workflow.increment-workflow`, clicking **All actions** > **Invoke**, and providing the following input:
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"data": {
|
|
225
|
+
"inputData": {
|
|
226
|
+
"value": 5
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
7. Monitor execution in the **Runs** tab to see step-by-step progress
|
|
233
|
+
|
|
234
|
+
## Adding custom Inngest functions
|
|
235
|
+
|
|
236
|
+
You can serve additional Inngest functions alongside your Mastra workflows by using the optional `functions` parameter in `serve()`.
|
|
237
|
+
|
|
238
|
+
### Creating custom functions
|
|
239
|
+
|
|
240
|
+
First, create your custom Inngest functions:
|
|
241
|
+
|
|
242
|
+
```ts title="src/inngest/custom-functions.ts"
|
|
243
|
+
import { inngest } from "../inngest";
|
|
244
|
+
|
|
245
|
+
// Define custom Inngest functions
|
|
246
|
+
export const customEmailFunction = inngest.createFunction(
|
|
247
|
+
{ id: "send-welcome-email" },
|
|
248
|
+
{ event: "user/registered" },
|
|
249
|
+
async ({ event }) => {
|
|
250
|
+
// Custom email logic here
|
|
251
|
+
console.log(`Sending welcome email to ${event.data.email}`);
|
|
252
|
+
return { status: "email_sent" };
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
export const customWebhookFunction = inngest.createFunction(
|
|
257
|
+
{ id: "process-webhook" },
|
|
258
|
+
{ event: "webhook/received" },
|
|
259
|
+
async ({ event }) => {
|
|
260
|
+
// Custom webhook processing
|
|
261
|
+
console.log(`Processing webhook: ${event.data.type}`);
|
|
262
|
+
return { processed: true };
|
|
263
|
+
},
|
|
264
|
+
);
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Serving custom functions with workflows
|
|
268
|
+
|
|
269
|
+
Update your Mastra configuration to import and include the custom functions. The highlighted lines show the additions:
|
|
270
|
+
|
|
271
|
+
```ts title="src/mastra/index.ts" {5-8,23}
|
|
272
|
+
import { Mastra } from "@mastra/core";
|
|
273
|
+
import { serve } from "@mastra/inngest";
|
|
274
|
+
import { incrementWorkflow } from "./workflows";
|
|
275
|
+
import { inngest } from "./inngest";
|
|
276
|
+
import {
|
|
277
|
+
customEmailFunction,
|
|
278
|
+
customWebhookFunction,
|
|
279
|
+
} from "./inngest/custom-functions";
|
|
280
|
+
import { PinoLogger } from "@mastra/loggers";
|
|
281
|
+
|
|
282
|
+
export const mastra = new Mastra({
|
|
283
|
+
workflows: { incrementWorkflow },
|
|
284
|
+
server: {
|
|
285
|
+
host: "0.0.0.0",
|
|
286
|
+
apiRoutes: [
|
|
287
|
+
{
|
|
288
|
+
path: "/api/inngest",
|
|
289
|
+
method: "ALL",
|
|
290
|
+
createHandler: async ({ mastra }) => {
|
|
291
|
+
return serve({
|
|
292
|
+
mastra,
|
|
293
|
+
inngest,
|
|
294
|
+
functions: [customEmailFunction, customWebhookFunction],
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
logger: new PinoLogger({ name: "Mastra", level: "info" }),
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Function registration
|
|
305
|
+
|
|
306
|
+
When you include custom functions:
|
|
307
|
+
|
|
308
|
+
1. Mastra workflows are automatically converted to Inngest functions with IDs like `workflow.${workflowId}`
|
|
309
|
+
2. Custom functions retain their specified IDs (e.g., `send-welcome-email`, `process-webhook`)
|
|
310
|
+
3. All functions are served together on the same `/api/inngest` endpoint
|
|
311
|
+
|
|
312
|
+
This allows you to combine Mastra's workflow orchestration with your existing Inngest functions.
|
|
313
|
+
|
|
314
|
+
## Flow control
|
|
315
|
+
|
|
316
|
+
Inngest workflows support flow control features including concurrency limits, rate limiting, throttling, debouncing, and priority queuing. These options are configured in the `createWorkflow()` call and help manage workflow execution at scale.
|
|
317
|
+
|
|
318
|
+
### Concurrency
|
|
319
|
+
|
|
320
|
+
Control how many workflow instances can run simultaneously:
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
const workflow = createWorkflow({
|
|
324
|
+
id: "user-processing-workflow",
|
|
325
|
+
inputSchema: z.object({ userId: z.string() }),
|
|
326
|
+
outputSchema: z.object({ result: z.string() }),
|
|
327
|
+
steps: [processUserStep],
|
|
328
|
+
// Limit to 10 concurrent executions, scoped by user ID
|
|
329
|
+
concurrency: {
|
|
330
|
+
limit: 10,
|
|
331
|
+
key: "event.data.userId",
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Rate limiting
|
|
337
|
+
|
|
338
|
+
Limit the number of workflow executions within a time period:
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
const workflow = createWorkflow({
|
|
342
|
+
id: "api-sync-workflow",
|
|
343
|
+
inputSchema: z.object({ endpoint: z.string() }),
|
|
344
|
+
outputSchema: z.object({ status: z.string() }),
|
|
345
|
+
steps: [apiSyncStep],
|
|
346
|
+
// Maximum 1000 executions per hour
|
|
347
|
+
rateLimit: {
|
|
348
|
+
period: "1h",
|
|
349
|
+
limit: 1000,
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Throttling
|
|
355
|
+
|
|
356
|
+
Ensure minimum time between workflow executions:
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
const workflow = createWorkflow({
|
|
360
|
+
id: "email-notification-workflow",
|
|
361
|
+
inputSchema: z.object({ organizationId: z.string(), message: z.string() }),
|
|
362
|
+
outputSchema: z.object({ sent: z.boolean() }),
|
|
363
|
+
steps: [sendEmailStep],
|
|
364
|
+
// Only one execution per 10 seconds per organization
|
|
365
|
+
throttle: {
|
|
366
|
+
period: "10s",
|
|
367
|
+
limit: 1,
|
|
368
|
+
key: "event.data.organizationId",
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Debouncing
|
|
374
|
+
|
|
375
|
+
Delay execution until no new events arrive within a time window:
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
const workflow = createWorkflow({
|
|
379
|
+
id: "search-index-workflow",
|
|
380
|
+
inputSchema: z.object({ documentId: z.string() }),
|
|
381
|
+
outputSchema: z.object({ indexed: z.boolean() }),
|
|
382
|
+
steps: [indexDocumentStep],
|
|
383
|
+
// Wait 5 seconds of no updates before indexing
|
|
384
|
+
debounce: {
|
|
385
|
+
period: "5s",
|
|
386
|
+
key: "event.data.documentId",
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Priority
|
|
392
|
+
|
|
393
|
+
Set execution priority for workflows:
|
|
394
|
+
|
|
395
|
+
```ts
|
|
396
|
+
const workflow = createWorkflow({
|
|
397
|
+
id: "order-processing-workflow",
|
|
398
|
+
inputSchema: z.object({
|
|
399
|
+
orderId: z.string(),
|
|
400
|
+
priority: z.number().optional(),
|
|
401
|
+
}),
|
|
402
|
+
outputSchema: z.object({ processed: z.boolean() }),
|
|
403
|
+
steps: [processOrderStep],
|
|
404
|
+
// Higher priority orders execute first
|
|
405
|
+
priority: {
|
|
406
|
+
run: "event.data.priority ?? 50",
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### Combining flow control options
|
|
412
|
+
|
|
413
|
+
Multiple flow control options can be combined in a single workflow:
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
const workflow = createWorkflow({
|
|
417
|
+
id: "comprehensive-workflow",
|
|
418
|
+
inputSchema: z.object({
|
|
419
|
+
userId: z.string(),
|
|
420
|
+
organizationId: z.string(),
|
|
421
|
+
priority: z.number().optional(),
|
|
422
|
+
}),
|
|
423
|
+
outputSchema: z.object({ result: z.string() }),
|
|
424
|
+
steps: [comprehensiveStep],
|
|
425
|
+
concurrency: {
|
|
426
|
+
limit: 5,
|
|
427
|
+
key: "event.data.userId",
|
|
428
|
+
},
|
|
429
|
+
rateLimit: {
|
|
430
|
+
period: "1m",
|
|
431
|
+
limit: 100,
|
|
432
|
+
},
|
|
433
|
+
throttle: {
|
|
434
|
+
period: "10s",
|
|
435
|
+
limit: 1,
|
|
436
|
+
key: "event.data.organizationId",
|
|
437
|
+
},
|
|
438
|
+
priority: {
|
|
439
|
+
run: "event.data.priority ?? 0",
|
|
440
|
+
},
|
|
441
|
+
});
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
All flow control options are optional. If not specified, workflows run with Inngest's default behavior. For more information, see the [Inngest flow control documentation](https://www.inngest.com/docs/guides/flow-control).
|
|
@@ -8,18 +8,18 @@ description: "Learn how to deploy a Mastra application to Netlify using the Mast
|
|
|
8
8
|
The `NetlifyDeployer` class handles deployment of standalone Mastra applications to Netlify. It manages configuration, deployment, and extends the base [Deployer](/reference/v1/deployer/) class with Netlify specific functionality.
|
|
9
9
|
|
|
10
10
|
:::warning
|
|
11
|
-
Netlify Functions use an ephemeral filesystem. Remove any usage of [LibSQLStore](/
|
|
11
|
+
Netlify Functions use an ephemeral filesystem. Remove any usage of [LibSQLStore](/reference/v1/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
12
12
|
:::
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
```bash
|
|
16
|
+
```bash
|
|
17
17
|
npm install @mastra/deployer-netlify@beta
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Usage example
|
|
21
21
|
|
|
22
|
-
```typescript title="src/mastra/index.ts"
|
|
22
|
+
```typescript title="src/mastra/index.ts"
|
|
23
23
|
import { Mastra } from "@mastra/core";
|
|
24
24
|
import { NetlifyDeployer } from "@mastra/deployer-netlify";
|
|
25
25
|
|
|
@@ -48,7 +48,7 @@ Your project is now configured with automatic deployments which occur whenever y
|
|
|
48
48
|
|
|
49
49
|
Manual deployments are also possible using the [Netlify CLI](https://docs.netlify.com/cli/get-started/). With the Netlify CLI installed run the following from your project root to deploy your application. You can also run `netlify dev` from your project root to test your Mastra application locally.
|
|
50
50
|
|
|
51
|
-
```bash
|
|
51
|
+
```bash
|
|
52
52
|
netlify deploy --prod
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -8,23 +8,22 @@ description: "Learn how to deploy a Mastra application to Vercel using the Mastr
|
|
|
8
8
|
The `VercelDeployer` class handles deployment of standalone Mastra applications to Vercel. It manages configuration, deployment, and extends the base [Deployer](/reference/v1/deployer/) class with Vercel specific functionality.
|
|
9
9
|
|
|
10
10
|
:::warning
|
|
11
|
-
Vercel Functions use an ephemeral filesystem. Remove any usage of [LibSQLStore](/
|
|
11
|
+
Vercel Functions use an ephemeral filesystem. Remove any usage of [LibSQLStore](/reference/v1/storage/libsql) with file URLs from your Mastra configuration. Use in-memory storage (`:memory:`) or external storage providers like Turso, PostgreSQL, or Upstash.
|
|
12
12
|
:::
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
```bash
|
|
16
|
+
```bash
|
|
17
17
|
npm install @mastra/deployer-vercel@beta
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Usage example
|
|
21
21
|
|
|
22
|
-
```typescript title="src/mastra/index.ts"
|
|
22
|
+
```typescript title="src/mastra/index.ts"
|
|
23
23
|
import { Mastra } from "@mastra/core";
|
|
24
24
|
import { VercelDeployer } from "@mastra/deployer-vercel";
|
|
25
25
|
|
|
26
26
|
export const mastra = new Mastra({
|
|
27
|
-
// ...
|
|
28
27
|
deployer: new VercelDeployer(),
|
|
29
28
|
});
|
|
30
29
|
```
|
|
@@ -41,7 +40,7 @@ The Vercel deployer can write a few high‑value settings into the Vercel Output
|
|
|
41
40
|
|
|
42
41
|
Example:
|
|
43
42
|
|
|
44
|
-
```ts title="src/mastra/index.ts"
|
|
43
|
+
```ts title="src/mastra/index.ts"
|
|
45
44
|
deployer: new VercelDeployer({
|
|
46
45
|
maxDuration: 600,
|
|
47
46
|
memory: 1536,
|
|
@@ -67,7 +66,7 @@ Your project is now configured with automatic deployments which occur whenever y
|
|
|
67
66
|
|
|
68
67
|
Manual deployments are also possible using the [Vercel CLI](https://vercel.com/docs/cli). With the Vercel CLI installed run the following from your project root to deploy your application.
|
|
69
68
|
|
|
70
|
-
```bash
|
|
69
|
+
```bash
|
|
71
70
|
npm run build && vercel --prod --prebuilt --archive=tgz
|
|
72
71
|
```
|
|
73
72
|
|