Configuration

si.json

Serverless App Service configuration that lives in your repository.

Where it goes

Put si.json in the Serverless App Service's root directory: the repository root, or the folder set as Root Directory in the Serverless App Service's settings. The build saves it with the deployment, so each deployment carries the configuration of its commit.

Reference

si.json
{
  "watch": ["packages/ui/**", "tsconfig.base.json"],
  "crons": [
    { "path": "/api/cron/daily-report", "schedule": "cron(0 9 * * ? *)" },
    { "path": "/api/cron/sync", "schedule": "rate(15 minutes)" }
  ]
}
KeyType
watcharray of stringsPaths outside the root directory whose changes also build this Serverless App Service. See watch.
cronsarrayRequests the platform makes to your production deployment on a schedule. See Crons.
crons[].pathstringThe path to call. Must start with /.
crons[].schedulestringA rate(…) or cron(…) expression (syntax).
checksarray of stringsScripts Caity runs when it checks a branch (repository root si.json), e.g. ["typecheck", "test"]. Default: whichever of typecheck, lint, test and build package.json defines.

watch, crons and checks are the only keys the platform reads; anything else in the file is ignored.

watch

A push builds a Serverless App Service when it changes a file under the Serverless App Service's root directory or an install file above it; otherwise the push is skipped. watch adds more paths, typically shared code in a monorepo:

apps/web/si.json
{ "watch": ["packages/ui/**", "packages/config/src/*.ts"] }
  • Patterns are relative to the repository root, not the root directory. A leading ./ or / is ignored.
  • ** matches any number of folders, * and ? match within one folder name, and everything else is literal.
  • A pattern that matches a folder also matches everything inside it: packages/ui covers packages/ui/src/button.tsx.
  • Patterns starting with ! and patterns over 200 characters are ignored; up to 50 are used.
  • The si.json of the pushed commit decides.

Crons validation

  • Entries whose path doesn't start with /, or whose schedule isn't rate(…) or cron(…), are skipped.
  • Only the first 20 crons are used.
  • A file that isn't valid JSON counts as having no crons.
  • An expression the scheduler rejects (such as rate(5 mins)) fails a production deployment when it's applied. Previews only record their crons, so they don't catch it.

When crons take effect

A deployment's crons apply when it becomes production: when a production deployment is ready, and when you promote or roll back to it. Preview deployments record their crons but don't run them.

A production deployment without si.json, or without crons, removes the Serverless App Service's schedules.