# Sypnia Run documentation > Sypnia Run puts your code on the internet: static sites, server-rendered apps, containers, functions, scheduled jobs and queues. You push to Git or run one command; Run builds it, gives it an address and keeps every deploy so you can go back in one step. Every page of the documentation follows, in reading order. Each one starts with its title and its address. --- ## Start here > What Sypnia Run is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/ For agents: Section index for Sypnia Run: deploys static sites, server-rendered apps (Next.js via OpenNext, Astro, SvelteKit…), containers, functions, cron jobs and queues on AWS, from Git or the CLI, with previews per pull request, instant rollbacks, secrets, custom domains, and logs and traces into Sypnia Telemetry. Open-source engine in your AWS account, or Sypnia Cloud. Sypnia Run takes your code and puts it on the internet: a static site, a server-rendered app, a container, a function, a scheduled job or a queue worker. You push to Git or run one command; Run builds it, gives it an address with HTTPS, and keeps every deploy so going back is one step. > **Note: Sypnia uses it** > > sypnia.com and every Sypnia product site run on Sypnia Run, with their names in Sypnia Domains. There are two ways to run it, and every page says which one it is about: - **\[Engine]** **The Sypnia Run engine** is open source. You install it in **your own AWS account**, and it deploys your apps there. - **\[Cloud]** **Sypnia Cloud** runs the same engine for you: builds on our machines, a free `.sypnia.app` address, the console, and billing in credits. * [What Sypnia Run is](/start/what-it-is/): Hosting for every kind of code your app has, on AWS, deployed from Git or one command. * [How it works](/start/how-it-works/): From a git push to a request served by your app, step by step. * [Open source and Sypnia Cloud](/start/open-source-and-cloud/): Exactly what the open-source engine does in your AWS account, and what Sypnia Cloud adds. * [Quickstart: Sypnia Cloud](/start/quickstart-cloud/): Deploy an app to Sypnia Cloud, open it at its address, ship a change and roll it back. * [Quickstart: your AWS account](/start/quickstart-self-host/): Install the Run engine in your AWS account and deploy an app with it. * [How Sypnia uses it](/start/how-sypnia-uses-it/): Every Sypnia product runs on Sypnia Run, and Telemetry, the pilot, shows how. --- ## What Sypnia Run is > Hosting for every kind of code your app has, on AWS, deployed from Git or one command. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/what-it-is/ For agents: What Sypnia Run is: static sites (S3+CloudFront), SSR apps (Next.js/Astro/SvelteKit/Nuxt on Lambda via OpenNext-style adapters), containers (Fargate or Lambda container images), functions (Lambda), cron (EventBridge Scheduler), queues (SQS+Lambda). Immutable deploys, previews per PR, secrets, free .sypnia.app in Cloud, logs/traces to Sypnia Telemetry, use cases run from the Cases map (services per area, starts → routes/endpoints/schedules/subscriptions, outbox), use-case diff per deploy. Not a database, not file storage, not Kubernetes, AWS only. Sypnia Run is where your app runs. It is to your code what AWS is to infrastructure, without having to learn AWS: you say what your app is, and Run decides which AWS services to use, builds it, deploys it and keeps it running. > **In plain words** > > You have a website or an app on your computer. Run puts it online at an address anyone can open, safely, and every time you change something it puts the new version online without breaking the old one until the new one works. ### What it runs | Kind | For | Runs on | | ----------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Static site** | Landing pages, docs, single-page apps (Vite, Astro static) | Amazon S3 behind Amazon CloudFront | | **Server-rendered app** | Next.js, Astro SSR, SvelteKit, Nuxt, React Router | AWS Lambda behind CloudFront | | **Container** | Anything with a `Dockerfile`: Node, Python, Go, Rust, Java | a Lambda container image by default, or AWS Fargate when the app asks for an always-on container ([Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers)) | | **Function** | One HTTP endpoint, a webhook, a small API | AWS Lambda | | **Scheduled job** | «Every day at 7:00», reports, clean-ups | Amazon EventBridge Scheduler | | **Queue worker** | Background work: e-mails, thumbnails, imports | Amazon SQS and Lambda | One app can mix them: La Espiga's web is a Next.js app, it has a function that receives payment webhooks, a job that closes the day at 21:00 and a queue that prints kitchen tickets. ### What you get with every app - **An address with HTTPS** from the first deploy: `https://.sypnia.app` in Sypnia Cloud, or your own domain. - **Every deploy kept.** A deploy never changes after it is made. Production points to one of them; going back is moving that pointer. - **Previews.** Each pull request gets its own address, with its own variables, so you can try a change before it reaches production. - **Secrets in one place.** Values are encrypted and reach your code at run time, never the build logs. - **Logs and traces** sent to [Sypnia Telemetry](https://telemetry.sypnia.com) when you want them, tagged with the deploy, so you see which deploy made something slower. - **Use cases that run.** If your app has a map in [Sypnia Cases](https://cases.docs.sypnia.com/), Run runs its cases: the cases of each area as one service, each start as a route, an endpoint, a schedule or a subscription, and each outcome to whoever listens, through an outbox that never loses one ([Use cases](https://run.docs.sypnia.com/cases)). Each deploy shows which cases it changed. ### Who it is for - **Someone building their first app.** You never open the AWS console. A coding agent can do every step through the API and MCP. - **Developers who know AWS.** Everything Run creates is a normal AWS resource you can see, with a CloudFormation stack per app in self-hosting. - **Teams on Vercel, Netlify, Render or Heroku** who want one bill with their database, files, e-mail and domains, and an open-source path to their own AWS account. ### What it is not - **Not a database.** Use [Sypnia Data](https://data.sypnia.com) or any Postgres; Run gives your app its connection string as a secret. - **Not file storage.** Uploads go to [Sypnia Files](https://files.sypnia.com). - **Not Kubernetes.** Containers run on Fargate or Lambda, one service per app, without a cluster to manage. - **Not a multi-cloud tool.** Run deploys to AWS only. --- ## How it works > From a git push to a request served by your app, step by step. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/how-it-works/ For agents: How Sypnia Run works: build (isolated machine, framework detection, artifacts) → deploy (immutable version with its own address --dpl-.sypnia.app) → release (environment pointer switched at the edge; rollback = move back) → serve (CloudFront → S3 / Lambda / Fargate; logs; traces to Telemetry). Optional [run] table in the project's sypnia.toml. Open source: @sypnia/run CLI and engine; private: console. Every app goes through the same four moves: **build**, **deploy**, **release**, **serve**. Knowing them explains everything else in these docs. #### 1. Build Run takes your code (a Git commit, or a folder uploaded by the CLI) and builds it in a clean, isolated machine. It detects the framework, installs dependencies with your lockfile, runs your build command and produces **artifacts**: static files, function bundles or a container image. Nothing from another build or another customer is on that machine. **You should see:**A build has an id like `bld_8k2…`, its logs, and the artifacts it produced, or the error that stopped it. #### 2. Deploy The artifacts become a **deploy**: an immutable version of your app with its own address, its configuration snapshot and the AWS resources it needs (a Lambda version, a container image digest, a set of files under its own prefix). A deploy is never edited; a change makes a new deploy. **You should see:**The deploy answers at its own address, `https://--dpl-.sypnia.app`, before anyone else sees it. #### 3. Release An **environment** (production, a preview, or one you name, like staging) points to one deploy. Releasing moves that pointer, in one step, at the edge: the old deploy keeps serving until the switch, and requests already in flight finish where they started. A rollback is the same move backwards. #### 4. Serve Requests reach Amazon CloudFront, which sends static files from S3 and dynamic requests to the deploy's function or container. Logs go to the log store, and, when you connect it, traces go to Sypnia Telemetry with the deploy id on them. ### What you write Most apps need nothing: Run reads `package.json`, the framework's config or a `Dockerfile`. When you want to be explicit, you add a `[run]` table to `sypnia.toml`, the one configuration file every Sypnia product reads at the root of your repository: `sypnia.toml` ```toml format = 1 project = "la-espiga" [run.apps.laespiga] kind = "ssr" framework = "nextjs" build = { command = "pnpm build", node = "22" } [run.apps.laespiga.functions.pay] file = "functions/pay.ts" path = "/api/pay" memory = 512 [run.apps.laespiga.jobs.close-day] schedule = "0 21 * * *" timezone = "America/Bogota" run = "jobs/close-day.ts" [run.apps.laespiga.queues.kitchen] consumer = "workers/kitchen.ts" retries = 5 ``` [The configuration file](https://run.docs.sypnia.com/config/run-file) lists every field. ### Who does what | Part | Runs in | Open source | | ----------------------------------------------------- | ----------------------------------------------------------- | ----------- | | `@sypnia/run`: the CLI, the framework adapters | your machine or CI | yes | | The Run engine: the API, the builder and the deployer | your AWS account **\[Engine]** or Sypnia Cloud **\[Cloud]** | yes | | The console at `run.app.sypnia.com` | Sypnia Cloud | no | | Your app | AWS: S3, CloudFront, Lambda, Fargate, EventBridge, SQS | it is yours | --- ## Open source and Sypnia Cloud > Exactly what the open-source engine does in your AWS account, and what Sypnia Cloud adds. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/open-source-and-cloud/ For agents: Engine vs Sypnia Cloud for Run: engine runs apps in your AWS account (you pay AWS, builds local or CodeBuild, no free address, no console); Cloud runs in Sypnia accounts isolated per project, builds on Sypnia machines, free .sypnia.app, console, prepaid credits. Same config, API, CLI and MCP; moving = install engine, point CLI, deploy. The engine and Sypnia Cloud deploy your app the same way: same config file, same CLI, same API. The difference is **whose AWS account** your app lives in, who runs the builds, and who you pay. | | Engine **\[Engine]** | Sypnia Cloud **\[Cloud]** | | ------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------- | | Where your app runs | your AWS account | Sypnia's AWS accounts, isolated per project | | Who pays AWS | you, directly | Sypnia; you pay in prepaid credits | | Builds | on your machine (`--local`) or in AWS CodeBuild in your account | on Sypnia's build machines | | Free address | none; you use your domains | `https://.sypnia.app` | | Custom domains | yours, through Route 53 or any DNS | through [Sypnia Domains](https://domains.sypnia.com) or any DNS | | Console | none; the API, the CLI and MCP | `run.app.sypnia.com` | | Logs and traces | CloudWatch Logs in your account, and Sypnia Telemetry if you connect it | the same, plus the log view in the console | | Sign-in | IAM in your account, and API keys of your engine | your Sypnia account, one session across products | | License | open source: the engine under AGPL-3.0, `@sypnia/run` under MIT | a hosted service | ### What stays the same - The configuration file and the framework adapters (`@sypnia/run`). - The API (`/v1`), the CLI commands and the MCP tools. A script that deploys to Sypnia Cloud deploys to your engine by changing the base URL. - Immutable deploys, environments, previews, rollbacks, jobs and queues. ### Moving between them Your app is a set of build artifacts and a config file. To move from Sypnia Cloud to your account, install the engine, point the CLI at it and deploy; secrets are exported per environment with `run env pull`. Nothing in your code mentions where it runs. --- ## Quickstart: Sypnia Cloud > Deploy an app to Sypnia Cloud, open it at its address, ship a change and roll it back. Applies to: Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/quickstart-cloud/ For agents: Quickstart Sypnia Cloud for Run: npx @sypnia/run login (device flow) → npx @sypnia/run deploy (writes the app's [run.apps.] table in sypnia.toml, prints https://.sypnia.app) → run env set NAME --secret --env production → deploy again → run deploys → run rollback. At the end you will have an app online at `https://.sypnia.app`, a second deploy, and a rollback. #### 1. Sign in The CLI opens a browser for you to approve; the session stays on your machine. ```bash npx @sypnia/run login ``` **You should see:**`Signed in as ana@example.com (organization: La Espiga)`. #### 2. Deploy the folder From your app's root folder: ```bash npx @sypnia/run deploy ``` The first time it asks for the app's name and which project of your organization it belongs to, and writes them to `sypnia.toml` at the root of the repository: `project` and the app's `[run.apps.]` table. **You should see:**The build logs stream in your terminal and end with `Production: https://laespiga.sypnia.app`. #### 3. Add a secret ```bash npx @sypnia/run env set DATABASE_URL --secret --env production ``` The value is asked without echo and stored encrypted. The next deploy gets it at run time. #### 4. Ship a change Change something and deploy again. Production moves to the new deploy when its build finishes and its health check passes. ```bash npx @sypnia/run deploy npx @sypnia/run deploys ``` **You should see:**Two deploys, the newest marked `production`. #### 5. Roll back ```bash npx @sypnia/run rollback ``` **You should see:**Production points to the previous deploy in seconds. Nothing is rebuilt. ### Next - [Deploy from Git](https://run.docs.sypnia.com/deploys/from-git) so every push to `main` deploys and every pull request gets a preview. - [Connect your domain](https://run.docs.sypnia.com/config/addresses-and-domains). - [Send logs and traces to Sypnia Telemetry](https://run.docs.sypnia.com/observe/telemetry-and-use-cases). --- ## Quickstart: your AWS account > Install the Run engine in your AWS account and deploy an app with it. Applies to: the Sypnia engine (open source, self-hosted). Source: https://run.docs.sypnia.com/start/quickstart-self-host/ For agents: Self-host quickstart for Run: npx @sypnia/run engine install --region us-east-1 (CloudFormation stack sypnia-run: API, deployer, CodeBuild project, artifacts bucket, edge router; admin key saved in ~/.config/sypnia/run-engine.json mode 600) → run use → run deploy --local (or CodeBuild) → run domains add (ACM certificate, Route 53 records if same account). At the end the Run engine runs in your AWS account and your app is deployed there, at a CloudFront address. > **Warning** > > The engine creates resources that AWS bills to you: CloudFront distributions, Lambda functions, an S3 bucket and, if an app asks for an always-on container, Fargate tasks. A static site and a small function cost cents per month; always-on containers run all the time. #### 1. Install the engine You need an AWS account, the AWS CLI signed in with permission to create stacks, and Node 20 or newer. ```bash npx @sypnia/run engine install --region us-east-1 ``` It deploys the CloudFormation stack `sypnia-run` (the API, the deployer, the build project, the artifacts bucket and the edge router) and prints the engine's address and its first admin key, which it saves in `~/.config/sypnia/run-engine.json` (mode 600). **You should see:**`Engine ready: https://abc123.cloudfront.net`. #### 2. Point the CLI at it ```bash npx @sypnia/run use https://abc123.cloudfront.net ``` #### 3. Deploy ```bash npx @sypnia/run deploy --local ``` `--local` builds on your machine and uploads the artifacts; without it the build runs in AWS CodeBuild in your account. **You should see:**`Production: https://d1x2y3.cloudfront.net` and a stack `sypnia-run-app-` in CloudFormation. #### 4. Add your domain ```bash npx @sypnia/run domains add www.laespiga.co ``` The command prints the DNS records to add, and requests the certificate in AWS Certificate Manager. With the domain in Route 53 in the same account, it adds them for you. [Self-hosting](https://run.docs.sypnia.com/self-hosting) covers the stack's parameters, upgrades and removing everything. --- ## How Sypnia uses it > Every Sypnia product runs on Sypnia Run, and Telemetry, the pilot, shows how. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/start/how-sypnia-uses-it/ For agents: Dogfooding: Telemetry (the pilot, built on Sypnia end to end) is deployed by Run from its repository in Sypnia Git (organization sypnia), project telemetry in Sypnia's organization, paid with its credits. Apps: telemetry-site (static, telemetry.sypnia.com), telemetry-docs (static, telemetry.docs.sypnia.com), telemetry-console (server-rendered, telemetry.app.sypnia.com), telemetry-engine (Rust; one service per area of its map: ingest behind telemetry.ingest.sypnia.com, api behind telemetry.api.sypnia.com, problems, alerts, uptime). Its cases: ingest-batch (external), open-problem and analyze-problem (event), send-alert (event), send-daily-summary (scheduled, each organization's morning), check-uptime (scheduled every minute), roll-up-hour (scheduled) through cases.handlers; outcomes such as problems.open-problem.ProblemOpened.v1 go through the outbox to analyze-problem and send-alert. Every pull request gets a preview; production waits for a person in App; automatic rollback on Telemetry's own release markers. Names in Sypnia Domains, secrets in Run, files in Files, sign-in with Data. Rest of the suite: every product's site and console runs on Run, and their cases run as Run services. Telemetry is the pilot of the Sypnia suite: it is built on Sypnia from end to end and uses every Sypnia product. This is how it uses Sypnia Run. ### How Telemetry runs on Run Telemetry's code lives in Sypnia Git, in the organization `sypnia`, and its Run project is `telemetry`, paid with the credits of Sypnia's organization like any customer's. | App | Kind | Address | | ------------------- | ---------------------------------------- | --------------------------------------------------------- | | `telemetry-site` | static site | `telemetry.sypnia.com` | | `telemetry-docs` | static site | `telemetry.docs.sypnia.com` | | `telemetry-console` | server-rendered app | `telemetry.app.sypnia.com` | | `telemetry-engine` | one service per area of its map, in Rust | `telemetry.ingest.sypnia.com`, `telemetry.api.sypnia.com` | ### Its use cases, run by Run Telemetry's map in Cases says how each of its cases starts, and Run creates the rest ([Use cases](https://run.docs.sypnia.com/cases)): | Case | Starts | What Run creates | | -------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------- | | `ingest-batch` | `external`: an SDK sends a batch | the ingest endpoint, in the `ingest` service | | `roll-up-hour` | `scheduled`: every minute | a schedule, calling the engine through `cases.handlers` | | `check-uptime` | `scheduled`: every minute | a schedule in the `uptime` service | | `open-problem` | `event`: `ingest.ingest-batch.BatchStored.v1` | a subscription with its own queue | | `analyze-problem` | `event`: `problems.open-problem.ProblemOpened.v1` | a subscription; it calls [Sypnia AI](https://ai.docs.sypnia.com/) | | `send-alert` | `event`: `problems.open-problem.ProblemOpened.v1` | a subscription; it sends through [Sypnia Mail](https://mail.docs.sypnia.com/) | | `send-daily-summary` | `scheduled`: each organization's morning, in its time zone | a schedule | `ProblemOpened` is saved in the outbox in the same transaction as the problem, so the analysis and the alert can never be lost or sent about a problem that does not exist. If the alert's listener fails, its dead letters show on `send-alert` in the map, and the analysis carries on. ### Deploys - **A preview for every pull request**, with its address in the pull request and the use-case diff next to the code diff. - **Production waits for a person.** An agent can deploy a preview; releasing to production is approved in [Sypnia App](https://app.docs.sypnia.com/). - **Automatic rollback** watches Telemetry's own release markers: if errors rise after a release, Run goes back to the previous deploy. - **The names** are Sypnia Domains connections, with their certificates; secrets live in Run, files in [Sypnia Files](https://files.docs.sypnia.com/), and sign-in comes from [Sypnia Data](https://data.docs.sypnia.com/). ### The rest of the suite | Product | What runs on Run | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | | [Cases](https://cases.docs.sypnia.com/), [Git](https://git.docs.sypnia.com/), [Data](https://data.docs.sypnia.com/), [Files](https://files.docs.sypnia.com/), [Mail](https://mail.docs.sypnia.com/), [Domains](https://domains.docs.sypnia.com/) | their sites, docs, consoles and APIs, and their cases as services per area | | [Agent](https://agent.docs.sypnia.com/), [AI](https://ai.docs.sypnia.com/), [App](https://app.docs.sypnia.com/) | their servers and the streaming answers | | [Design](https://design.docs.sypnia.com/), [Learn](https://learn.docs.sypnia.com/), [Skills](https://skills.docs.sypnia.com/) | their sites, consoles and registries | | sypnia.com | the suite's own site | ### What it proves Telemetry's ingest is the busiest endpoint Sypnia has. If a deploy, a schedule or an event on Run is slow, late or lost, Telemetry is the first to feel it, in production, every day, and its own traces say where. --- ## Apps and runtimes > Static sites, server-rendered apps, containers and functions: what each one is for and how it runs. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/apps/ An **app** is one thing you deploy: a website, an API, a worker. It has one kind, chosen by Run from your code or written in its table of `sypnia.toml`, plus optional functions, jobs and queues next to it. | Kind | Choose it when | | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | [Static site](https://run.docs.sypnia.com/apps/static-sites) | the build produces only files | | [Server-rendered app](https://run.docs.sypnia.com/apps/server-apps) | a framework renders pages on the server | | [Container](https://run.docs.sypnia.com/apps/containers) | you have a `Dockerfile`, a language other than JavaScript, or long-lived connections | | [Function](https://run.docs.sypnia.com/apps/functions) | one endpoint or a webhook, alone or inside another app | - [Static sites](/apps/static-sites/): Files built once and served from the edge: landings, docs and single-page apps. - [Server-rendered apps](/apps/server-apps/): Next.js, Astro, SvelteKit, Nuxt and React Router apps that render on the server, on AWS Lambda. - [Containers](/apps/containers/): Anything with a Dockerfile, as an always-on service on Fargate or a scale-to-zero Lambda container. - [Functions](/apps/functions/): One HTTP endpoint or webhook, alone or next to another app. --- ## Static sites > Files built once and served from the edge: landings, docs and single-page apps. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/apps/static-sites/ For agents: Static sites in Run: output uploaded to S3 under a per-deploy prefix, served by CloudFront; detection for Vite, Astro (no adapter), Next.js export, plain HTML; spa:true fallback to index.html; clean URLs; hashed assets cached 1 year, HTML revalidated; headers and redirects in the app's table of sypnia.toml; 404.html. A static site is a folder of files: HTML, CSS, JavaScript, images. Run uploads it under the deploy's own prefix in Amazon S3 and serves it through Amazon CloudFront, so every visitor gets it from a location near them. ### What Run detects | Your project | Build command | Output folder | | ------------------------------- | ------------- | --------------------- | | Vite (React, Vue, Svelte) | `vite build` | `dist` | | Astro without an adapter | `astro build` | `dist` | | Next.js with `output: 'export'` | `next build` | `out` | | Plain HTML | none | the folder you deploy | Set `build.command` and `build.output` in the app's table of `sypnia.toml` when your project is different. ### Behaviour - **Single-page apps.** With `spa = true`, any path without a file answers `index.html`, so client-side routing works on refresh. - **Clean URLs.** `/about` serves `about.html` or `about/index.html`. - **Caching.** Files whose names carry a hash (`app.3f9c.js`) are cached for a year; HTML is revalidated on every request. A release changes which deploy answers, so visitors never mix files of two deploys. - **Headers and redirects.** Declared in the app's table of `sypnia.toml` under `headers` and `redirects`, applied at the edge. - **404.** `404.html` in the output is the not-found page. ### What it costs Static sites use storage for each deploy's files and the bytes sent to visitors. [Credits and limits](https://run.docs.sypnia.com/cloud/credits-and-limits) lists what is metered. --- ## Server-rendered apps > Next.js, Astro, SvelteKit, Nuxt and React Router apps that render on the server, on AWS Lambda. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/apps/server-apps/ For agents: SSR apps in Run: static assets on S3, server code as an AWS Lambda behind CloudFront (function URL callable only by CloudFront). Adapters: Next.js 14+ via OpenNext maintained by Run (app/pages router, middleware, image optimization, ISR revalidation), Astro node adapter, SvelteKit adapter-node, Nuxt Nitro aws-lambda, React Router/Remix node. Request flow, per-deploy caching, AWS limits (timeout default 30 s, cold starts, min_instances); use containers for WebSockets/long requests. A server-rendered app has two halves: files that never change between requests, and code that renders a page per request. Run splits them: the files go to S3 behind CloudFront, the server code becomes an AWS Lambda function that CloudFront calls for dynamic paths. ### Frameworks | Framework | Adapter | Notes | | ----------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | Next.js 14 and newer | OpenNext, maintained by Run | App Router and Pages Router, middleware at the edge, image optimization, incremental static regeneration with on-demand revalidation | | Astro with `output: 'server'` | `@astrojs/node` in a Lambda handler | server islands and endpoints | | SvelteKit | `@sveltejs/adapter-node` in a Lambda handler | form actions and endpoints | | Nuxt 3 | Nitro preset `aws-lambda` | | | React Router 7 / Remix | the Node adapter in a Lambda handler | | Run pins the adapter version per deploy, so rebuilding an old commit gives the same result. ### How a request flows 1. CloudFront receives `GET /pedidos/1042`. 2. The edge router finds which deploy the environment points to. 3. A path under the static prefix (`/_next/static/…`, `/_astro/…`) is served from S3. 4. Anything else goes to the deploy's Lambda function, through a function URL only CloudFront can call. 5. The response is cached when it says so (`Cache-Control`), per deploy. ### Limits that come from AWS - A request can last up to the function's timeout; Run sets 30 seconds by default, and AWS allows at most 15 minutes behind a function URL with response streaming. - A response body is limited by Lambda's payload size unless the framework streams it. - The first request after a quiet period starts a new instance (a cold start, usually under a second for Node). `min_instances` keeps instances warm in Sypnia Cloud, metered as idle time. When these do not fit (WebSockets, very long requests, large memory), deploy the app [as a container](https://run.docs.sypnia.com/apps/containers). --- ## Containers > Anything with a Dockerfile, as an always-on service on Fargate or a scale-to-zero Lambda container. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/apps/containers/ For agents: Containers in Run: built from Dockerfile (or Run buildpacks for Node/Python/Go); runtime lambda (default: Lambda container image, scale to zero, ≤15 min, ≤10 GB) or fargate (always-on tasks, unlimited request length, WebSockets, up to 16 vCPU/120 GB). Requirements: listen on PORT (default 8080), health check path, logs to stdout/stderr, graceful SIGTERM in 30 s. Fargate releases are health-checked blue/green. A container app is built from your `Dockerfile` and listens on a port. Use it for languages other than JavaScript, for frameworks that need a long-lived process, for WebSockets, or when you already have an image. ### Two ways to run a container | | `runtime = "lambda"` (default) | `runtime = "fargate"` | | ---------------------------- | ------------------------------------------------ | ----------------------------------------- | | Runs on | AWS Lambda with your container image | AWS Fargate, one or more tasks | | When idle | scales to zero; you pay per request and duration | at least one task always running | | Request length | up to 15 minutes | unlimited | | WebSockets, long connections | no | yes | | Size | up to 10 GB memory | up to 16 vCPU and 120 GB memory | | Good for | APIs with irregular traffic | steady traffic, sockets, background loops | `lambda` is the default; `fargate` is billed for every hour its tasks are on, so an app chooses it only for what a function cannot do ([Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers)). Both receive HTTP through CloudFront, so the address, the domain and the release step are the same as for any other app. ### What Run needs from your image - It listens on the port in `PORT` (Run sets it, default 8080). - It answers the health check path (`/` by default, `health_check.path` to change it) with a 2xx within the health timeout. - It writes logs to standard output and standard error. - On `SIGTERM` it finishes in-flight requests within 30 seconds. Without a `Dockerfile`, Run can build an image for Node, Python or Go projects with its own buildpacks; the detected settings are printed in the build log. ### Releases for containers A Fargate release starts the new tasks, waits for their health checks, shifts traffic to them and then stops the old tasks. If the new tasks fail their health checks, the release stops and production keeps the old deploy. --- ## Functions > One HTTP endpoint or webhook, alone or next to another app. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/apps/functions/ For agents: Functions in Run: single HTTP handler (standard Request/Response via @sypnia/run/function handler), standalone or under a path in another app; env vars in process.env, SYPNIA_DEPLOY_ID/SYPNIA_APP/SYPNIA_ENV; TS/JS bundled, Python/Go/Rust via container image or prebuilt zip; memory 128 MB–10 GB (default 512), timeout 1–900 s (default 10), concurrency cap. A function is a single handler that answers HTTP requests. It can be an app on its own (a webhook receiver, a small API) or live inside another app's deploy, under a path. ```ts // functions/pay.ts — receives the payment provider's webhook import { handler } from '@sypnia/run/function'; export default handler(async (req) => { const event = await req.json(); // verify the signature, record the payment… return Response.json({ ok: true }); }); ``` `sypnia.toml` ```toml [run.apps.laespiga.functions.pay] file = "functions/pay.ts" path = "/api/pay" memory = 512 timeout = 10 ``` ### What a function receives A standard `Request` and returns a standard `Response`, the same objects as `fetch`. Environment variables and secrets are in `process.env`. The deploy id is in `SYPNIA_DEPLOY_ID`, and `SYPNIA_APP`/`SYPNIA_ENV` name the app and environment. ### Languages TypeScript and JavaScript are bundled by Run. Python, Go and Rust functions are supported through a `Dockerfile` (a Lambda container image) or a prebuilt zip with `runtime` set in the config. ### Settings | Field | Default | Range | | ------------- | ---------------- | ------------------------------- | | `memory` | 512 MB | 128 MB to 10 GB | | `timeout` | 10 s | 1 s to 900 s | | `concurrency` | none | a cap on simultaneous instances | | `regions` | the app's region | one region (us-east-1) | --- ## Use cases > How Run runs the use cases on your map: one service per area, a route, endpoint, schedule or subscription per start, and outcomes that reach whoever needs them. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cases/ For agents: Run executes the use cases of a Cases map (cases/*.case.yaml) with their Sypnorm code: the cases of each area are bundled into one service; each start becomes infrastructure (in_app → app route, external → public endpoint with schema and idempotency key, scheduled → schedule, event → subscription with its own queue and dead letters); each outcome goes back to the caller, to every listener through the outbox (written in the case's transaction, published at once, swept every minute) and always to Telemetry. If your app has a map of use cases in [Sypnia Cases](https://cases.docs.sypnia.com/), Run reads it at build time and creates what each case needs. You write the cases and their rules; Run turns how each one starts into a route, an endpoint, a schedule or a subscription, and makes sure every outcome reaches whoever is waiting for it. > **In plain words** > > A use case is one thing your app does, like «Order bread for tomorrow». You describe when it starts: a person taps a button, another app calls, the clock says so, or another case finished. Run sets up exactly that, so nothing has to be wired by hand. This is the way of building that the [Living Cases manifesto](https://cases.sypnia.com/manifest/) describes. An app without a map runs on Run as before: every page of these docs works without it. - [How use cases run](/cases/how-cases-run/): What Run reads from your map, how the cases of an area become one service, and when a case gets a service of its own. - [How each case starts](/cases/starts/): The four ways a case starts, and what Run creates for each one: a route of your app, a public endpoint, a schedule or a subscription. - [Outcomes and events](/cases/outcomes-and-events/): How every outcome reaches the caller, every listener and Telemetry: the outbox in the case's own transaction, the fast path and the sweep, and what Run guarantees. --- ## How use cases run > What Run reads from your map, how the cases of an area become one service, and when a case gets a service of its own. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cases/how-cases-run/ For agents: Run reads the map (cases/*.case.yaml, or use_cases = "sypnorm" in the [run] table of sypnia.toml) at build time and matches each case with the Sypnorm useCase that names its id (place-order ↔ useCase('place-order', …)); a case on the map without code, or code without a case, fails the build like cases check. The cases of one area run together in one service - (Lambda by default, Fargate with runtime = "fargate"), deployed with the app as part of the same immutable deploy. Code in other languages: cases.handlers maps a case to a function/container route returning {outcome|failure, data}; the handler writes its own outbox row. Split a case into its own service with cases.split in the app's table of sypnia.toml (memory, timeout, runtime, concurrency) when it needs other resources. Each run: input checked against the case's schema, actor from the Sypnia Data session (in_app) or the start's credential, one transaction, span with sypnia.case and sypnia.case.outcome, outcome delivered. Deploys show which cases were added, removed or changed. ### What Run reads At build time Run reads two things and puts them together: | From | What | Where | | ------------ | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | | **The map** | each case's id, area, how it starts (`starts`), where it lives (`where`), its outcomes and failures | the `cases/` folder of your repository, in the [open format](https://cases.docs.sypnia.com/format/) | | **The code** | each case's rules, written with [Sypnorm](https://cases.docs.sypnia.com/sypnorm/) | your source, wherever `useCase(…)` is exported | Each case on the map is matched with the code that names its id: `place-order` on the map, `useCase('place-order', …)` in the code. A case on the map with no code, or code that no case describes, stops the build with the same message [`cases check`](https://cases.docs.sypnia.com/contract/the-check/) gives, so nothing reaches production off the map. Turn it on in the app's table of `sypnia.toml`: `sypnia.toml` ```toml [run.apps.laespiga] kind = "ssr" use_cases = "cases" ``` `use_cases` is the folder of the map (`"cases"`), or `"sypnorm"` to build the map from the code alone. #### Code in another language Sypnorm is TypeScript. A case written in another language, such as the Rust of the Telemetry engine, is named in `cases.handlers` with the function or container route that runs it: `sypnia.toml` ```toml [run.apps.telemetry.cases.handlers] roll-up-hour = "engine:/internal/cases/roll-up-hour" ``` Run calls that route with the checked input and the actor, and the handler answers `{ "outcome": "HourRolled", "data": { … } }` or `{ "failure": "…", "data": { … } }`. A handler whose outcome has listeners inserts the event into `sypnia_cases.outbox` in its own transaction, with the columns on [Outcomes and events](https://run.docs.sypnia.com/cases/outcomes-and-events#what-each-event-carries); everything else, from schedules to dead letters, works the same. ### One service per area A case is a unit of meaning, not of deployment. The cases of one **area** run together in **one service**, named `-`: | Area of La Espiga | Its cases | Its service | | ----------------- | --------------------------------------------------- | --------------------- | | `orders` | `order-for-tomorrow`, `rappi-order`, `cancel-order` | `laespiga-orders` | | `weather` | `check-weather` | `laespiga-weather` | | `deliveries` | `pause-deliveries`, `tell-the-baker` | `laespiga-deliveries` | A service is a Lambda function by default, and a container on Fargate with `runtime = "fargate"`, like any [function or container](https://run.docs.sypnia.com/apps/functions) of Run. It is part of the app's deploy: built from the same commit, kept unchanged, promoted and rolled back with everything else. Fewer services mean fewer cold starts and one place to look. When one case needs something different, give it a service of its own: `sypnia.toml` ```toml [run.apps.laespiga] use_cases = "cases" [run.apps.laespiga.cases.split.print-kitchen-ticket] memory = 1024 timeout = 120 ``` Good reasons to split: a case needs much more memory or time than its area, it carries a heavy dependency the others do not, or it must scale apart. A split case keeps its area: it can still listen only to what its area may hear. ### What happens on each run 1. **The start arrives**: a request, a call from another app, the clock or an event ([How each case starts](https://run.docs.sypnia.com/cases/starts)). 2. **The input is checked** against the case's schema. Invalid input never reaches your code: the caller gets `422` with the field that failed. 3. **The actor is known**: the person's [Sypnia Data](https://data.docs.sypnia.com/) session for a case that starts in the app, the caller's credential for an external one, and the machine actor of the area for schedules and events. 4. **The case runs** in one transaction, through the runner of [Sypnorm](https://cases.docs.sypnia.com/sypnorm/runners/). 5. **The outcome travels**: back to the caller, to every case that listens to it, and to [Sypnia Telemetry](https://run.docs.sypnia.com/observe/telemetry-and-use-cases) as the span of the run, with `sypnia.case` and `sypnia.case.outcome` ([Outcomes and events](https://run.docs.sypnia.com/cases/outcomes-and-events)). ### In each deploy Every deploy records the map it was built with. Its page, and the comment on the pull request of a [preview](https://run.docs.sypnia.com/deploys/previews), list the cases that were **added**, **removed** or **changed** compared with production, with what Run creates or removes for each one when it is released: a new route, a schedule that stops, a subscription that starts. Nothing changes in production until the deploy is released. --- ## How each case starts > The four ways a case starts, and what Run creates for each one: a route of your app, a public endpoint, a schedule or a subscription. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cases/starts/ For agents: starts → infrastructure. in_app: a route of the app, POST /_cases/, called by the case's screen with the person's Sypnia Data session (actor from the session; refused 401/403 by the case's allowed actors); not public to other apps. external: a public endpoint POST /hooks/ on the app's address, input checked against the schema, authenticated by a case key (Authorization: Bearer syp_rck_…, one case only) or an HMAC signature (signature: { header, secret }), idempotency_key names an input field: a repeat within 24 h returns the first answer without running again. scheduled: an EventBridge Scheduler schedule (cron or every N, IANA timezone, DST handled), overlap skip by default, at least once; same as jobs but declared on the map. event: a subscription to another case's outcome (area.case.Outcome.vN): its own SQS queue and dead letters per listener, EventBridge rule with the filter; on: any of several, on_all: several with a correlation key and a window (a window that closes first runs nothing and ends as WindowExpired, visible in Telemetry). A case with no start fails the build (orphan). Every case on the map says how it starts with `starts`. Run creates exactly that, and nothing else: a case that starts in the app has no public endpoint, and a scheduled case cannot be called from outside. | `starts` | Who starts it | What Run creates | | ----------- | ------------------------------------------------- | ---------------------------------------------------------- | | `in_app` | a person, on a screen of your app | a route of your app, for that screen | | `external` | another app: a payment provider, Rappi, a partner | a public endpoint, with its schema and its idempotency key | | `scheduled` | the clock | a schedule, in your time zone | | `event` | another case, when it ends in an outcome | a subscription, with its own queue | A case with no start is an **orphan**: nothing could ever run it, so the build stops and says which one. ### `in_app`: a person, on a screen `cases/orders/order-for-tomorrow.case.yaml` ```yaml id: order-for-tomorrow actor: customer starts: in_app where: shop.order-for-tomorrow ``` Run adds the route `POST /_cases/order-for-tomorrow` to your app. The screen at the case's `where` calls it with the person's [Sypnia Data](https://data.docs.sypnia.com/) session, and the session says who the actor is. A person whose role is not among the case's allowed actors gets `403`, and one with no session gets `401`. The route belongs to your app: it answers only to your own pages, never to other origins. The answer is the outcome or the failure, typed, with the message for the person. ### `external`: another app calls `cases/orders/rappi-order.case.yaml` ```yaml id: rappi-order actor: rappi starts: { external: webhook, idempotency_key: rappi_order_id, signature: { header: X-Rappi-Signature, secret: RAPPI_SECRET } } ``` Run publishes `POST /hooks/rappi-order` at your app's address: - **The input** is checked against the case's schema before your code runs; anything else gets `422`. - **Who is calling** is proved with a case key (`Authorization: Bearer syp_rck_…`, made with `run cases keys create rappi --case rappi-order`, good for that one case only) or, as here, with the caller's signature: an HMAC of the body with a [secret](https://run.docs.sypnia.com/config/environment-and-secrets) you keep in Run. - **The idempotency key** names a field of the input. A second call with the same `rappi_order_id` within 24 hours gets the first answer again, and the case does not run twice: a resent order is not baked twice. ### `scheduled`: the clock `cases/weather/check-weather.case.yaml` ```yaml id: check-weather actor: system starts: { scheduled: every 2h, timezone: America/Bogota } ``` Run creates a schedule, exactly as for a [scheduled job](https://run.docs.sypnia.com/jobs/cron): a cron expression or `every m|h|d`, in the time zone you name, with summer time handled. A run that is still going when the next one is due is skipped, unless the start says `overlap: allow`. Like every schedule, it runs at least once per time, so the case must do no harm if it runs twice. `run cases trigger check-weather` runs it now, by hand. ### `event`: another case ended `cases/deliveries/pause-deliveries.case.yaml` ```yaml id: pause-deliveries actor: system starts: { event: weather.check-weather.RainExpected.v1 } ``` The case runs each time `check-weather` ends in `RainExpected`. Run creates a **subscription** for it: a queue of its own, its own retries and its own place for messages that keep failing. One listener that fails never slows another. How outcomes travel, and what Run guarantees, is in [Outcomes and events](https://run.docs.sypnia.com/cases/outcomes-and-events). An event start can also: | Write | To | | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `{ on: [orders.order-for-tomorrow.OrderPlaced.v1, orders.rappi-order.OrderPlaced.v1] }` | run on any of several outcomes | | `{ on_all: [payments.pay.Paid.v1, kitchen.bake.Baked.v1], key: order_id, within: 2h }` | run once all of them happened for the same `order_id`, within two hours; if the two hours pass first, nothing runs and the wait ends as `WindowExpired`, visible in Telemetry | | `{ event: …, filter: { total: { gte: 100000 } } }` | run only when the outcome's data matches | | `{ event: …, order_by: order_id }` | handle the events of one `order_id` in order | A case can only listen to the **public** outcomes of another area: what an area keeps internal stays inside it, and the build refuses a listener that reaches for it. --- ## Outcomes and events > How every outcome reaches the caller, every listener and Telemetry: the outbox in the case's own transaction, the fast path and the sweep, and what Run guarantees. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cases/outcomes-and-events/ For agents: Outcome delivery: to the caller (the HTTP answer of in_app/external), to every listener, always to Telemetry (span with sypnia.case, sypnia.case.outcome). Every run ends with ctx.outcome(name, data), outcomes and failures alike. Outbox: when anything listens to an outcome, the runtime inserts it into sypnia_cases.outbox in the same Data transaction as the case's writes (direct runner and Data API atomic transaction); nobody listening = no row. Fast path: right after commit the service publishes its rows (EventBridge in Sypnia Cloud and the engine in your AWS account) and marks them sent; sweep: every minute a sweeper publishes rows unsent for 30 s. Event envelope: id (uuid), name area.case.Outcome.vN, data, occurred_at, key, traceparent, cause (chain of case ids), depth. Each listener: own SQS queue (FIFO with message group = order_by), 5 attempts with backoff, then its dead letters (run cases dlq [--replay]), shown on the map; at least once; the runtime skips an event id the listener already handled (kept 7 days). on_all waits in sypnia_cases.waits by key and window; a window that closes first runs nothing and ends as WindowExpired, visible in Telemetry. Loops: refused at build unless loop: bounded with max and until; at run time a case already in the cause chain, or depth > 10, is not run: LoopStopped on the trace and a Telemetry alert. Without AWS (Docker, your own server): a background task in each service drains the outbox, woken by LISTEN/NOTIFY right after commit and sweeping every minute; listener queues are Postgres tables with the same attempts and dead letters. Limits: event data up to 256 KB (bigger → Files path); name versions: a new version is published beside the old for 90 days, then the old stops. ### Where an outcome goes When a case ends, its outcome goes to three places, and Run decides how it travels: | To | How | | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Whoever is waiting** | The answer of the request, for a case that starts `in_app` or `external` | | **Every case that listens to it** | An event, through the outbox, to each listener's own queue | | **Sypnia Telemetry**, always | The span of the run, with `sypnia.case` and `sypnia.case.outcome` ([Telemetry and use cases](https://run.docs.sypnia.com/observe/telemetry-and-use-cases)) | In the code, every run ends with `ctx.outcome`: the outcome or the failure that happened, with its data ([Sypnorm](https://cases.docs.sypnia.com/sypnorm/use-cases/)): `src/cases/check-weather.ts` ```ts if (forecast.rainFrom) return ctx.outcome('RainExpected', { from: forecast.rainFrom }); return ctx.outcome('ClearSkies', {}); ``` ### The outbox: saved with the data An outcome that someone listens to is saved **in the same transaction** as the data it describes. When `pause-deliveries` commits, the paused deliveries and the event `deliveries.pause-deliveries.DeliveriesPaused.v1` are written together, or neither is. There is never an event about data that was rolled back, and never data whose event was lost. Run knows at build time which outcomes have listeners. For those, the runtime adds one row to the table `sypnia_cases.outbox` inside the case's transaction, with the [direct runner](https://cases.docs.sypnia.com/sypnorm/runners/) and with the Data API's all-or-nothing transaction alike. An outcome nobody listens to writes nothing. Then the event leaves by one of two roads: #### 1. The fast path Right after the commit, the service that ran the case publishes the rows it just wrote and marks them sent. Listeners usually hear the event within a second. #### 2. The sweep Every minute, a sweeper publishes any row still unsent after 30 seconds: the service stopped between the commit and the publish, or the bus did not answer. Nothing written is ever left behind. | Where Run runs | The bus | The sweeper | | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | **\[Cloud]** Sypnia Cloud | Amazon EventBridge, one bus per app environment, and an Amazon SQS queue per listener | a schedule of the app | | **\[Engine]** The engine in your AWS account | the same, in your account | the same | | **\[Engine]** Without AWS: [Docker](https://run.docs.sypnia.com/self-hosting/docker) or your own server | Postgres: each listener's queue is a table | a background task in each service, woken by `LISTEN`/`NOTIFY` right after the commit, sweeping every minute | ### What each event carries ```json { "id": "0193f6c2-7a1e-7c3b-9d2a-5e8f1b4c6a70", "name": "weather.check-weather.RainExpected.v1", "data": { "from": "2026-11-18T15:00:00-05:00" }, "occurred_at": "2026-11-18T13:00:04Z", "key": null, "traceparent": "00-7c2e9a4b1d8f4e6a9b3c5d7e1f2a4b6c-a1b2c3d4e5f60718-01", "cause": ["check-weather"], "depth": 1 } ``` - **`name`** is `area.case.Outcome.v`. Changing an outcome's data in a way that would break a listener needs a new version; the old one keeps being published next to it for 90 days, then stops, and the build warns every listener still on it with the days left ([Versions](https://cases.docs.sypnia.com/map/outcomes-and-events/#versions)). - **`traceparent`** carries the trace, so the listener's run is part of the same story in Telemetry: the weather check, the paused deliveries and the message to the baker are one trace. - **`cause`** and **`depth`** say which cases led here. They are how Run stops a loop. - **`data`** is at most 256 KB. For something bigger, put it in [Sypnia Files](https://files.sypnia.com) and send its path. ### What Run guarantees - **At least once.** An event reaches every listener at least once. Getting it twice does what getting it once does: the runtime records the event ids each listener already handled, for 7 days, and skips a repeat before your code runs. - **Each listener on its own.** Every listener has its own queue and its own retries: 5 attempts with growing waits. After the last one, the event goes to that listener's **dead letters**, shown on its case in the map and in the console. `run cases dlq tell-the-baker` lists them, and `--replay` sends them again once the cause is fixed. - **Order when you ask for it.** Events are handled in any order unless the start says `order_by: `; then the events with the same value of that field are handled one at a time, in order. - **Waiting for several.** An `on_all` start keeps what it has seen for each key until all of its outcomes arrived within the window, and runs once. A window that closes first runs nothing: it ends as `WindowExpired`, with what had arrived, on the case in the map and in Sypnia Telemetry, among the case's outcomes and on the trace of the last event that arrived. ### Loops A chain of cases can come back on itself: «Resume deliveries» leading again to «Pause deliveries». Run checks twice: 1. **At build time**, from the map: a chain of listeners that closes a circle stops the build, unless one case in it declares how it stops: `loop: { bounded: true, max: 3, until: "the forecast is clear" }`. A case can never listen to its own outcome. 2. **At run time**, from `cause` and `depth`: an event whose chain already holds the case it would start, or that is more than 10 steps deep, does not run it. The run is recorded as `LoopStopped` on the trace, and Telemetry raises an alert. --- ## Builds and deploys > Deploying from Git or the CLI, preview deploys per pull request, promotions and rollbacks. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/deploys/ Every change follows the same path: a **build** makes artifacts, the artifacts become an immutable **deploy**, and an **environment** points to one deploy. These pages cover each step and the ways to start it. - [Builds](/deploys/builds/): The isolated machine that turns your code into artifacts: detection, caching, logs and limits. - [Deploy from Git](/deploys/from-git/): Connect a repository so every push deploys and production follows a branch. - [Preview deploys](/deploys/previews/): A separate address per pull request, with its own variables, to try a change before production. - [Promote and roll back](/deploys/promote-and-rollback/): Moving an environment to another deploy: instantly, with a health check, gradually, or backwards. --- ## Builds > The isolated machine that turns your code into artifacts: detection, caching, logs and limits. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/deploys/builds/ For agents: Run builds: fresh Linux machine per build (x86_64/arm64) with Node/pnpm/npm/yarn/bun/Python/Go and Docker; in Cloud on AWS CodeBuild with a per-build role (writes only its artifacts), internet egress for packages, no internal network; build-time vs runtime vars, secrets masked; steps fetch → cache restore (lockfile hash) → frozen install → build → package + cache save; logs streamed and kept; time and size limits (timed_out never touches production). A build runs your install and build commands on a clean machine and keeps only the artifacts. ### The build machine - A fresh Linux machine per build (x86_64 or arm64, matching the app's runtime), with Node, pnpm, npm, yarn, bun, Python and Go preinstalled, and Docker for container apps. - In Sypnia Cloud it runs in AWS CodeBuild with its own role that can write only this build's artifacts. It has internet access to install packages, and no access to Sypnia's internal network or to other customers. [Isolation](https://run.docs.sypnia.com/architecture/isolation) explains the model. - Build-time variables are the ones marked `build` in [the environment](https://run.docs.sypnia.com/config/environment-and-secrets). Secrets are not available at build time unless you mark them so, and they are masked in logs. ### Steps 1. Fetch the source: the Git commit, or the archive the CLI uploaded (respecting `.gitignore` and `.sypniaignore`). 2. Restore the cache: the package manager's store and the framework's build cache, keyed by the lockfile's hash. 3. Install with the lockfile (`pnpm install --frozen-lockfile` or the equivalent). A missing lockfile is a warning; a lockfile out of date is an error. 4. Run the build command. 5. Package the artifacts for the app's kind, and save the cache. ### Logs Logs stream to the CLI and the console while the build runs and are kept with the build. Lines that contain the value of a secret are masked as `****`. ### Limits A build has a time limit and an artifact size limit, published with the plans. A build that passes the time limit is stopped and marked `timed_out`; production is not touched. --- ## Deploy from Git > Connect a repository so every push deploys and production follows a branch. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/deploys/from-git/ For agents: Deploy from Git in Run: connect Sypnia Git (no app) or GitHub (Sypnia GitHub App: code read, checks and deployments write) with run git connect; push to production branch deploys to production; PR branches get previews with a PR comment; check runs; settings production.branch, production.auto=false (manual promote), ignore paths, root for monorepos; or CI with npx @sypnia/run deploy and a deploy token. Connect a repository once; then a push to the production branch deploys to production, and any other push deploys a preview. ### Connect a repository | Host | How | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Sypnia Git](https://git.sypnia.com) | `run git connect sypnia:/`: no app to install | | GitHub | `run git connect github:/`: installs the Sypnia GitHub App on the repository, with read access to code and write access to checks and deployments | ```bash npx @sypnia/run git connect github:laespiga/web --production-branch main ``` ### What happens on a push | Push to | Result | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | the production branch | a build; when it passes, production moves to the new deploy | | another branch with an open pull request | a build and a [preview](https://run.docs.sypnia.com/deploys/previews); the pull request gets a comment with its address | | any other branch | a build and a deploy reachable at its own address, if `branches` allows it | A check run on the commit says `building`, `ready` or `failed`, with a link to the logs. ### Settings - `production.branch`: which branch is production (default `main`). - `production.auto`: `false` makes production deploys wait for `run promote`. - `ignore`: paths that do not trigger a build (`docs/**`), for monorepos. - `root`: the app's folder in a monorepo. ### Without connecting The CLI deploys a folder from any CI: `npx @sypnia/run deploy --env production --token "$SYPNIA_RUN_TOKEN"`, with a [deploy token](https://run.docs.sypnia.com/config/environment-and-secrets#deploy-tokens). --- ## Preview deploys > A separate address per pull request, with its own variables, to try a change before production. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/deploys/previews/ For agents: Run previews: deploy per pull request at https://--pr-.sypnia.app (plus per-deploy --dpl-), optional wildcard on own domain; preview environment variables separate from production; protection none | sypnia (org members, default in Cloud) | password, enforced at the edge with bypass header for machines; updated per push, removed on close/merge. A preview is a deploy of a pull request's branch, released to an environment of its own. People open it, test it, and the pull request shows its status. ### Addresses - Sypnia Cloud: `https://--pr-.sypnia.app`, stable for the life of the pull request. - Each deploy also keeps its own `https://--dpl-.sypnia.app`. - On your own domain, a wildcard such as `*.preview.laespiga.co` can serve previews as `pr-.preview.laespiga.co`. ### Variables and secrets Previews read the `preview` environment's variables, never production's, unless a variable is shared on purpose. Point previews at a test database: a [Sypnia Data](https://data.sypnia.com) branch or a separate project. ### Who can open a preview | Setting | Effect | | ------------------------------------ | ------------------------------------------------------------------ | | `previews.protection = "none"` | anyone with the address | | `"sypnia"` (default in Sypnia Cloud) | members of your organization signed in to Sypnia, once per browser | | `"password"` | a shared password, stored as a secret | Protection runs at the edge before your app sees the request; machine traffic can pass with a bypass header tied to a deploy token. ### Lifecycle A preview is updated on every push to the branch and removed when the pull request is closed or merged. Its deploys follow the [retention](https://run.docs.sypnia.com/cloud/credits-and-limits) of the plan. --- ## Promote and roll back > Moving an environment to another deploy: instantly, with a health check, gradually, or backwards. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/deploys/promote-and-rollback/ For agents: Promote and rollback in Run: run promote --env, run rollback [--to ]; target must be ready (built, resources created, health check); edge mapping switched in seconds; in-flight requests finish on old deploy; releases recorded with reason; gradual releases (--gradual 10%, sticky per visitor, promote --continue) with Telemetry comparison; auto_rollback watches error rate 10 min; rollbacks do not undo migrations, stored files or sent e-mails. Releasing never rebuilds anything: it changes which deploy an environment points to. ### Commands ```bash npx @sypnia/run promote dpl_7h3k --env production # send production to this deploy npx @sypnia/run rollback # production back to the deploy before the current one npx @sypnia/run rollback --to dpl_5a1q # to a specific deploy ``` ### How a release happens 1. The target deploy must be `ready`: built, with its resources created, and answering its health check at its own address. 2. The edge router's mapping for the environment changes to the target deploy. CloudFront applies it within seconds worldwide. 3. Requests already in progress finish on the deploy that started them. 4. The release is recorded: who, when, from which deploy to which, and why (`--reason`). ### Gradual releases `--gradual 10%` sends a share of new visitors to the new deploy and keeps the rest on the old one, sticky per visitor. `run promote --continue` moves the rest; `run rollback` sends everyone back. While a gradual release is on, Sypnia Telemetry compares errors and latency of both deploys. ### Automatic rollback With `release.auto_rollback` on, Run watches the new deploy's error rate for ten minutes after the release, through Sypnia Telemetry or the platform's own logs, and moves production back if it rises past the threshold you set. The rollback is recorded and you are notified. ### What a rollback does not undo Database migrations, files written to storage and e-mails sent are outside the deploy. Keep migrations backward compatible for one release, so the previous deploy still works with the new schema. --- ## Configuration > The [run] table of sypnia.toml, environment variables, secrets, addresses and custom domains. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/config/ - [The configuration file](/config/run-file/): Every field of the \[run] table in sypnia.toml. - [Environment variables and secrets](/config/environment-and-secrets/): Values per environment, secrets encrypted with your project's key, build-time values and deploy tokens. - [Addresses and custom domains](/config/addresses-and-domains/): The free sypnia.app address, your own domain through Sypnia Domains or any DNS, and certificates. --- ## The configuration file > Every field of the [run] table in sypnia.toml. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/config/run-file/ For agents: Run reads the [run] table of sypnia.toml, the one configuration file of the project at the repository root (top-level format = 1 and project = ""; other products' tables are ignored; the Run CLI rewrites only [run] and keeps comments; never secrets). Each app is a table [run.apps.] (name: lowercase letters, digits, dashes, unique in the project) with keys in snake_case: root, kind (static|ssr|container|function), framework, build {command, output, node, env}, runtime (lambda|fargate), memory, timeout, min_instances, max_instances, cpu, health_check {path, timeout}, spa, headers/redirects/rewrites, functions, jobs, queues, previews.protection, release.auto_rollback, telemetry, use_cases, cases.split, cases.handlers. Unknown keys in [run] are errors. Every Sypnia product reads one file: `sypnia.toml`, at the root of your repository. Run reads its `[run]` table and ignores the tables of the other products. Each app is a table of its own, `[run.apps.]`. Everything is optional; Run fills in what is missing from your project and prints what it decided in the build log. `sypnia.toml` ```toml format = 1 project = "la-espiga" [run.apps.laespiga] kind = "ssr" framework = "nextjs" ``` The first `npx @sypnia/run deploy` writes the app's table for you. The Run command line only ever rewrites the `[run]` table, and keeps your comments. Never put secrets in this file: they go in [environment variables and secrets](https://run.docs.sypnia.com/config/environment-and-secrets). ### The project | Key | Type | What it is | | --------- | ------ | -------------------------------------------------------------------------------------------------------- | | `format` | `1` | the format of the file | | `project` | string | the Sypnia project the apps belong to; asked on the first deploy if missing, and shared by every product | ### An app: `[run.apps.]` The table's name is the app's name: lowercase letters, digits and dashes, unique in the project. | Key | Type | Default | What it does | | ----------------------------------------------------- | ------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `root` | string | `.` | The app's folder in a monorepo | | `kind` | `static` · `ssr` · `container` · `function` | detected | The app's kind | | `framework` | string | detected | `nextjs`, `astro`, `sveltekit`, `nuxt`, `react-router`, `vite`… | | `build.command` | string | detected | The build command | | `build.output` | string | detected | The output folder for static sites | | `build.node` | string | `22` | Node major version | | `build.env` | list | `[]` | Variables available at build time | | `runtime` | `lambda` · `fargate` | `lambda` | For containers: `fargate` asks for an always-on container ([A container on Fargate](#a-container-on-fargate)) | | `memory`, `timeout`, `min_instances`, `max_instances` | numbers | per kind | The server part's size and scaling | | `cpu` | number | 0.5 | vCPU for Fargate | | `health_check.path`, `health_check.timeout` | string, seconds | `/`, 5 | The health check | | `spa` | boolean | `false` | Fall back to `index.html` | | `headers`, `redirects`, `rewrites` | lists | `[]` | Applied at the edge | | `functions` | tables | none | [Functions](https://run.docs.sypnia.com/apps/functions) next to the app | | `jobs` | tables | none | [Scheduled jobs](https://run.docs.sypnia.com/jobs/cron) | | `queues` | tables | none | [Queues](https://run.docs.sypnia.com/jobs/queues) | | `previews.protection` | string | `sypnia` | [Preview access](https://run.docs.sypnia.com/deploys/previews) | | `release.auto_rollback` | table | off | [Automatic rollback](https://run.docs.sypnia.com/deploys/promote-and-rollback#automatic-rollback) | | `telemetry` | boolean or table | `false` | [Send logs and traces to Sypnia Telemetry](https://run.docs.sypnia.com/observe/telemetry-and-use-cases) | | `use_cases` | string | none | The folder of the use-case map (`"cases"`), or `"sypnorm"` to build it from the code ([Use cases](https://run.docs.sypnia.com/cases)) | | `cases.split` | tables | none | Cases that get a service of their own, with `memory`, `timeout`, `runtime`, `concurrency` ([How use cases run](https://run.docs.sypnia.com/cases/how-cases-run#one-service-per-area)) | | `cases.handlers` | table | none | For cases written in another language: the function or container route that runs each one ([Code in another language](https://run.docs.sypnia.com/cases/how-cases-run#code-in-another-language)) | A key in `[run]` that the engine does not know is an error, so a typo never passes silently. ### Several apps A monorepo lists each app with its folder: `sypnia.toml` ```toml format = 1 project = "la-espiga" [run.apps.web] root = "apps/web" kind = "ssr" [run.apps.kitchen-api] root = "apps/kitchen-api" kind = "container" min_instances = 1 ``` ### A container on Fargate Every app runs on functions unless its table says otherwise. An app that needs an always-on container (work longer than 15 minutes, WebSockets, a worker that never stops) asks for it with two lines: `sypnia.toml` ```toml [run.apps.kitchen-live] root = "apps/kitchen-live" kind = "container" runtime = "fargate" # without this line, the image runs as a function that scales to zero cpu = 0.5 min_instances = 1 ``` A container on Fargate is billed for every hour it is on. When to choose it: [Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers). --- ## Environment variables and secrets > Values per environment, secrets encrypted with your project's key, build-time values and deploy tokens. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/config/environment-and-secrets/ For agents: Run environment variables and secrets: per environment (production, preview, development, custom), snapshot per deploy; commands env set [--secret] [--build], env ls, env pull; secrets encrypted with a per-project KMS key in SSM Parameter Store, never shown again, masked in logs, not written to artifacts; public prefixes (NEXT_PUBLIC_, PUBLIC_, VITE_) refused for secrets; connected Sypnia products inject their variables; deploy tokens scoped to app+environments (shown once, hashed), GitHub Actions OIDC trust. Variables belong to an **environment**: `production`, `preview`, `development` or one you create. A deploy takes a snapshot of its environment's variables when it is made; changing a variable affects the next deploy, never a running one, until you redeploy or run `run env apply`. ### Commands ```bash npx @sypnia/run env set NEXT_PUBLIC_SHOP_NAME "La Espiga" --env production npx @sypnia/run env set DATABASE_URL --secret --env production # asked without echo npx @sypnia/run env ls --env production # secrets show as •••• npx @sypnia/run env pull --env development > .env.local # plain values for local work; secrets only with --include-secrets and permission ``` ### Plain values and secrets | | Plain variable | Secret | | ----------------------- | ---------------------------- | -------------------------------------------------------------------------------------- | | Visible after saving | yes | never; only replaced or deleted | | Stored | encrypted at rest | encrypted with the project's own key (AWS KMS), in AWS Systems Manager Parameter Store | | Available at build time | if listed in `build.env` | only if marked `--build`, masked in logs | | Reaches your code | in `process.env` at run time | the same, decrypted by the runtime's role, never written to the artifacts | Names starting with `NEXT_PUBLIC_`, `PUBLIC_` or `VITE_` are embedded in browser code by your framework: Run refuses to store a secret under those names. ### From other products Connecting [Sypnia Data](https://data.sypnia.com), [Files](https://files.sypnia.com) or [Mail](https://mail.sypnia.com) to an app adds their variables (`SYPNIA_DATA_URL`, the publishable key as plain, the secret key as a secret) to the environments you choose. ### Deploy tokens A deploy token lets CI deploy one app to chosen environments, and nothing else: `run tokens create --app laespiga --env preview,production`. It is shown once, stored hashed, and revoked with `run tokens revoke`. For GitHub Actions, Run can trust the workflow's OIDC token instead, so no secret is stored in GitHub. --- ## Addresses and custom domains > The free sypnia.app address, your own domain through Sypnia Domains or any DNS, and certificates. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/config/addresses-and-domains/ For agents: Run addresses: free https://.sypnia.app in Cloud (unique name, never under sypnia.com so deployed code cannot read Sypnia account cookies); custom domains via Sypnia Domains (automatic), Route 53 in engine account (automatic), or any DNS (CNAME/ALIAS + TXT ownership proof); ACM certificates auto-renew; one domain per app; apex/www redirect; domains attached per environment. ### The free address **\[Cloud]** Every app in Sypnia Cloud answers at `https://.sypnia.app`, with a certificate, from its first deploy. The name is unique across Sypnia; if it is taken, the CLI suggests another. Apps are served from `sypnia.app` and never from `sypnia.com`, so code you deploy can never read the cookies of your Sypnia account. ### Your own domain | Your domain is | What you do | | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | in [Sypnia Domains](https://domains.sypnia.com) | `run domains add laespiga.co`: records and certificate are set for you | | in Route 53 in the engine's account **\[Engine]** | the same command writes the records | | anywhere else | add the records the command prints: a `CNAME` (or an `ALIAS` at the apex) and a `TXT` that proves the domain is yours | The certificate comes from AWS Certificate Manager and renews itself while the records are in place. A domain attached to one app cannot be attached to another until it is removed. ### Apex and www `run domains add laespiga.co --redirect www` serves the app at `laespiga.co` and redirects `www.laespiga.co` to it (or the reverse). ### Domains per environment A domain belongs to an environment: `www.laespiga.co` to production, `staging.laespiga.co` to `staging`. Preview wildcards are described in [Previews](https://run.docs.sypnia.com/deploys/previews). --- ## Jobs and queues > Scheduled jobs, queues and background work. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/jobs/ - [Scheduled jobs](/jobs/cron/): Run code on a schedule, in your time zone, with retries and a record of every run. - [Queues](/jobs/queues/): Send work to a queue from your app and process it in the background, with retries and a dead-letter queue. --- ## Scheduled jobs > Run code on a schedule, in your time zone, with retries and a record of every run. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/jobs/cron/ For agents: Run scheduled jobs: [run.apps..jobs.] tables in sypnia.toml with schedule (cron or rate()), timezone (IANA, DST handled), run file (@sypnia/run/job), timeout (default 300 s, ≤900 on Lambda, unlimited fargate), retries (attempts in all, default 5, 1–20, growing waits), overlap skip|allow, environments (production only by default); EventBridge Scheduler; at-least-once (make idempotent); runs recorded (run jobs runs), manual trigger (run jobs trigger). A job is code that runs on a schedule. It belongs to an app and is deployed with it, so a job always runs the code of the deploy production points to. A use case on your map that starts `scheduled` becomes a job like these, declared on the map instead of here ([How each case starts](https://run.docs.sypnia.com/cases/starts#scheduled-the-clock)). `sypnia.toml` ```toml [run.apps.laespiga.jobs.close-day] schedule = "0 21 * * *" timezone = "America/Bogota" run = "jobs/close-day.ts" timeout = 300 [run.apps.laespiga.jobs.reminders] schedule = "rate(15 minutes)" run = "jobs/reminders.ts" overlap = "skip" ``` ```ts // jobs/close-day.ts import { job } from '@sypnia/run/job'; export default job(async (ctx) => { ctx.log('closing the day', { at: ctx.scheduledAt }); // … }); ``` ### Fields | Field | Default | What it does | | -------------- | ---------------- | ---------------------------------------------------------------------------------------------- | | `schedule` | — | A cron expression (`min hour day month weekday`) or `rate(N minutes\|hours\|days)` | | `timezone` | `UTC` | IANA name; daylight saving is handled | | `run` | — | The file whose default export is the job | | `timeout` | 300 s | Up to 900 s on Lambda; a container job (`runtime = "fargate"`) has no limit | | `retries` | 5 | Attempts in all, 1 to 20, with growing waits; after the last one the run is recorded as failed | | `overlap` | `skip` | `skip` a run while the previous one is still running, or `allow` | | `environments` | `["production"]` | Where the job runs; previews never run jobs unless listed | ### Guarantees A run starts **at least once** per scheduled time: after a platform failure a run can start twice, so make jobs safe to repeat (check what is already done). Each run is recorded with its start, end, status and logs: `run jobs runs close-day`. `run jobs trigger close-day` starts one now. --- ## Queues > Send work to a queue from your app and process it in the background, with retries and a dead-letter queue. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/jobs/queues/ For agents: Run queues: [run.apps..queues.] tables in sypnia.toml (consumer file, batch, retries = attempts in all, default 5, 1–20, concurrency); send with @sypnia/run/queue queue(name).send(body, {delaySeconds, dedupeId}); consumer() handler; one SQS queue per app environment plus DLQ; failed batches retried with backoff then moved to DLQ (run queues dlq [--replay]); at-least-once; dedupeId 5-minute window; delay ≤15 min; scaling up to concurrency; 256 KB message limit (use Files for bigger). A queue holds messages until a consumer processes them. Use it for anything that should not make a visitor wait: sending e-mails, resizing images, printing kitchen tickets, importing a file. `sypnia.toml` ```toml [run.apps.laespiga.queues.kitchen] consumer = "workers/kitchen.ts" batch = 10 retries = 5 # attempts in all, 1 to 20 (5 when left out) concurrency = 4 ``` ```ts // in your app import { queue } from '@sypnia/run/queue'; await queue('kitchen').send({ order: 1042 }, { delaySeconds: 0, dedupeId: 'order-1042' }); // workers/kitchen.ts import { consumer } from '@sypnia/run/queue'; export default consumer<{ order: number }>(async (messages) => { for (const m of messages) await printTicket(m.body.order); }); ``` ### How it behaves - Each queue is an Amazon SQS queue of the app's environment, with a **dead-letter queue** next to it. - A batch that throws is tried again with growing waits: **5 attempts** in all by default, or what `retries` says (1 to 20). After the last attempt its messages move to the dead-letter queue, where `run queues dlq kitchen` lists them and `--replay` sends them back. - Delivery is **at least once**: process messages so that receiving one twice does no harm (`dedupeId` drops duplicates sent within five minutes). - `delaySeconds` holds a message up to 15 minutes before it can be received. - Consumers scale with the queue's length up to `concurrency`. ### Limits from AWS A message body is up to 256 KB; put bigger payloads in [Sypnia Files](https://files.sypnia.com) and send the path. --- ## Logs and traces > Logs, traces into Sypnia Telemetry, and which use cases each deploy changed. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/observe/ - [Logs](/observe/logs/): Build logs, request logs and your app's own output, searchable per deploy. - [Telemetry and use cases](/observe/telemetry-and-use-cases/): Traces and errors in Sypnia Telemetry with the deploy on them, and which use cases each deploy changed. --- ## Logs > Build logs, request logs and your app's own output, searchable per deploy. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/observe/logs/ For agents: Run logs: build logs, request logs (method, path, status, duration, deploy, cache), app logs (stdout/stderr of functions, containers, jobs, consumers); run logs [--deploy] [--since] [--level] [--job] [--where]; JSON lines kept as fields; no sampling, overflow counted; stored in CloudWatch Logs per app+environment; secrets masked. Run keeps three kinds of logs: | Kind | What | Kept | | ------- | ----------------------------------------------------------------------------------------------------------- | -------------- | | Build | the output of every build | with the build | | Request | one line per request served: method, path, status, duration, deploy, cache hit | per plan | | App | what your code writes to standard output and standard error, from functions, containers, jobs and consumers | per plan | ```bash npx @sypnia/run logs # follow production npx @sypnia/run logs --deploy dpl_7h3k --since 1h --level error npx @sypnia/run logs --job close-day --since 24h ``` A line your code writes as JSON is kept as fields, so `--where 'order=1042'` works. Lines are never sampled; when a burst exceeds the rate a plan allows, the excess is counted and the count is shown, not silently dropped. ### Where they live In the engine, logs are in Amazon CloudWatch Logs in your account, one log group per app and environment. In Sypnia Cloud, the same, read through the console and the API; you never need CloudWatch access. Personal data in logs is your responsibility; avoid logging tokens and passwords. Run masks the values of your secrets wherever they appear. --- ## Telemetry and use cases > Traces and errors in Sypnia Telemetry with the deploy on them, and which use cases each deploy changed. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/observe/telemetry-and-use-cases/ For agents: Run + Sypnia Telemetry: telemetry = true or run telemetry connect adds project key and SYPNIA_RELEASE, wires @sypnia/telemetry/next for Next.js, uploads/removes source maps, forwards logs, release markers per release (used by release.auto_rollback). Use cases: with use_cases (sypnorm or map file) each build records the use-case map; deploy shows added/removed/changed use cases vs production with files and commits; Telemetry traces tagged per use case; diff in preview PR comments. ### Sypnia Telemetry With `telemetry = true` (or `run telemetry connect`), Run links the app to a [Sypnia Telemetry](https://telemetry.sypnia.com) project: - it adds the Telemetry project key and `SYPNIA_RELEASE` (the deploy id) to the app's environment; - for Next.js it wires `@sypnia/telemetry/next` at build time, and for other frameworks it prints the two lines to add; - it uploads the build's source maps to Telemetry and removes them from the deployed files; - it forwards request logs and app logs of functions and containers, so a problem in Telemetry links to the deploy and to the log lines around it. Every release is sent to Telemetry as a release marker, so its charts show where a deploy started and a rise in errors points at the deploy that caused it. [Automatic rollback](https://run.docs.sypnia.com/deploys/promote-and-rollback#automatic-rollback) uses these numbers. ### Use cases When the app has a use-case map (the `cases/` folder of [Sypnia Cases](https://cases.docs.sypnia.com/), or [Sypnorm](https://cases.docs.sypnia.com/sypnorm/) with `use_cases = "sypnorm"`), each build records the map and the files behind every use case. The deploy then shows: - which use cases were **added**, **removed** or **changed** compared with the deploy production points to; - for each changed use case, the files and the commits that touched it; - in Telemetry, every run of a case Run runs is a span with `sypnia.case` and `sypnia.case.outcome`, so «Order for tomorrow got slower after dpl_7h3k» is one view ([Use cases and places](https://telemetry.docs.sypnia.com/concepts/use-cases-and-places)). Events carry the trace from one case to the next, so a chain of cases is one trace. Reviewers see the use-case diff in the pull request comment of a [preview](https://run.docs.sypnia.com/deploys/previews), next to the code diff. --- ## SDK, CLI and MCP > The @sypnia/run package, the run command and the MCP tools for agents. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/tools/ - [The @sypnia/run package](/tools/sdk/): One npm package with subpaths for config, functions, jobs, queues and the API client. - [The CLI](/tools/cli/): Every run command, its flags and how it signs in. - [MCP for agents](/tools/mcp/): The Run MCP server: how an agent signs in, the tools it gets and the ones that need your approval. --- ## The @sypnia/run package > One npm package with subpaths for config, functions, jobs, queues and the API client. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/tools/sdk/ For agents: @sypnia/run package subpaths: /function (handler), /job (job), /queue (queue().send, consumer), /client (typed API client createRun: deploys.create/wait…), CLI via npx @sypnia/run; auth by device-flow session, PAT or deploy token; ESM with types; Node 20+, Bun, Deno. ```bash npm install @sypnia/run ``` | Import | For | | ---------------------- | ------------------------------------------------------------------------------------------- | | `@sypnia/run/function` | `handler()` for [functions](https://run.docs.sypnia.com/apps/functions) | | `@sypnia/run/job` | `job()` for [scheduled jobs](https://run.docs.sypnia.com/jobs/cron) | | `@sypnia/run/queue` | `queue(name).send()` and `consumer()` for [queues](https://run.docs.sypnia.com/jobs/queues) | | `@sypnia/run/client` | the typed API client, for scripts and your own tools | | `npx @sypnia/run` | [the CLI](https://run.docs.sypnia.com/tools/cli) | ```ts import { createRun } from '@sypnia/run/client'; const run = createRun({ token: process.env.SYPNIA_RUN_TOKEN }); const deploy = await run.deploys.create({ app: 'laespiga', env: 'preview', source: { git: { ref: 'feature/menu' } } }); await run.deploys.wait(deploy.id); ``` The client signs in the same ways as the CLI: a saved device-flow session, a personal access token or a deploy token. It is ESM only, with types, and works in Node 20+, Bun and Deno. --- ## The CLI > Every run command, its flags and how it signs in. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/tools/cli/ For agents: Run CLI commands: login/logout/whoami (device flow, session in ~/.config/sypnia mode 600), use , deploy [--env --local --prebuilt], deploys, promote/rollback, logs, env set|unset|ls|pull|apply, domains add|ls|rm, git connect|disconnect, jobs ls|runs|trigger, queues ls|dlq --replay, tokens create|ls|revoke, telemetry connect, engine install|upgrade|uninstall; --json, --token/SYPNIA_RUN_TOKEN; exit codes 0/1/2/3/4. `npx @sypnia/run `, or `run ` after `npm install -g @sypnia/run`. | Command | What it does | | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | `login` · `logout` · `whoami` | Sign in with the device flow; the session is saved in `~/.config/sypnia/` (mode 600) | | `use ` | Point the CLI at a self-hosted engine **\[Engine]** | | `deploy [--env] [--local] [--prebuilt]` | Build and deploy the current folder | | `deploys [--app] [--env]` | List deploys | | `promote --env` · `rollback [--to]` | Release a deploy, or go back | | `logs [--deploy] [--job] [--since] [--level] [--where]` | Read or follow logs | | `env set\|unset\|ls\|pull\|apply` | Environment variables and secrets | | `domains add\|ls\|rm` | Custom domains | | `git connect\|disconnect` | Deploy from a repository | | `jobs ls\|runs\|trigger` | Scheduled jobs | | `queues ls\|dlq [--replay]` | Queues and their dead-letter queues | | `cases ls\|trigger \|dlq [--replay]` | The app's use cases: what each one starts on, run a scheduled case now, and a listener's dead letters | | `cases keys create\|ls\|revoke` | Keys for one external case (`syp_rck_…`) | | `tokens create\|ls\|revoke` | Deploy tokens | | `telemetry connect` | Link the app to Sypnia Telemetry | | `engine install\|upgrade\|uninstall` | Manage a self-hosted engine **\[Engine]** | Every command accepts `--json` for scripts and agents, and `--token` (or `SYPNIA_RUN_TOKEN`) instead of the saved session. Exit codes: `0` success, `1` failure, `2` wrong usage, `3` not signed in, `4` permission denied. --- ## MCP for agents > The Run MCP server: how an agent signs in, the tools it gets and the ones that need your approval. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/tools/mcp/ For agents: Run MCP server at https://mcp.run.sypnia.com: OAuth with DCR + PKCE (MCP authorization) or PAT with the Sypnia account; tools list_apps, get_app, list_deploys, get_deploy, deploy (approval for production), promote/rollback (approval for production), get_logs, list_env/set_env (secrets never returned; approval on production), add_domain, trigger_job, replay_dlq (approval); pending actions confirmed in console or run approve ; calls audited; engine serves /mcp with its API keys. `https://mcp.run.sypnia.com` is one MCP server for all your apps. An agent signs in with your Sypnia account through OAuth (the MCP authorization flow, with dynamic client registration and PKCE) or a personal access token, and works on the projects your organizations give it. ```bash claude mcp add --transport http sypnia-run https://mcp.run.sypnia.com ``` ### Tools | Tool | Does | Needs approval | | ---------------------------- | -------------------------------------------------------------- | ----------------------- | | `list_apps`, `get_app` | apps of a project, with their environments and current deploys | no | | `list_deploys`, `get_deploy` | deploys and their status, use-case diff and build logs | no | | `deploy` | build and deploy a Git ref to an environment | to production | | `promote`, `rollback` | release a deploy | always for production | | `get_logs` | logs with filters | no | | `list_env`, `set_env` | variables; secret values are never returned | `set_env` on production | | `add_domain` | attach a domain | yes | | `trigger_job`, `replay_dlq` | operations | yes | A tool marked «needs approval» returns a pending action that you confirm in the console or with `run approve `; the agent sees the result after you do. Every call is recorded with the agent's client name. ### Self-hosted **\[Engine]** The engine serves the same tools at `/mcp` on its own address, authorized with its API keys. --- ## API reference > The Run API: addresses, authentication, errors, pagination and limits. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/api/ For agents: Run API base https://run.api.sypnia.com/v1 (engine: /v1); Bearer auth with Sypnia session, PAT syp_pat_, deploy token syp_rdt_, engine API key syp_rk_; scopes run:read/run:deploy/run:admin; error shape {error:{code,message,doc_url}}; codes 400 invalid_request/invalid_config, 401, 403 forbidden/approval_required, 404, 409 conflict/deploy_not_ready/domain_taken/name_taken, 402 credits_exhausted, 429 rate_limited, 5xx; cursor pagination; Idempotency-Key 24 h. Base address: `https://run.api.sypnia.com/v1` **\[Cloud]**, or `/v1` **\[Engine]**. Requests and responses are JSON over HTTPS. ### Authentication `Authorization: Bearer `, where the token is one of: | Token | Gets | Scopes | | ----------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------- | | Sypnia session (console, device flow) | what your organization role allows | `run:read`, `run:deploy`, `run:admin` per role | | Personal access token (`syp_pat_…`) | the scopes you gave it, within your role | chosen at creation | | Deploy token (`syp_rdt_…`) | deploy one app to listed environments | `run:deploy` on that app | | Engine API key (`syp_rk_…`) **\[Engine]** | the engine's admin or a scope you chose | per key | | Case key (`syp_rck_…`) | call one case that starts `external`, at `POST /hooks/` of the app; nothing else | that case only | ### Errors Every error has the same shape: ```json { "error": { "code": "deploy_not_ready", "message": "dpl_7h3k is still building.", "doc_url": "https://run.docs.sypnia.com/api#errors" } } ``` | Status | Codes | | ------ | ------------------------------------------------------------ | | 400 | `invalid_request`, `invalid_config` | | 401 | `unauthorized` | | 403 | `forbidden`, `approval_required` | | 404 | `not_found` | | 409 | `conflict`, `deploy_not_ready`, `domain_taken`, `name_taken` | | 402 | `credits_exhausted` **\[Cloud]** | | 429 | `rate_limited` (with `Retry-After`) | | 5xx | `internal`, `aws_unavailable` | ### Pagination Lists return `{ "data": [...], "next": "" }`; pass `?cursor=` for the next page and `?limit=` (1–100, default 20). ### Idempotency `POST` requests accept `Idempotency-Key`; a repeat within 24 hours returns the first result. - [Endpoints](/api/endpoints/): Apps, deploys, releases, environment, domains, jobs, queues, logs and tokens. --- ## Endpoints > Apps, deploys, releases, environment, domains, jobs, queues, logs and tokens. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/api/endpoints/ For agents: Run API endpoints: apps (GET/POST/PATCH/DELETE /apps), deploys (POST /apps/{app}/deploys with git ref, upload or prebuilt; POST /uploads signed URL; GET deploys; GET /deploys/{id}; build logs SSE), releases (POST environments/{env}/release {deploy, gradual, reason}, rollback, releases history), deploy statuses, vars (GET/PUT/DELETE, secrets never returned), domains (POST returns records), tokens, jobs (runs, trigger), queues (dlq, replay), logs (filters, follow), approvals (GET /approvals, POST decision). ### Apps | Method and path | Does | | -------------------- | --------------------------------------------------------------------- | | `GET /apps?project=` | List apps | | `POST /apps` | Create an app: `{ project, name, kind?, framework? }` | | `GET /apps/{app}` | One app, with environments and the deploy each points to | | `PATCH /apps/{app}` | Change settings from the config file's fields | | `DELETE /apps/{app}` | Delete the app, its deploys and resources (asks for `?confirm=`) | ### Deploys and releases | Method and path | Does | | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | `POST /apps/{app}/deploys` | Start a deploy: `{ env, source: { git: { ref } } \| { upload: uploadId } \| { prebuilt: uploadId } }` | | `POST /uploads` | Get a signed URL to upload a source or prebuilt archive | | `GET /apps/{app}/deploys` | List deploys (`?env=`, `?status=`) | | `GET /deploys/{deploy}` | One deploy: status, build, address, use-case diff | | `GET /deploys/{deploy}/build/logs` | Build logs (`?follow=true` streams as server-sent events) | | `POST /apps/{app}/environments/{env}/release` | `{ deploy, gradual?, reason? }` | | `POST /apps/{app}/environments/{env}/rollback` | `{ to? }` | | `GET /apps/{app}/environments/{env}/releases` | Release history | Deploy statuses: `queued`, `building`, `deploying`, `ready`, `failed`, `timed_out`, `canceled`. ### Environment, domains and tokens | Method and path | Does | | ---------------------------------------------------------------- | -------------------------------------------------------- | | `GET /apps/{app}/environments/{env}/vars` | Variables (secret values are never returned) | | `PUT /apps/{app}/environments/{env}/vars/{name}` | `{ value, secret?, build? }` | | `DELETE /apps/{app}/environments/{env}/vars/{name}` | Remove | | `POST /apps/{app}/domains` | `{ domain, env, redirect? }`, returns the records to add | | `GET /apps/{app}/domains`, `DELETE /apps/{app}/domains/{domain}` | List, remove | | `POST /apps/{app}/tokens`, `GET`, `DELETE /tokens/{id}` | Deploy tokens | ### Jobs, queues and logs | Method and path | Does | | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------- | | `GET /apps/{app}/jobs`, `GET /apps/{app}/jobs/{job}/runs` | Jobs and their runs | | `POST /apps/{app}/jobs/{job}/trigger` | Run now | | `GET /apps/{app}/queues`, `GET /apps/{app}/queues/{q}/dlq`, `POST /apps/{app}/queues/{q}/dlq/replay` | Queues | | `GET /apps/{app}/logs` | `?env=&deploy=&job=&since=&level=&where=&follow=` | ### Approvals | Method and path | Does | | ---------------------- | ----------------------------------- | | `GET /approvals` | Pending actions started by agents | | `POST /approvals/{id}` | `{ decision: "approve" \| "deny" }` | The OpenAPI document of this API is in the engine's repository, at `spec/openapi.yaml`. --- ## Architecture > How Sypnia Run is built: its parts, where Rust and TypeScript run, and how they connect. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/ For agents: Run architecture: control plane (Run API in Rust on Lambda, Postgres state, SQS work queue, builder on CodeBuild, deployer in Rust on Lambda) vs data plane (CloudFront + edge router CloudFront Function with KeyValueStore → S3 files / Lambda / Fargate); control-plane outage stops deploys but never takes apps offline; adapters in TypeScript inside builds; console private. Run has two planes. The **control plane** decides: it keeps apps, deploys and environments, runs builds and tells AWS what to create. The **data plane** serves: CloudFront, S3, Lambda and Fargate answer your visitors without passing through the control plane, so a control-plane outage stops new deploys but never takes your app offline. **Figure**: Sypnia Run: who calls it, its parts, and the AWS services your app runs on. 1. The CLI, CI or an agent calls the Run API. 2. The API records the deploy and queues a build. 3. The builder runs your build in an isolated CodeBuild machine and writes artifacts. 4. The deployer turns artifacts into AWS resources and switches the environment at the edge. 5. Visitors reach CloudFront, which serves S3 files or calls the deploy's Lambda or Fargate service directly. The CLI, CI or an agent call the Run API, which stores apps, deploys and environments in Postgres and queues work in SQS. The builder runs builds in AWS CodeBuild and writes artifacts to S3. The deployer creates Lambda versions, Fargate services, EventBridge schedules and SQS queues, and updates the edge router's key-value store. Visitors reach CloudFront, whose edge function reads that store and sends each request to the right deploy's files in S3 or to its Lambda or Fargate service. | Part | Language | Runs on | Open source | | ------------------ | ------------------------------------------------------------ | ------------------------- | ----------- | | Run API | Rust (axum) | AWS Lambda | yes | | Builder | Rust orchestrator + build images | AWS CodeBuild | yes | | Deployer | Rust | AWS Lambda, driven by SQS | yes | | Framework adapters | TypeScript (`@sypnia/run`) | inside the build | yes | | Edge router | JavaScript (CloudFront Functions) + CloudFront KeyValueStore | CloudFront | yes | | Console | TypeScript (React) | Sypnia Cloud | no | ### Functions or containers Run has two ways to run the server part of an app, and they are for different things. - **Functions, by default.** Every app runs on functions (AWS Lambda) unless it asks otherwise. A function runs only while it answers a request: you pay per request and for the time it takes, and when nobody visits, it scales to zero and costs nothing. - **A container, only when the app asks for it.** An always-on container (AWS Fargate) is for what a function cannot do: work that takes longer than 15 minutes, WebSockets or other connections that stay open, workers that must always be running, or a container image of your own that needs a long-lived process. A container is billed for every hour it is on, whether or not anyone visits, so it is a choice each app makes, never the default. An app opts in with `kind = "container"` and `runtime = "fargate"` in its table of `sypnia.toml` ([The configuration file](https://run.docs.sypnia.com/config/run-file#a-container-on-fargate)); without `runtime = "fargate"`, even a container image runs as a function that scales to zero ([Containers](https://run.docs.sypnia.com/apps/containers)). The containers of a cell share **one load balancer**, the one that takes their traffic from CloudFront. No app pays for a load balancer of its own. - [Request paths](/architecture/request-paths/): What happens, call by call, for a deploy, a release and a visitor's request. - [Data model](/architecture/data-model/): The control plane's tables: projects, apps, environments, deploys, builds, releases, variables and domains. - [Reference implementation on AWS](/architecture/reference-implementation-aws/): Every AWS service Run uses, what for, and how it is set up. - [Isolation](/architecture/isolation/): How builds and apps of different customers are kept apart in Sypnia Cloud. - [Failures and scaling](/architecture/failures-and-scaling/): What happens when each part fails, and how Run grows with traffic. - [Codebase](/architecture/codebase/): How the open-source repository is organized. --- ## Request paths > What happens, call by call, for a deploy, a release and a visitor's request. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/request-paths/ For agents: Run request paths: deploy (API checks scopes and credits, writes deploys/builds rows, queues build; builder starts CodeBuild with per-project role and signed URLs; deployer uploads to s3 deploys//, publishes Lambda version or Fargate task definition, schedules, queues; health check; ready; auto release); release (deployer writes host→deploy to CloudFront KeyValueStore, shifts Fargate target group; previous deploy intact); visitor (CloudFront TLS, edge CloudFront Function reads KVS and rewrites to deploy origin path; S3 cached, Lambda function URL with OAC, or Fargate via load balancer; real-time logs). ### A deploy 1. `POST /v1/apps/laespiga/deploys` reaches the Run API with a token. The API checks the token's scopes and the organization's credits, writes a `deploys` row (`queued`) and a `builds` row, and sends a message to the build queue. 2. The builder takes the message, starts a CodeBuild build with the build role of that project, and passes a signed URL to fetch the source and a signed prefix to write artifacts. 3. CodeBuild streams logs; the builder copies them to the build's log and marks the build `succeeded` or `failed`. 4. On success the deployer creates the deploy's resources: uploads files under `s3://…/deploys//`, publishes a Lambda version or registers a Fargate task definition, creates schedules and queues the first time. Resources are tagged with project, app and deploy. 5. The deployer calls the health check at the deploy's own address and marks the deploy `ready`. 6. If the environment follows this deploy automatically, the release step runs. ### A release 1. `POST …/environments/production/release` (or step 6 above) checks the deploy is `ready`. 2. The deployer writes `laespiga.sypnia.app → dpl_7h3k` (and every custom domain of the environment) to the CloudFront KeyValueStore, and for Fargate shifts the load balancer's target group. 3. The release row is written; the previous deploy stays intact for rollbacks. ### A visitor's request 1. The browser asks `https://laespiga.sypnia.app/pedidos`. 2. CloudFront terminates TLS and runs the edge router (a CloudFront Function): it reads the host's deploy from the KeyValueStore and rewrites the request to that deploy's origin path. 3. Static paths are served from S3 (cached). Dynamic paths go to the deploy's Lambda function URL (signed by CloudFront with origin access control) or to the Fargate service behind the load balancer. 4. The response returns through CloudFront. The request log line is written by CloudFront's real-time logs to the log pipeline. --- ## Data model > The control plane's tables: projects, apps, environments, deploys, builds, releases, variables and domains. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/data-model/ For agents: Run control-plane data model in Postgres: apps, environments (current_deploy_id), builds, deploys (immutable, resources, env snapshot ref, use_case_diff), releases (from/to/actor/reason/gradual), env_vars (metadata only; values in SSM Parameter Store), domains (certificate ARN), jobs, queues, job_runs, tokens (hashed), approvals, audit_log; artifacts in S3; prefixed random ids; orgs/projects from the Sypnia account. The control plane keeps its state in Postgres. Build artifacts live in S3, secrets in AWS Systems Manager Parameter Store, and none of them in the database. | Table | Holds | Key fields | | ---------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `apps` | one row per app | `id`, `project_id`, `name`, `kind`, `framework`, `settings` (the resolved config) | | `environments` | production, preview, custom | `app_id`, `name`, `current_deploy_id`, `auto_release`, `protection` | | `builds` | each build | `id`, `app_id`, `source` (commit or upload), `status`, `started_at`, `finished_at`, `log_ref` | | `deploys` | each immutable deploy | `id`, `app_id`, `build_id`, `env_snapshot_ref`, `resources` (ARNs, prefixes, digests), `status`, `use_case_diff` | | `releases` | every pointer change | `environment_id`, `from_deploy_id`, `to_deploy_id`, `actor`, `reason`, `gradual`, `created_at` | | `env_vars` | names and metadata | `environment_id`, `name`, `secret`, `build`, `parameter_arn` (the value is in Parameter Store) | | `domains` | custom domains | `app_id`, `environment_id`, `domain`, `certificate_arn`, `status` | | `jobs`, `queues` | declared per app | `app_id`, `name`, `schedule` or queue settings, AWS resource names | | `job_runs` | each run | `job_id`, `deploy_id`, `status`, `started_at`, `finished_at` | | `tokens` | deploy tokens | `app_id`, `environments`, `hash`, `last_used_at` | | `approvals` | actions waiting for a person | `actor`, `action`, `payload`, `status` | | `audit_log` | every change | `actor`, `action`, `target`, `at` | Identifiers are prefixed (`app_`, `dpl_`, `bld_`, `rel_`) and random. Organizations, members and projects come from the Sypnia account: Run keeps only `project_id` and checks membership on every call. --- ## Reference implementation on AWS > Every AWS service Run uses, what for, and how it is set up. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/reference-implementation-aws/ For agents: Run on AWS: CloudFront (multi-tenant distribution per cell, custom domains as tenants with ACM certs), CloudFront Functions + KeyValueStore (edge router host→deploy), S3 (one bucket per cell, prefixes, OAC), Lambda (API, deployer, SSR, functions, containers, consumers; version per deploy, alias per environment, function URLs signed by CloudFront), Fargate/ECS behind per-cell ALB with host rules, ECR per app, CodeBuild with per-project build role, EventBridge Scheduler, SQS (FIFO for deploy steps, standard for app queues + DLQ), SSM Parameter Store SecureString, KMS key per project, ACM, CloudWatch Logs, RDS Postgres Multi-AZ; cells = AWS accounts holding a share of projects. **Figure**: Sypnia Run on AWS: the control plane on the left, the data plane your visitors reach on the right. The control plane is a Lambda function for the API behind CloudFront, a Postgres database, SQS queues for builds and deploys, CodeBuild for builds, and a Lambda deployer. The data plane is one CloudFront distribution with an edge function and a key-value store, an S3 bucket of artifacts, Lambda functions and Fargate services per app, EventBridge Scheduler for jobs and SQS for app queues. Secrets live in Parameter Store, encrypted with KMS keys per project. | Service | Used for | Setup | | ------------------------------------ | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | Amazon CloudFront | every app's address, TLS, caching | multi-tenant distribution per cell; custom domains as distribution tenants with their own ACM certificates | | CloudFront Functions + KeyValueStore | the edge router: host → deploy | one KVS per cell; updates are the release step | | Amazon S3 | build sources, artifacts, static files, build cache | one bucket per cell, prefix per project/app/deploy; only CloudFront (origin access control) reads static files | | AWS Lambda | the Run API, the deployer, SSR servers, functions, Lambda containers, queue consumers | one function per app server or function, a version per deploy, alias per environment; function URLs signed by CloudFront | | AWS Fargate (ECS) | always-on containers | one service per app and environment, behind an Application Load Balancer per cell with host-based rules | | Amazon ECR | container images | a repository per app, images by digest per deploy | | AWS CodeBuild | builds | one project per build image; each build assumes the project's build role | | Amazon EventBridge Scheduler | scheduled jobs | one schedule per job and environment, targeting the job's function or an ECS task | | Amazon SQS | the control plane's work queues; app queues and their dead-letter queues | FIFO for deploy steps per app, standard for app queues | | AWS Systems Manager Parameter Store | variables and secrets | `SecureString` per variable, path per project/app/environment | | AWS KMS | encrypting secrets and artifacts | one key per project | | AWS Certificate Manager | certificates for custom domains | DNS validation, automatic renewal | | Amazon CloudWatch Logs | app and build logs | log group per app and environment, retention per plan | | Amazon RDS for PostgreSQL | the control plane's state | Multi-AZ in Sypnia Cloud | ### Cells Sypnia Cloud runs projects in **cells**: AWS accounts that each hold a share of the projects, with their own CloudFront distribution, bucket, load balancer and quotas. A cell's failure or quota limit affects only its projects, and a busy project can be moved to a cell of its own. [Isolation](https://run.docs.sypnia.com/architecture/isolation) explains the boundaries inside a cell. --- ## Isolation > How builds and apps of different customers are kept apart in Sypnia Cloud. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/isolation/ For agents: Run isolation in Cloud: builds in fresh per-build CodeBuild containers with per-project IAM role (read own source, write own prefix, no Run API, no SSM, no control-plane network), secrets only when marked build-time; apps in Firecracker micro-VMs (Lambda, Fargate) with per-app execution/task roles limited to own parameters and project KMS key; static files per-deploy prefixes read only by CloudFront OAC; no shared VPC for functions, Fargate security groups allow only the ALB; function URLs require CloudFront signing; customer apps on sypnia.app (Public Suffix List) never sypnia.com; shared: cell CloudFront, ALB, quotas, with per-project limits; dedicated cells for hard separation. In Sypnia Cloud many customers' code runs in the same AWS accounts. These are the walls between them. ### Builds - Every build runs in its own CodeBuild container, created for that build and destroyed after it. Nothing persists between builds except the cache Run restores explicitly, which is per app. - The build assumes a **per-project IAM role** that can read only its source archive and write only under its own artifact prefix. It cannot call the Run API, read other prefixes, read Parameter Store or reach the control plane's network. - Secrets reach a build only when marked for build time, injected as environment variables for that build alone and masked in logs. - Build containers have outbound internet (package registries) and no inbound access. ### Running apps - **Lambda** runs each function in Firecracker micro-VMs; Run creates functions per app, with an **execution role per app** that can read only that app's parameters and decrypt only with its project's KMS key. - **Fargate** tasks also run in Firecracker micro-VMs, one task definition and task role per app. - **Static files** are under per-deploy prefixes that only CloudFront reads; an app cannot list or read another app's files. - **Networking:** functions run outside any shared VPC by default; Fargate tasks are in per-cell subnets with security groups that allow traffic only from the load balancer. Apps cannot reach each other or the control plane. - **Origin protection:** a Lambda function URL accepts only CloudFront-signed requests (origin access control), so nobody can skip the edge router and call another app's server directly. ### Addresses and cookies Customer apps are served on `sypnia.app`, a domain listed in the Public Suffix List, so browsers treat `ana.sypnia.app` and `laespiga.sypnia.app` as separate sites and no app can set cookies for another. Sypnia's own products and sessions live on `sypnia.com`, which customer code never serves. ### What is shared The CloudFront distribution, the load balancer and AWS account quotas of a cell. Run limits each project's share (concurrency, tasks, build minutes) so one project cannot exhaust a cell. Customers who need hard separation get a **dedicated cell** (their own AWS account), priced separately ([Design decisions](https://run.docs.sypnia.com/reference/decisions)). --- ## Failures and scaling > What happens when each part fails, and how Run grows with traffic. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/failures-and-scaling/ For agents: Run failures: failed build (production untouched), failed health check (resources removed, production untouched), API/DB outage (apps keep serving; no deploys), deployer step retries (idempotent, FIFO per app), lost Git webhook (polling fallback), certificate pending, Lambda regional issue (static cache keeps serving), Fargate task crash (replaced, unhealthy taken out of LB), DLQ pages on-call. Scaling: CloudFront for static, Lambda per request up to max_instances (min_instances avoids cold starts), Fargate autoscaling on CPU/requests, builds parallel up to plan concurrency then queued, control plane stateless proportional to deploys. ### When something fails | What fails | Effect | What Run does | | ------------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | A build | the deploy is `failed` | production is untouched; the error and the last log lines are reported to the CLI, the pull request and the console | | A deploy's health check | the deploy is `failed` | resources of that deploy are removed after a grace period; production is untouched | | The Run API or its database | no new deploys or releases | apps keep serving: the data plane does not call the control plane | | A step of the deployer | the step is retried from the queue | deploy steps are idempotent and per app in order (FIFO); after retries the deploy is marked `failed` | | A Git webhook is lost | a push is not seen | Run also polls connected repositories every few minutes and deploys what it missed | | A certificate cannot be issued | the domain stays `pending` | the app keeps answering at its other addresses; the console shows the missing record | | A Lambda region problem | requests to dynamic paths fail | static paths keep being served from CloudFront's cache; Run reports the incident | | A Fargate task crashes | ECS starts a new one | the load balancer stops sending traffic to it while it is unhealthy | Messages that fail every retry go to a dead-letter queue that pages the on-call engineer in Sypnia Cloud; nothing is dropped silently. ### Scaling - **Static files** scale with CloudFront; nothing to do. - **Lambda** scales per request up to the function's `max_instances` (or the cell's quota). `min_instances` removes cold starts at a cost. - **Fargate** services scale between `min_instances` and `max_instances` on CPU and request count. - **Builds** run in parallel up to the plan's concurrent builds; extra builds wait in the queue in order. - **The control plane** is stateless Lambda over Postgres; its load is proportional to deploys, not to your visitors. --- ## Codebase > How the open-source repository is organized. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/architecture/codebase/ For agents: Run codebase: repo sypnia-run (in Sypnia Git, with a read-only mirror on GitHub): crates core, api (axum, /mcp), builder, deployer, edge (CloudFront Function + KVS format), aws (SigV4 clients), server (Lambda adapter, local server, CLI binary); images (build images, buildpacks); deploy (CloudFormation: engine, cell, app stack); spec (openapi.yaml, config JSON Schema); packages/run (@sypnia/run: CLI, the reader of the [run] table of sypnia.toml, framework adapters, API client). The engine lives in one open-source repository, `sypnia-run`, in Sypnia Git with a read-only mirror on GitHub. ```text sypnia-run/ ├── crates/ │ ├── core/ config, project registry, auth context (Sypnia tokens, API keys, deploy tokens), errors, audit │ ├── api/ the HTTP API (axum): apps, deploys, releases, env, domains, jobs, queues, logs, approvals, /mcp │ ├── builder/ starts and watches builds (CodeBuild or local), log copying, cache keys │ ├── deployer/ turns artifacts into AWS resources, releases at the edge, health checks, rollbacks │ ├── edge/ the CloudFront Function and the KeyValueStore format │ ├── aws/ small SigV4 clients for the AWS APIs it calls │ └── server/ the binary: Lambda adapter, local HTTP server, the `sypnia-run` command ├── images/ the build images (Node, Python, Go) and the buildpacks ├── deploy/ CloudFormation templates: the engine, a cell, an app stack ├── spec/ openapi.yaml and the config file's JSON Schema └── docs/ ARCHITECTURE.md ``` The TypeScript side is `@sypnia/run` in the same repository under `packages/run`: the CLI, the reader of the `[run]` table of `sypnia.toml`, the adapters (one folder per framework) and the API client. Adapters are tested by building real example apps of each framework in CI. --- ## Self-hosting > Install the Run engine in your own AWS account, or try it locally with Docker. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/self-hosting/ Self-hosted, Run deploys your apps into **your** AWS account: you own every resource and pay AWS directly. The engine itself is a CloudFormation stack in that account. - [Install on AWS](/self-hosting/aws/): The engine's CloudFormation stack, its parameters, the permissions it needs and how to remove it. - [Try it locally with Docker](/self-hosting/docker/): Run the engine on your machine to try the API, the CLI and builds, deploying to a local target. - [Configuration](/self-hosting/configuration/): The engine's settings: environment variables of its functions and their defaults. - [Upgrades and backups](/self-hosting/upgrades/): Upgrading the engine, what is backed up and how to restore. --- ## Install on AWS > The engine's CloudFormation stack, its parameters, the permissions it needs and how to remove it. Applies to: the Sypnia engine (open source, self-hosted). Source: https://run.docs.sypnia.com/self-hosting/aws/ For agents: Run engine on AWS: npx @sypnia/run engine install --region [--domain --certificate-arn] deploys published template deploy/engine.yaml; creates Lambda run-api and run-deployer, RDS Postgres db.t4g.micro (or --database-url), S3 bucket, CodeBuild projects, SQS + DLQs, CloudFront with edge router, ALB on first Fargate app, KMS key + SSM paths, IAM roles (least privilege, resources tagged sypnia-run); parameters Domain, CertificateArn, AppsDomain (wildcard for apps), DatabaseUrl, ContainerSupport, AlarmEmail; uninstall deletes app stacks then engine, keeps bucket and DB unless --delete-data. ```bash npx @sypnia/run engine install --region us-east-1 [--domain run.example.com --certificate-arn arn:aws:acm:…] ``` The command packages nothing on your machine: it deploys the published template `deploy/engine.yaml` of the engine's version with the parameters you give. ### What the stack creates | Resource | Purpose | | ----------------------------------------------------------------------------------- | ---------------------------------------- | | Lambda functions `run-api`, `run-deployer` | the engine | | An RDS PostgreSQL instance (`db.t4g.micro`), or your database with `--database-url` | the engine's state | | An S3 bucket `sypnia-run--` | sources, artifacts, static files, caches | | CodeBuild projects | builds in your account | | SQS queues and their dead-letter queues | the engine's work | | A CloudFront distribution with the edge router | every app's address | | An Application Load Balancer, created on the first Fargate app | containers | | A KMS key and Parameter Store paths | secrets | | IAM roles: API, deployer, build, and per-app execution roles created on demand | least privilege | ### Parameters | Parameter | Default | Meaning | | ------------------ | ----------- | -------------------------------------------------------------------------------------------- | | `Domain` | none | The engine's own address (`run.example.com`); without it, the CloudFront address | | `CertificateArn` | none | Certificate for `Domain`, in us-east-1 | | `AppsDomain` | none | A wildcard domain for apps (`*.apps.example.com`), so each app gets `.apps.example.com` | | `DatabaseUrl` | creates RDS | Use an existing Postgres 14+ | | `ContainerSupport` | `true` | Creates the VPC pieces for Fargate on first use | | `AlarmEmail` | none | Where dead-letter and error alarms are sent | ### Permissions Installing needs permission to create the resources above. Day to day, the engine's roles can only manage resources tagged `sypnia-run`, in the stack's region. ### Removing it `npx @sypnia/run engine uninstall` deletes every app stack first (asking for confirmation), then the engine's stack. The S3 bucket and the database are kept unless you add `--delete-data`. --- ## Try it locally with Docker > Run the engine on your machine to try the API, the CLI and builds, deploying to a local target. Applies to: the Sypnia engine (open source, self-hosted). Source: https://run.docs.sypnia.com/self-hosting/docker/ For agents: Run locally with Docker: clone sypnia-run, docker compose up (engine, Postgres, LocalStack, local edge proxy), run use http://localhost:7400, run deploy --target local serves at http://.localhost:7480; for trying and developing, not production. The engine's real target is AWS, but you can try the API, the CLI and builds on your machine: ```bash git clone https://github.com/sespinosav/sypnia-run && cd sypnia-run docker compose up npx @sypnia/run use http://localhost:7400 npx @sypnia/run deploy --target local ``` The compose file starts the engine, Postgres and **LocalStack** (an AWS emulator) and a local edge proxy. Deploys with `--target local` run static sites and functions on `http://.localhost:7480`, and containers with Docker. It is for trying Run and developing the engine, not for production. > **Note** > > The repository lives in Sypnia Git, like all of Sypnia's code, with a read-only mirror on GitHub at the address above. --- ## Configuration > The engine's settings: environment variables of its functions and their defaults. Applies to: the Sypnia engine (open source, self-hosted). Source: https://run.docs.sypnia.com/self-hosting/configuration/ For agents: Run engine configuration env vars: SYPNIA_RUN_DATABASE_URL (Secrets Manager), SYPNIA_RUN_BUCKET, SYPNIA_RUN_APPS_DOMAIN, SYPNIA_RUN_BUILD_TIMEOUT (1800), SYPNIA_RUN_MAX_CONCURRENT_BUILDS (4), SYPNIA_RUN_DEPLOY_RETENTION (30 days, last 10 per env kept), SYPNIA_RUN_LOG_RETENTION (30), SYPNIA_RUN_TELEMETRY_URL, SYPNIA_RUN_ADMIN_KEYS (SSM path, hashed); API keys via engine keys create --scope. The stack sets these on the engine's functions; change them with a stack update. | Variable | Default | Meaning | | ---------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------- | | `SYPNIA_RUN_DATABASE_URL` | the stack's RDS | Postgres connection string, from Secrets Manager | | `SYPNIA_RUN_BUCKET` | the stack's bucket | Artifacts and static files | | `SYPNIA_RUN_APPS_DOMAIN` | none | Wildcard domain for app addresses | | `SYPNIA_RUN_BUILD_TIMEOUT` | `1800` | Seconds before a build is stopped | | `SYPNIA_RUN_MAX_CONCURRENT_BUILDS` | `4` | Builds at once; the rest wait | | `SYPNIA_RUN_DEPLOY_RETENTION` | `30` | Days to keep deploys not pointed to by any environment (the last 10 per environment are always kept) | | `SYPNIA_RUN_LOG_RETENTION` | `30` | Days of app logs in CloudWatch | | `SYPNIA_RUN_TELEMETRY_URL` | none | A Sypnia Telemetry endpoint to forward logs and releases | | `SYPNIA_RUN_ADMIN_KEYS` | the one created at install | Parameter Store path of the engine's API keys (hashed) | API keys of a self-hosted engine are created with `npx @sypnia/run engine keys create --scope run:deploy` and shown once. --- ## Upgrades and backups > Upgrading the engine, what is backed up and how to restore. Applies to: the Sypnia engine (open source, self-hosted). Source: https://run.docs.sypnia.com/self-hosting/upgrades/ For agents: Run upgrades: run engine upgrade [--to] updates stack and runs DB migrations before switching functions; apps not redeployed (engine upgrade --apps when needed). Backups: state in RDS automated backups (7 days), artifacts with S3 versioning, secrets exported with env pull --include-secrets, app data not in Run; restore RDS snapshot and engine reconciles with tagged AWS resources. ### Upgrades ```bash npx @sypnia/run engine upgrade # to the latest version npx @sypnia/run engine upgrade --to 0.4.0 ``` An upgrade updates the engine's stack and runs the database migrations of the new version before switching the functions. Apps are not redeployed; their resources keep running. Each release note says whether an upgrade changes app stacks (then `engine upgrade --apps` updates them one by one). ### Backups | What | Where | Backed up by | | ------------------------- | --------------- | ---------------------------------------------------------- | | The engine's state | Postgres | RDS automated backups (7 days by default) | | Artifacts of kept deploys | S3 | versioning on the bucket | | Secrets | Parameter Store | export with `run env pull --include-secrets` to your vault | | Your apps' data | not in Run | your database and storage | To restore after losing the database, restore the RDS snapshot; the engine reconciles its records with the AWS resources it finds by tag. --- ## Security > Build and runtime isolation, secrets, the threat model and the checklist. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/security/ Run executes code written by its customers, so its security rests on isolation: every build and every app is fenced off from the others and from the control plane. [Isolation](https://run.docs.sypnia.com/architecture/isolation) describes those walls; these pages list the threats they answer and what you can check. - [Threat model](/security/threat-model/): What could go wrong in Sypnia Run, and how each threat is answered. - [Checklist](/security/checklist/): What to check before your app goes to production. --- ## Threat model > What could go wrong in Sypnia Run, and how each threat is answered. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/security/threat-model/ For agents: Run threat model: malicious builds (fresh container, per-project role, no SSM/control plane), malicious apps (per-app roles, per-project KMS, CloudFront-only prefixes, no inter-app network), bypassing the edge (CloudFront-signed function URLs, ALB-only security groups), cookie theft (sypnia.app on PSL), post-install exfiltration (no secrets in builds unless marked, masked), leaked deploy token (scoped, revocable, OIDC), agent mistakes (approval for production), subdomain takeover (names reserved 30 days, detach before DNS removal), DoS (per-project limits, Shield Standard), compromised control plane (no clear secrets, tag-scoped roles, audit). security@sypnia.com. | Threat | Answer | | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | A malicious build reads another customer's code or secrets | fresh container per build; per-project build role limited to its own prefixes; no Parameter Store or control-plane access | | A malicious app reads another app's data or files | per-app execution roles, per-project KMS keys, prefixes readable only by CloudFront, no network path between apps | | An app calls another app's server directly, skipping the edge | Lambda function URLs accept only CloudFront-signed requests; Fargate security groups accept only the load balancer | | Deployed code steals Sypnia session cookies | apps are served on `sypnia.app` (Public Suffix List), never on `sypnia.com` | | A dependency with a post-install script exfiltrates build secrets | secrets are not in builds unless marked; marked ones are masked; builds have no access to runtime secrets | | A leaked deploy token is used | scoped to one app and listed environments, revocable, `last_used_at` visible; GitHub OIDC avoids stored tokens | | An agent deploys or rolls back production by mistake | production actions from MCP need a person's approval | | A subdomain takeover after an app is deleted | `.sypnia.app` names are reserved for 30 days after deletion; custom domains are detached from CloudFront before records are removed | | Denial of service on one app exhausts a cell | per-project concurrency and task limits; CloudFront and AWS Shield Standard in front | | A compromised control plane | the control plane holds no app secrets in clear; its roles can manage only tagged resources; actions are audited | Report a security problem to `security@sypnia.com`. --- ## Checklist > What to check before your app goes to production. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/security/checklist/ For agents: Run production checklist: secrets with --secret and no public prefixes; previews on test DB/keys; preview protection; CI with scoped deploy token or GitHub OIDC; agent production approvals; auto_rollback; backward-compatible migrations; security headers; no secrets/PII in logs; DNS account with 2FA or Sypnia Domains. - [ ] Secrets are stored with `--secret`, never as plain variables, and none uses a public prefix (`NEXT_PUBLIC_`, `PUBLIC_`, `VITE_`). - [ ] Previews use a test database and test keys, never production's. - [ ] Preview protection is on (`sypnia` or `password`) if previews show unreleased work. - [ ] CI deploys with a deploy token scoped to one app, or with GitHub OIDC. - [ ] Production releases from agents require approval (the default). - [ ] `release.auto_rollback` is on for apps where a bad deploy costs money. - [ ] Database migrations stay compatible with the previous deploy for one release. - [ ] Your app sets security headers (`Content-Security-Policy`, `Strict-Transport-Security`) in `headers`. - [ ] Logs do not contain tokens, passwords or personal data you do not need. - [ ] Your custom domain's DNS is in an account with two-factor sign-in, or in Sypnia Domains. --- ## Sypnia Cloud > Projects, metering in credits, limits and plans. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cloud/ In Sypnia Cloud, Run belongs to a **project** of your organization, the same project your Data, Files and Mail use. You sign in with your Sypnia account, and what Run uses is paid from your prepaid credits. - [Credits and limits](/cloud/credits-and-limits/): What Run measures, how it is paid with credits, and the limits of each app. - [Plans](/cloud/plans/): How Run is sold: on its own, in the global Sypnia subscription, and with extra capacity. --- ## Credits and limits > What Run measures, how it is paid with credits, and the limits of each app. Applies to: Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cloud/credits-and-limits/ For agents: Run in Sypnia Cloud: metered build minutes, Lambda GB-s + requests, Fargate vCPU-h/GB-h, warm instance-hours, bandwidth GB, deploy storage GB-month, job invocations/queue messages, log GB; console shows usage and projected credit spend; plans include amounts, overage from prepaid credits per item, extra capacity per item per month, no post-paid charges; limits per plan (apps, concurrent builds, timeouts, memory, max_instances, Fargate tasks, domains, kept deploys, log retention) published with plans. ### What is measured | Item | Unit | | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | | Build time | build minutes, by machine size | | Function and server time | GB-seconds of Lambda, and requests | | Always-on containers, only for apps with `runtime = "fargate"` ([Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers)) | vCPU-hours and GB-hours of Fargate | | Warm instances (`min_instances`) | instance-hours | | Bandwidth | GB sent to visitors | | Deploy storage | GB-months of kept deploys and images | | Jobs and queues | invocations and messages | | Logs | GB ingested and stored | The console shows usage per app and per day, and what it will cost in credits by the end of the month at the current pace. ### How it is paid Every plan includes an amount of each item. What goes beyond it is charged against your **prepaid credits**, item by item, at prices published with the plans. You can also buy **extra capacity** for one item (for example more build minutes) for the month. There are no charges after the fact: when credits run out, Run follows the [plan's rules](https://run.docs.sypnia.com/cloud/plans#when-credits-run-out). ### Limits Each plan sets: apps per project, concurrent builds, build timeout, function memory and timeout, `max_instances`, Fargate tasks, custom domains, kept deploys per environment, and log retention. The values are published with the plans. --- ## Plans > How Run is sold: on its own, in the global Sypnia subscription, and with extra capacity. Applies to: Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/cloud/plans/ For agents: Run plans: Run alone (free + paid), global Sypnia subscription tiers including Run, per-item extra capacity; all prepaid (subscription or credits; credits expire 12 months after purchase, oldest spent first, minimum top-up USD 5, no refunds unless the mistake is Sypnia's, and then only in credits); larger of product plan vs global tier per item. When credits run out: notices at 80/100 % (80 % of the balance after the last top-up), 7 days of grace (production, jobs and queues keep running, builds wait), then free-plan limits (exceeding apps show a notice page), nothing deleted; credits restore in minutes. ### Three ways to pay for Run 1. **Run on its own.** A free plan and paid plans for Run alone, like buying a hosting service. 2. **The Sypnia subscription.** One monthly subscription with every Sypnia product, in tiers that each include an amount of Run. 3. **Extra capacity.** On any plan, buy more of one item for the month (build minutes, bandwidth, Fargate hours) without changing plan. Fargate hours count only for apps that ask for an always-on container ([Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers)). Everything is **prepaid**: a monthly subscription paid in advance, or credits you top up in [App](https://app.docs.sypnia.com/account/credits). Credits expire 12 months after you buy them, and the oldest are spent first; the smallest top-up is USD 5; credits are not refunded, except when the mistake is ours, and then only in credits. When a product plan and a global tier both include Run, you get the larger amount of each item. ### When credits run out 1. When **80 %** of your credits are spent, counted from the balance after your last top-up, the owners and billing members get an e-mail and a notice in the app; again at **100 %**. 2. From then on there are **7 days of grace**: production keeps serving, scheduled jobs and queues keep running, and nothing is deleted. New builds wait, and you are reminded every day. 3. After the 7 days, Run moves the project to the free plan's limits: apps that exceed them stop serving (they show a page that says so) and builds stay paused. Nothing is deleted: deploys and settings stay, and adding credits brings everything back in minutes. --- ## Reference > Glossary, design decisions, the changelog and common questions. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/reference/ - [Glossary](/reference/glossary/): Every word these docs use with a fixed meaning. - [Design decisions](/reference/decisions/): The choices behind Sypnia Run, and why each one was made. - [Common questions](/reference/faq/): Short answers to what people ask first about Sypnia Run. - [Changelog](/reference/changelog/): What changed in Sypnia Run, newest first. --- ## Glossary > Every word these docs use with a fixed meaning. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/reference/glossary/ For agents: Sypnia Run vocabulary: app, kind, deploy, build, artifact, environment, release, rollback, preview, edge router, deploy token, job, queue, dead-letter queue, cell, engine, Sypnia Cloud, credits. One name per thing, in these docs, in the console and in the API. **App**: One thing you deploy: a website, an API or a worker. It has one kind and lives in a project. **Area service**: The one service, `-`, that runs all the use cases of an area, unless a case is split into its own. **Artifact**: What a build produces: static files, a function bundle or a container image. **Build**: Running your install and build commands on a clean, isolated machine to produce artifacts. **Cell**: An AWS account of Sypnia Cloud that holds a share of the projects, with its own distribution, bucket and quotas. **Credits**: Prepaid balance of your Sypnia organization, topped up with PayPal, that pays for usage beyond your plan. **Deploy**: An immutable version of an app, with its own address and configuration snapshot. Never edited; a change makes a new one. **Deploy token**: A token that can only deploy one app to the environments it lists, for CI. **Dead-letter queue**: Where messages go after failing every retry, to be inspected or replayed. **Edge router**: The CloudFront function that sends each request to the deploy its environment points to. **Engine**: The open-source Run: the API, the builder and the deployer, installable in your own AWS account. **Environment**: A named pointer to one deploy, with its own variables and domains: production, preview, or one you create. **Job**: Code that runs on a schedule, deployed with its app. **Kind**: What an app is: `static`, `ssr`, `container` or `function`. **Outbox**: The table where an outcome someone listens to is saved, in the same transaction as the data it describes, before it is published. **Preview**: A deploy of a pull request, with its own address and the preview environment's variables. **Queue**: Messages waiting for a consumer to process them in the background. **Release**: Moving an environment to another deploy. Nothing is rebuilt. **Rollback**: A release back to an earlier deploy. **Sweep**: The pass, every minute, that publishes outbox rows the fast path did not send. **Use case**: One thing your app does, on its map in Sypnia Cases. Run runs it from how it starts (`in_app`, `external`, `scheduled`, `event`). --- ## Design decisions > The choices behind Sypnia Run, and why each one was made. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/reference/decisions/ For agents: Run design decisions: (1) customer apps are served on .sypnia.app, a domain in the Public Suffix List, never on sypnia.com where Sypnia's sessions live; (2) isolation: shared cells for every plan, a dedicated cell (own AWS account) on request, priced separately; (3) containers run on Lambda by default, Fargate for WebSockets, long requests or steady traffic; (4) free plan: static sites and functions with small monthly amounts, server-rendered apps with a low max_instances, no always-on containers or min_instances; (5) builds run on AWS CodeBuild; (6) one region, us-east-1, with CloudFront at the edge; (7) licenses: AGPL-3.0 engine, MIT @sypnia/run; (8) acceptable use: no crypto mining, phishing or open proxies; new addresses checked against phishing lists; outbound limits on the free plan. | # | Decision | What Sypnia Run does, and why | | - | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | **The free address** | Every app gets `.sypnia.app`, a domain listed in the Public Suffix List, so browsers treat each app as its own site. Customer code is never served under `sypnia.com`, where Sypnia's sessions live ([Isolation](https://run.docs.sypnia.com/architecture/isolation)). | | 2 | **Isolation in Sypnia Cloud** | Shared cells (AWS accounts with many projects, per-project roles and keys, Firecracker micro-VMs) for every plan; a dedicated cell, an AWS account of their own, for customers who ask for it, priced separately. | | 3 | **Container runtime** | Lambda by default, so an idle app costs nothing; Fargate when the app needs WebSockets, long requests or steady traffic ([Containers](https://run.docs.sypnia.com/apps/containers)). | | 4 | **What the free plan includes** | Static sites and functions with small monthly amounts; server-rendered apps with a low `max_instances`; no always-on containers and no `min_instances`. | | 5 | **Build machines** | AWS CodeBuild: a fresh container per build, metered per minute, no fleet to run ([Builds](https://run.docs.sypnia.com/deploys/builds)). | | 6 | **Regions** | One region, us-east-1, with CloudFront at the edge, so pages are served close to every visitor. | | 7 | **Licenses** | AGPL-3.0 for the engine (a hosted copy must share its changes) and MIT for `@sypnia/run`, like every Sypnia engine and SDK. | | 8 | **Acceptable use** | No crypto mining, phishing or open proxies. New apps' addresses are checked against phishing lists, and the free plan has outbound traffic limits. | --- ## Common questions > Short answers to what people ask first about Sypnia Run. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/reference/faq/ For agents: Run FAQ: vs Vercel/Netlify (plus containers, jobs, queues, one account and bill with Data/Files/Mail/Domains, open-source engine in your AWS); AWS resources visible when self-hosted; no app changes for supported frameworks (containers need PORT + health check); apps keep serving if control plane is down; you can leave. #### How do I use it? In Sypnia Cloud with your Sypnia account, ready to use, or self-hosted: the open-source engine runs in your own account. #### How is it different from Vercel or Netlify? The same idea (push, preview, release), plus containers, jobs and queues in the same place, one account and one bill with your database, files, e-mail and domains, and an open-source engine you can install in your own AWS account. #### Can I see the AWS resources? Self-hosted, yes: everything is in your account, tagged, with a CloudFormation stack per app. In Sypnia Cloud the resources are in Sypnia's accounts; you see them through Run. #### Does my app need changes? No for the frameworks in [Server-rendered apps](https://run.docs.sypnia.com/apps/server-apps) and for static sites. Containers need to listen on `PORT` and answer a health check. #### What happens to my app if Sypnia's control plane is down? It keeps serving. Only new deploys and releases wait. #### Can I leave? Yes. Your code is yours, the adapters are open source, and you can run the same engine in your AWS account or move your container image anywhere. --- ## Changelog > What changed in Sypnia Run, newest first. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://run.docs.sypnia.com/reference/changelog/ For agents: Run changelog: 2026-11-17 Sypnia Run and its documentation. ### 2026-11-17 Sypnia Run and its documentation: apps and runtimes, builds, deploys, previews, releases and rollbacks, configuration and secrets, addresses and domains, jobs and queues, logs, Telemetry and use cases, the SDK, the CLI, MCP, the API, the architecture on AWS, isolation, self-hosting, security and Sypnia Cloud.