Setup
Open Settings → Environments → [environment] → Database. Paste a project-scoped Neon API key (starts withnapi_), verify it, then configure:
- Parent branch: the Neon branch new task branches fork from. Defaults to your project’s primary
branch (typically
main). - Environment variable: name of the env var the connection string is injected as. Defaults to
DATABASE_URL. - TTL (days): how long Neon keeps the branch around. Default 30.
- Delete on task archival: drop the branch when the task is archived (e.g. after PR merge). Default on.
Branch lifecycle
When a task starts, Niteshift creates a fresh Neon branch forked from the parent branch and injects the connection string into the environment under your chosen variable name. Your setup can read the connection string and run migrations against the new branch before the agent starts work:If a long-running task outlives its branch’s TTL, the next run forks a new branch from the parent.
Raise the TTL if you need the same branch to persist longer.