End-to-End Example: Lead Management Application
A complete walkthrough of building a production-grade lead management application using the Application Data pattern — from schema creation to deployed dashboard, following every step in sequence.
What We Are Building
A Lead Management application with:
- A SQL database for lead records with AI enrichment columns
- An Atlas Form for creating and editing leads
- Four CRUD workflows powering the data operations
- A dashboard form with charts showing lead pipeline metrics
- Role-based access control (SalesRep vs SalesManager)
- An AI enrichment workflow that classifies leads automatically
Phase 1: Database Setup (Day 1, ~2 hours)
Provision the Database
Create DataOcean_SalesData on your SQL Server instance with READ_COMMITTED_SNAPSHOT ON. Create the BizFirstApp login with db_datareader + db_datawriter permissions.
Run the Schema Migration
Execute the Lead table CREATE statement (including all metadata and AI enhancement columns). Run the index creation script. Insert seed data for LeadStatus and LeadSource reference tables.
Register the Datasource
Add the connection string to the BizFirstGO Credential Store as credentialId 1001. Register datasource sales-data-db pointing to credentialId 1001. Test the connection.
Phase 2: Form Creation (Day 1, ~1 hour)
Generate the Lead Form
In AtlasForms Studio: New Form → Generate with AI → From SQL Table. Paste the Lead CREATE TABLE statement. Set exclusions: TenantId, IsDeleted, DeletedAt, EmbeddingRef, AiProcessedAt, etc.
Customize the Form
Change Source and Status to dropdown controls bound to reference data queries. Change AssignedToUserId to a User Picker. Add conditional visibility: show FollowUpDate only for Contacted/Qualified status.
Configure Role-Based Field Visibility
Hide EstimatedValue from SalesRep role. Hide AI enrichment fields (ClassificationLabel, SentimentScore) from everyone except DataEngineer role. Publish Form v1.
Phase 3: CRUD Workflows (Day 1-2, ~3 hours)
Build lead-create Workflow
REST trigger → Input validation sub-workflow → SqlUpdateNode (INSERT) → Async trigger lead-enrich → Response formatter. Set access policy: SalesRep + SalesManager + Administrator.
Build lead-read and lead-list Workflows
lead-read: REST GET → SqlQueryNode (single record, firstRowOnly) → Row-level filter (SalesRep sees own leads only) → Response formatter. lead-list: REST GET with pagination params → SqlQueryNode (paginated SELECT) → Response.
Build lead-update and lead-delete Workflows
lead-update: Validation → SqlUpdateNode (UPDATE) → Response. lead-delete: Access check (SalesManager only) → SqlUpdateNode (soft delete IsDeleted=1) → Check rowsAffected → 200 or 404.
Phase 4: Dashboard (Day 2, ~2 hours)
Create Dashboard Chart Workflows
Build: lead-chart-by-status (bar chart data), lead-chart-by-source (pie chart data), lead-chart-trend (line chart — daily new leads last 30 days), lead-kpi-total (KPI card — total active leads). Each returns formatted JSON arrays.
Build the Dashboard Form
Create a new Atlas Form: Lead Pipeline Dashboard. Add KPI card (total leads), bar chart (by status), pie chart (by source), line chart (trend). Bind each chart to its workflow. Set refresh interval 60 seconds.
Phase 5: AI Enrichment (Day 3, ~2 hours)
Build lead-enrich Workflow
Triggered asynchronously by lead-create. Read the new lead from SQL. Call Octopus AI node with prompt: "Classify this lead as High Value / Medium Value / Low Value / Unlikely. Return a JSON object with classificationLabel and reasoning." Write result to Lead table via SqlUpdateNode (UPDATE ClassificationLabel, AiProcessedAt, AiModelVersion).
Schedule Backfill
Build lead-enrich-batch workflow: query leads WHERE AiProcessedAt IS NULL, loop through results, call AI enrichment node for each. Schedule to run nightly to enrich any leads that missed the async trigger.
Completion Summary
| Component | Status | Details |
|---|---|---|
| SQL Schema | Done | Lead table + indexes + reference data |
| Datasource | Done | sales-data-db registered and tested |
| Atlas Form | Done | Lead entry form with role-based fields |
| CRUD Workflows | Done | 4 workflows: create, read, list, update, delete |
| Data API | Done | REST endpoints via workflow triggers |
| Dashboard | Done | Pipeline metrics with 5 chart controls |
| AI Enrichment | Done | Classification on create + nightly backfill |
A full-featured lead management application — with SQL data store, Atlas Forms UI, REST API, dashboard, and AI enrichment — built in approximately 10 hours with no custom application code. The equivalent traditional application would typically take 4-6 weeks of development time.