RepoSnowflake (Arctic)Snowflake (Arctic)published Oct 8, 2026seen 1w

Snowflake-Labs/sfguide-build-full-stack-apps-with-snowflake-app-runtime

Shell

Open original ↗

Captured source

source ↗

Snowflake-Labs/sfguide-build-full-stack-apps-with-snowflake-app-runtime

Description: Get Started with Snowflake App Runtime - 3-iteration quickstart (Data Explorer, Workflow, AI Agent)

Language: Shell

License: Apache-2.0

Stars: 0

Forks: 0

Open issues: 0

Created: 2026-10-08T05:53:12Z

Pushed: 2026-10-17T02:42:58Z

Default branch: main

Fork: no

Archived: no

README:

Build Full-Stack Apps with Snowflake App Runtime

> Follow the step-by-step guide: Build Full-Stack Apps with Snowflake App Runtime. This repo is its companion: setup scripts, prompts, and a reference solution.

Build and deploy ChurnGuard, a full-stack web app on Snowflake, in three progressive iterations: an interactive dashboard, then a workflow app, then an AI-powered agentic experience. Each iteration is driven by a prompt you paste into Cortex Code Desktop.

Narrative Arc

flowchart LR
explore["Iteration 1: See the Data"] --> act["Iteration 2: Act on the Data"]
act --> agent["Iteration 3: Let the Agent Act"]
explore -.- e1["Read-only churn dashboard"]
act -.- a1["Retention workflow on Snowflake Postgres"]
agent -.- g1["Cortex Agent proposes, people approve"]

| Iteration | App Type | What You Build | |-----------|----------|----------------| | 1 - Explorer | Advanced data exploration | Churn risk dashboard with KPIs, segment charts, trend charts | | 2 - Workflow | Workflow app | Action Board, retention action forms, write-back to Snowflake Postgres, data mirroring, alert-driven notifications | | 3 - Agent | AI app with Cortex Agent | Chat panel, playbook-grounded proposals, Agent Suggested tab, daily staging task, MCP server |

Each iteration builds on the previous one, and each one produces a deployable app, so you can stop after any of them.

Prerequisites

  • A Snowflake account with Snowflake App Runtime enabled and ACCOUNTADMIN privileges. Not available on trial accounts.
  • Cortex Code Desktop installed and connected to your Snowflake account
  • Snowflake CLI v3.26.0 or later, with a connection named quickstart (or change the name in .env and AGENTS.md). After grants.sql, set the connection's default role to SFQUICKSTART_CHURNGUARD_ROLE and warehouse to SFQUICKSTART_CHURNGUARD_WH: snow app deploy uses the connection's default role, not --role.
  • Node.js 20+ and npm
  • psql (iteration 2)

Quick Start

1. Clone the repo:

git clone https://github.com/Snowflake-Labs/sfguide-build-full-stack-apps-with-snowflake-app-runtime.git
cd sfguide-build-full-stack-apps-with-snowflake-app-runtime

2. Run the setup scripts (as ACCOUNTADMIN). grants.sql grants the new role to the user running it via CURRENT_USER(), so there is nothing to edit:

snow sql -f scripts/setup.sql --connection quickstart
snow sql -f scripts/grants.sql --connection quickstart
snow sql -f scripts/setup-data.sql --connection quickstart

3. Create your working branch from iteration 1:

git fetch origin
git checkout -b my-app origin/iteration-1/data-exploration

4. Set the default connection and role from .env.example:

cp .env.example .env
echo dotenv > .envrc && direnv allow # or: set -a; source .env; set +a

5. Open the repo root in Cortex Code Desktop and paste the iteration prompt (see below). AGENTS.md tells Cortex Code your connection, role, database, and conventions.

Iterations

| Iteration | Merge into my-app | Setup | Prompts (in order) | |-----------|---------------------|-------|--------------------| | 1 | (start here) | setup.sql, grants.sql, setup-data.sql | [01-build-explorer.md](prompts/01-build-explorer.md) | | 2 | origin/iteration-2/workflow-app | Rerun grants.sql; then after the Postgres prompt, iteration-2-setup.sql | [02-postgres-setup.md](prompts/02-postgres-setup.md), [02-add-workflow.md](prompts/02-add-workflow.md) | | 3 | origin/iteration-3/ai-app | Rerun grants.sql, then iteration-3-setup.sql | [03-agent-setup.md](prompts/03-agent-setup.md), [03-add-agent.md](prompts/03-add-agent.md) |

Prompt links resolve on the branch that adds them. Run every script with snow sql -f scripts/ --connection quickstart. The files in scripts/reference/ record what the setup prompts create; you don't need to run them.

Learner Git Flow

You only ever edit churnguard/ on your own my-app branch. Commit your app after each iteration, then merge in the next iteration branch to pick up its prompts and scripts:

gitGraph
commit id: "main"
branch iteration-1
commit id: "itr1 prompt"
branch my-app
commit id: "explorer app"
checkout iteration-1
branch iteration-2
commit id: "itr2 prompts + scripts"
checkout my-app
merge iteration-2
commit id: "workflow app"
checkout iteration-2
branch iteration-3
commit id: "itr3 prompts + scripts"
checkout my-app
merge iteration-3
commit id: "agent app"
git add churnguard && git commit -m "Iteration 1: ChurnGuard explorer"
git fetch origin && git merge --no-edit origin/iteration-2/workflow-app

Branch Guide

flowchart LR
mainB["main"] --> it1["iteration-1/data-exploration"]
it1 --> it2["iteration-2/workflow-app"]
it2 --> it3["iteration-3/ai-app"]
it3 --> sol["solution"]

Each branch is one commit on top of the previous one.

| Branch | Adds | |--------|------| | main | scripts/setup.sql, grants.sql, setup-data.sql, cleanup.sql, .env.example, README, LICENSE | | iteration-1/data-exploration | AGENTS.md, prompts/01-build-explorer.md | | iteration-2/workflow-app | prompts/02-postgres-setup.md, prompts/02-add-workflow.md, scripts/iteration-2-setup.sql, scripts/reference/postgres-*.sql, iteration 2 grants and cleanup | | iteration-3/ai-app | prompts/03-agent-setup.md, prompts/03-add-agent.md, scripts/iteration-3-setup.sql, scripts/reference/agent-setup.sql, iteration 3 grants and cleanup | | solution | The complete...

Excerpt shown — open the source for the full document.