.do
ScaleServices-as-Software

The Paradigm Shift

How Infrastructure-as-Code unlocked SaaS, and how Business-as-Code unlocks AI-delivered Services-as-Software

The Pattern of Technology Evolution

Throughout computing history, each era has been defined by a fundamental abstraction that unlocks new business models:

graph LR subgraph "1990s - Software Era" A1[Physical Servers] -->|Manual Config| B1[Software Licenses] B1 --> C1[On-Premise Install] end subgraph "2000s-2020s - Cloud Era" A2[Infrastructure-as-Code] -->|Terraform/K8s| B2[Software-as-a-Service] B2 --> C2[Multi-tenant SaaS] end subgraph "2024+ - AI Era" A3[Business-as-Code] -->|Semantic + AI| B3[Services-as-Software] B3 --> C3[Autonomous Services] end A1 -.Evolution.-> A2 A2 -.Evolution.-> A3
EraAbstractionToolBusiness ModelExample
1990sPhysical serversManual configurationSoftware licensesMicrosoft Office, Oracle Database
2000s-2020sVirtual infrastructureInfrastructure-as-CodeSoftware-as-a-ServiceSalesforce, Stripe, Shopify
2024+Semantic business logicBusiness-as-CodeServices-as-SoftwareAI Customer Support, AI Content Creation

We are witnessing the same pattern that created the Cloud era, now creating the AI era.

The Cloud Era: Infrastructure-as-Code → SaaS

The Problem (Pre-Cloud, 1990s-2005)

Before Infrastructure-as-Code:

  • Manual server provisioning (weeks of lead time)
  • Custom configurations (snowflake servers)
  • No version control for infrastructure
  • Scaling required buying hardware
  • Disaster recovery was complex and manual

Impact on Software Business:

  • High upfront costs (customers buy licenses + servers)
  • Long sales cycles (6-12 months typical)
  • On-premise installations (weeks of setup)
  • Upgrade nightmares (every customer different)
  • Limited market (only enterprises could afford it)

The Solution: Infrastructure-as-Code (2006+)

AWS launches (2006), followed by Terraform (2014), Docker (2013), Kubernetes (2014):

# Terraform - Define infrastructure declaratively
resource "aws_instance" "web" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"

  tags = {
    Name = "WebServer"
  }
}

resource "aws_lb" "main" {
  name               = "web-lb"
  load_balancer_type = "application"
  subnets            = aws_subnet.public[*].id
}

What Changed:

  • Infrastructure became code (version controlled, reproducible)
  • Provisioning became instant (API calls, not purchase orders)
  • Scaling became elastic (add capacity on demand)
  • Costs became variable (pay for what you use)

The Business Model It Unlocked: SaaS

Software-as-a-Service became possible because IaC enabled:

  1. Multi-tenancy: One infrastructure, thousands of customers
  2. Elastic scaling: Handle growth without customer action
  3. Continuous delivery: Deploy updates instantly
  4. Usage-based pricing: Align costs with value

Winners of this era:

  • Salesforce ($300B+ market cap): CRM as a service
  • Shopify ($80B+): E-commerce platform as a service
  • Stripe ($95B+): Payments as a service
  • Twilio ($20B+): Communications as a service

The Formula:

Infrastructure-as-Code + Cloud Computing
→ Software-as-a-Service Business Model
→ $500B+ SaaS Market

The AI Era: Business-as-Code → Services-as-Software

The Problem (Current, 2010-2024)

Even with SaaS:

  • Software still requires human operators
  • Training and onboarding needed
  • Configuration complexity remains
  • Per-seat pricing limits scale
  • Expertise still requires hiring people
  • Manual work still needed to deliver value

Impact on Service Business:

  • High labor costs (hire support teams, sales teams, content writers)
  • Linear scaling (more customers = more employees)
  • Human bottlenecks (expertise doesn't scale)
  • Inconsistent quality (varies by person)
  • Limited availability (working hours only)

Example Pain Points:

  • Customer Support: Buy Zendesk ($99/agent/month) + hire support team + train agents + manage queue
  • Content Marketing: Buy HubSpot ($800/month) + hire writers ($50-100/article) + hire editors + manage calendar
  • Sales Development: Buy SalesLoft ($100/user/month) + hire SDRs ($60K+/year) + train + manage pipeline

The Solution: Business-as-Code (2024+)

Convergence of three technologies:

  1. AI Models (GPT-5, Claude Sonnet 4.5, Llama 4, Gemini 2.5 Pro)

    • Human-level reasoning and decision-making
    • Multi-step planning and execution
    • Tool use and API integration
    • Memory and context understanding
  2. Semantic Standards (Schema.org, GS1, O*NET)

    • 817+ standardized business types
    • 1,518+ standardized properties
    • Vocabulary AI models understand natively
    • Knowledge graphs that enable reasoning
  3. Edge Infrastructure (Cloudflare Workers, etc.)

    • Global distribution (300+ locations)
    • Instant scaling (0 to millions)
    • Pay-per-execution pricing
    • Sub-50ms latency worldwide

What Changes:

// Business logic as declarative semantic code
const service = await $.Service.create({
  $type: 'CustomerSupportService',

  // What the service does
  capabilities: {
    triageTickets: { sla: '30 seconds', automation: 1.0 },
    generateResponses: { quality: 0.95, tone: 'helpful' },
    resolveIssues: { target: 0.85, escalation: 'smart' },
  },

  // How it operates
  on: {
    '$.Ticket.created': async (ticket) => {
      const analysis = await ai.analyze(ticket)
      const response = await ai.generate(response)
      await ticket.resolve(response)
    },
  },

  // How to price it
  pricing: {
    model: 'per-resolution',
    price: 0.5, // vs $99/agent/month for Zendesk
    included: ['triage', 'response', 'resolution'],
  },
})

// Deploy globally
await service.deploy({ regions: 'all' })
// AI agents now operate this service 24/7

Key Differences from IaC:

Infrastructure-as-CodeBusiness-as-Code
Defines infrastructureDefines business operations
Deploys serversDeploys autonomous agents
Scales computeScales intelligence
Version controls configVersion controls business logic
Enables SaaS (software delivery)Enables Services (outcome delivery)

The Business Model It Unlocks: Services-as-Software

Services-as-Software becomes possible because BaC enables:

  1. Autonomous Operation: AI agents execute the service
  2. Zero Configuration: Services work out of the box
  3. Outcome-Based Pricing: Pay for results, not seats
  4. Infinite Scale: AI scales without humans
  5. Continuous Improvement: Services learn and adapt

Emerging Winners:

  • AI Customer Support Services: $0.50/ticket vs $99/agent/month
  • AI Content Services: $25/article vs $50-100/article + writer salary
  • AI SDR Services: $50/qualified-lead vs $60K+/year per SDR
  • AI Data Analysis Services: $100/insight vs $120K+/year per analyst

The Formula:

Business-as-Code + AI Models + Semantic Standards
→ Services-as-Software Business Model
→ $? Trillion Market (TBD)

The Complete Evolution

Phase 1: Software Licenses (1990s-2005)

Abstraction: Applications you install Delivery: Physical media, downloads Pricing: Per-seat perpetual licenses Operations: Customer runs it themselves Example: Microsoft Office, Oracle Database

Economics:

  • High upfront cost
  • Customer bears infrastructure cost
  • Revenue: One-time license fees
  • Margin: High (software copies are free)

Phase 2: Software-as-a-Service (2006-2024)

Abstraction: Applications you access remotely Delivery: Web browsers, APIs Pricing: Per-seat subscriptions Operations: Vendor runs it for you Example: Salesforce, Shopify, Stripe

Economics:

  • Subscription revenue (predictable)
  • Vendor bears infrastructure cost
  • Revenue: Monthly/annual recurring
  • Margin: Good (multi-tenant efficiency)

Enabled by: Infrastructure-as-Code

Phase 3: Services-as-Software (2024+)

Abstraction: Outcomes you consume Delivery: API calls, integrations Pricing: Per-outcome or usage-based Operations: AI agents operate autonomously Example: AI Support Service, AI Content Service

Economics:

  • Usage/outcome revenue (scales with value)
  • Vendor bears AI inference cost
  • Revenue: Per-resolution, per-lead, per-insight
  • Margin: Excellent (AI scales infinitely)

Enabled by: Business-as-Code

Why the Analogy Works

Infrastructure-as-Code → SaaS

IaC enabled:

  • Deploying infrastructure programmatically
  • Version controlling infrastructure
  • Scaling infrastructure elastically

This unlocked:

  • Multi-tenant software delivery
  • Instant provisioning
  • Usage-based pricing
  • Continuous deployment

Result: Software-as-a-Service became the dominant business model

Business-as-Code → Services-as-Software

BaC enables:

  • Defining business logic semantically
  • Version controlling workflows
  • Scaling intelligence autonomously

This unlocks:

  • AI-operated service delivery
  • Zero-configuration deployment
  • Outcome-based pricing
  • Continuous improvement

Result: Services-as-Software becoming the next dominant business model

What Makes It Different

SaaS Still Requires Humans

With Salesforce (SaaS):

  1. You buy licenses ($25-300/user/month)
  2. You hire sales reps to use it
  3. You train reps on the software
  4. You configure pipelines and workflows
  5. You manage the team
  6. You analyze the data yourself

Result: Software + humans = outcomes

Services-as-Software Delivers Outcomes

With AI SDR Service (Services-as-Software):

  1. You define your ICP (Ideal Customer Profile)
  2. AI researches prospects automatically
  3. AI personalizes outreach automatically
  4. AI qualifies leads automatically
  5. You receive qualified leads
  6. You pay per qualified lead ($50 each)

Result: Service = outcomes (no humans needed)

The Economic Shift

graph TB subgraph "Traditional SaaS" SaaS1[Software + Humans] SaaS2[Cost: $155/month/customer] SaaS3[Revenue: $99/user/month] SaaS4[Margin: NEGATIVE] SaaS1 --> SaaS2 SaaS2 --> SaaS3 SaaS3 --> SaaS4 end subgraph "Services-as-Software" SaS1[AI + Automation] SaS2[Cost: $10/month/customer] SaS3[Revenue: $300/month usage] SaS4[Margin: 97%] SaS1 --> SaS2 SaS2 --> SaS3 SaS3 --> SaS4 end SaaS4 -.Transform.-> SaS1

Traditional SaaS Economics

Cost to Serve Customer:
- Software: $5/month (infrastructure)
- Support: $50/month (human support team)
- Sales: $100/month (amortized CAC)
Total: $155/month

Revenue: $99/user/month
Margin: -$56/month (negative!)

Need: 10+ users per customer to be profitable

Constraint: Humans don't scale linearly with customers.

Services-as-Software Economics

Cost to Serve Customer:
- AI Inference: $5/month
- Infrastructure: $2/month
- Support: $3/month (AI support!)
Total: $10/month

Revenue: $300/month (usage-based)
Margin: $290/month (97%!)

Need: 1 customer to be profitable

Advantage: AI scales infinitely without humans.

What This Means for Builders

The Opportunity

Just as IaC enabled a generation of SaaS companies (Salesforce, Shopify, Stripe, Twilio, etc.), BaC enables a new generation of Services-as-Software companies.

If you're building:

  • Don't build software that users operate
  • Build services that operate themselves
  • Don't charge per seat
  • Charge per outcome
  • Don't require configuration
  • Work out of the box with AI agents

The Platform

The .do platform provides:

  1. Business-as-Code: Semantic $.Subject.predicate.Object patterns
  2. AI Agents: GPT-5, Claude Sonnet 4.5, Llama 4, Gemini 2.5 Pro
  3. Event System: on() and send() for workflows
  4. Global Infrastructure: Cloudflare Workers (300+ locations)
  5. Monetization: Built-in billing for usage/outcome pricing

Example: Build an AI customer support service in 100 lines of code, deploy globally in minutes, charge $0.50/ticket, scale to millions of tickets without hiring.

Case Studies: The Transformation

Case Study 1: Customer Support

Traditional Model (Pre-2024)

Company: Medium-sized SaaS (5,000 customers)

Software Stack:
- Zendesk: $99/agent/month × 15 agents = $1,485/month
- Helpscout: $20/user/month × 15 users = $300/month
- Intercom: $79/seat/month × 5 seats = $395/month
Total Software: $2,180/month

Human Team:
- 15 Support Agents @ $45K/year = $675K/year
- 2 Support Managers @ $75K/year = $150K/year
- Training, benefits, overhead: +40% = $330K/year
Total Personnel: $1.155M/year

Total Cost: $1.18M/year
Tickets Resolved: ~50,000/year
Cost per Resolution: $23.60

Problems:

  • Can only scale by hiring more people
  • Limited to business hours (or expensive 24/7 shifts)
  • Quality varies by agent
  • Training takes months
  • High turnover (industry average 45%/year)

Services-as-Software Model (2024+)

// Deploy autonomous support service
const support = $.Service.deploy({
  $type: 'CustomerSupportService',

  pricing: {
    model: 'per-resolution',
    price: 0.50  // $0.50 per ticket resolved
  },

  capabilities: {
    // AI analyzes and categorizes tickets
    triage: {
      automation: 1.0,  // 100% automated
      sla: '30 seconds'
    },

    // AI generates responses using knowledge base
    response: {
      quality: 0.95,  // 95% quality score
      personalization: true
    },

    // AI resolves tickets autonomously
    resolution: {
      target: 0.85,  // 85% auto-resolution rate
      escalation: 'smart'  // Smart escalation to humans
    }
  }
})

Results:

Total Cost: $25K/year (AI inference + infrastructure)
Tickets Resolved: 50,000/year (same volume)
Cost per Resolution: $0.50
Savings: $1.155M/year (98% reduction)

Additional Benefits:
- 24/7 operation (no extra cost)
- Instant scaling (handles 10x volume with no changes)
- Consistent quality (no variance)
- No training required
- Continuous improvement (learns from every interaction)

ROI: 46x return vs traditional model

Case Study 2: Content Marketing

Traditional Model (Pre-2024)

Company: Marketing agency

Software Stack:
- HubSpot: $800/month
- Semrush: $119/month
- Grammarly Business: $15/user × 5 = $75/month
Total Software: $994/month ($11,928/year)

Human Team:
- 3 Content Writers @ $60K/year = $180K/year
- 1 Content Manager @ $80K/year = $80K/year
- 1 SEO Specialist @ $70K/year = $70K/year
Total Personnel: $330K/year

Total Cost: $341,928/year
Articles Produced: 500/year
Cost per Article: $684

Problems:

  • Limited production capacity
  • Quality depends on writer availability
  • SEO optimization is manual
  • Research time is significant
  • Revision cycles slow down production

Services-as-Software Model (2024+)

// Deploy content generation service
const content = $.Service.deploy({
  $type: 'ContentMarketingService',

  pricing: {
    model: 'per-article',
    price: 25  // $25 per published article
  },

  capabilities: {
    // AI researches topics automatically
    research: {
      sources: ['competitor-analysis', 'trending-topics', 'serp-analysis'],
      depth: 'comprehensive'
    },

    // AI writes SEO-optimized content
    writing: {
      quality: 0.92,  // 92% quality score
      seo: 'optimized',
      tone: 'configurable',
      length: 'variable'
    },

    // AI optimizes for search engines
    optimization: {
      keywords: 'automatic',
      meta: 'generated',
      internal_links: 'smart'
    },

    // AI schedules and publishes
    publishing: {
      schedule: 'optimal',
      distribution: 'multi-channel'
    }
  }
})

Results:

Total Cost: $12,500/year (500 articles × $25)
Articles Produced: 500/year (same volume)
Cost per Article: $25
Savings: $329,428/year (96% reduction)

Additional Benefits:
- Can scale to 5,000+ articles/year with no infrastructure changes
- Consistent SEO optimization
- Always up-to-date research
- Multi-language support (no additional cost)
- Instant turnaround (minutes vs days)

ROI: 27x return vs traditional model

Case Study 3: Lead Qualification (SDR)

Traditional Model (Pre-2024)

Company: B2B SaaS startup

Software Stack:
- SalesLoft: $100/user/month × 10 = $1,000/month
- ZoomInfo: $15,000/year
- LinkedIn Sales Navigator: $79/user/month × 10 = $790/month
Total Software: $36,480/year

Human Team:
- 10 SDRs @ $60K/year + commission = $800K/year
- 2 SDR Managers @ $90K/year = $180K/year
Total Personnel: $980K/year

Total Cost: $1.016M/year
Qualified Leads: 1,000/year
Cost per Qualified Lead: $1,016

Problems:

  • High turnover (SDR role has 35% annual turnover)
  • Ramp time (3-6 months to full productivity)
  • Inconsistent outreach quality
  • Limited research depth
  • Manual personalization

Services-as-Software Model (2024+)

// Deploy AI SDR service
const sdr = $.Service.deploy({
  $type: 'SalesDeployment:Service',

  pricing: {
    model: 'per-qualified-lead',
    price: 50  // $50 per qualified lead
  },

  capabilities: {
    // AI researches prospects automatically
    prospecting: {
      sources: ['company-data', 'news', 'social', 'job-posts'],
      signals: ['hiring', 'funding', 'expansion', 'pain-points']
    },

    // AI personalizes outreach
    outreach: {
      channels: ['email', 'linkedin', 'phone'],
      personalization: 'deep',  // Company + role + recent events
      followup: 'automated'
    },

    // AI qualifies leads
    qualification: {
      criteria: 'configurable',  // BANT, MEDDIC, etc.
      scoring: 'ml-based',
      handoff: 'smart'
    }
  }
})

Results:

Total Cost: $50,000/year (1,000 leads × $50)
Qualified Leads: 1,000/year (same volume)
Cost per Qualified Lead: $50
Savings: $966,000/year (95% reduction)

Additional Benefits:
- Instant scaling (can handle 10,000 leads/year)
- 24/7 operation across all time zones
- Perfect personalization every time
- No ramp time
- Continuous optimization

ROI: 20x return vs traditional model

The Technical Foundation

What Makes Business-as-Code Different

Infrastructure-as-Code (IaC)

# Terraform - Imperative infrastructure definition
resource "aws_instance" "web" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"

  # How to create the infrastructure
  provisioner "remote-exec" {
    inline = [
      "sudo apt-get update",
      "sudo apt-get install -y nginx",
      "sudo systemctl start nginx"
    ]
  }
}

Characteristics:

  • Defines HOW to create infrastructure
  • Imperative commands
  • Machine-focused
  • Requires deep technical knowledge

Business-as-Code (BaC)

// $.Service - Declarative business definition
const service = $.Service.create({
  $type: 'CustomerSupportService',

  // What the service should accomplish
  goals: {
    resolution_rate: 0.85,
    response_time: '2 minutes',
    customer_satisfaction: 0.90
  },

  // What happens (not how)
  on: {
    '$.Ticket.created': async (ticket) => {
      // AI understands the semantic meaning
      const analysis = await $.ai.analyze(ticket)
      const response = await $.ai.generate(response)
      await ticket.resolve(response)
    }
  }
})

Characteristics:

  • Defines WHAT to accomplish
  • Declarative intentions
  • Business-focused
  • AI interprets and executes

The Semantic Foundation

Business-as-Code relies on semantic patterns that AI models understand natively:

// Schema.org types - AI knows what these mean
$.Ticket  // AI knows: support request, has customer, has issue, needs resolution
$.Customer  // AI knows: person or org, has history, has preferences
$.Resolution  // AI knows: solution to problem, can be rated, closes ticket

// GS1 events - AI knows business processes
$.Order.placed  // AI knows: customer committed, payment needed, fulfillment follows
$.Shipment.created  // AI knows: items moving, tracking available, delivery expected

// O*NET tasks - AI knows job functions
$.analyze_customer_sentiment  // AI knows: read text, identify emotion, categorize
$.generate_personalized_response  // AI knows: use context, match tone, be helpful

This is what makes Services-as-Software possible: AI doesn't need to be trained on your specific business logic. It understands business concepts natively through semantic standards.

The Market Implications

Market Size Comparison

graph TB subgraph "SaaS Market (enabled by IaC)" SaaS1["$500B+ Global SaaS Market (2024)"] SaaS2["Salesforce: $31B revenue"] SaaS3["Microsoft 365: $60B+ revenue"] SaaS4["ServiceNow: $7.5B revenue"] SaaS1 --> SaaS2 SaaS1 --> SaaS3 SaaS1 --> SaaS4 end subgraph "Services-as-Software Market (enabled by BaC)" SaS1["$? Trillion Market (emerging)"] SaS2["Every service job = software opportunity"] SaS3["80% of workforce = service workers"] SaS4["Services = 70% of GDP"] SaS1 --> SaS2 SaS1 --> SaS3 SaS1 --> SaS4 end SaaS1 -.Evolution.-> SaS1

The Math:

Global workforce: 3.5 billion people
Service workers: 80% = 2.8 billion people
Average service worker cost: $30,000/year (global average)
Total service labor market: $84 trillion/year

Services-as-Software can capture:
- Conservative (10%): $8.4 trillion/year
- Moderate (25%): $21 trillion/year
- Aggressive (50%): $42 trillion/year

For comparison: The entire SaaS market is $500B (0.5 trillion). Services-as-Software is targeting a market 16-84x larger.

Industries Being Transformed

IndustryTraditional CostServices-as-Software CostReduction
Customer Support$23/ticket$0.50/ticket98%
Content Creation$684/article$25/article96%
Lead Qualification$1,016/lead$50/lead95%
Data Analysis$150/hour analyst$5/analysis97%
Legal Research$300/hour lawyer$10/query97%
Bookkeeping$500/month bookkeeper$20/month service96%
Social Media Mgmt$2,000/month agency$99/month service95%
Email Marketing$5,000/month agency$199/month service96%

Pattern: 95-98% cost reduction across service categories

The Builder's Opportunity

The SaaS Playbook (2006-2024)

1. Find manual process in business
2. Build software to automate parts of it
3. Sell per-seat licenses
4. Customers hire people to use the software
5. Build support team to help customers
6. Scale by adding more customers (and more support)

Result: Built a $500B market
Winners: Salesforce ($300B), Shopify ($80B), Stripe ($95B)

The Services-as-Software Playbook (2024+)

1. Find service that requires humans
2. Define service outcomes semantically (Business-as-Code)
3. Deploy AI agents to deliver outcomes
4. Sell per-outcome pricing
5. Customers get results without hiring
6. Service improves automatically through AI learning
7. Scale infinitely without adding humans

Result: Building a $? trillion market
Winners: TBD (you?)

What to Build

Don't Build:

  • Software that requires human operators
  • Per-seat pricing models
  • Features that need configuration
  • Tools that need training

Do Build:

  • Services that deliver outcomes autonomously
  • Per-outcome or usage-based pricing
  • Services that work out of the box
  • Services that improve themselves

Example Opportunities:

Service TypeTraditional CostAI Service CostMarket Size
HR Recruiting$20K per hire$500 per hire$200B
Accounting Services$400/month$50/month$500B
Marketing Analytics$5K/month$200/month$50B
Customer Success$80K per CSM$1K/month service$30B
Technical Support$70K per engineer$500/month service$100B
Sales Enablement$90K per trainer$2K/month service$20B

Technical Requirements

To Build Services-as-Software, You Need

1. Semantic Patterns (Business-as-Code)

// Use standardized vocabularies AI understands
import { $, Schema, NAICS, ONET, GS1 } from 'sdk.do'

// Schema.org types
$.Organization
$.Person
$.Product
$.Order
$.Ticket

// Industry codes (NAICS)
$.NAICS['541511']  // Custom Computer Programming Services

// Occupation codes (O*NET)
$.ONET['43-4051.00']  // Customer Service Representatives

// Supply chain events (GS1)
$.EPCIS.ObjectEvent  // Physical object moved/created/observed

2. AI Integration

// Use foundation models for intelligence
const analysis = await $.ai.generate({
  model: 'gpt-5',  // or claude-sonnet-4.5, llama-4, gemini-2.5-pro
  schema: $.TicketAnalysis,  // Semantic output schema
  prompt: 'Analyze this support ticket',
  context: { ticket, customer, history }
})

// Models understand business context from semantic patterns

3. Event-Driven Architecture

// Services react to business events
on($.Ticket.created, async (ticket) => {
  const analysis = await $.ai.analyze(ticket)
  const response = await $.ai.generate(response)
  await send($.Email.sent, { to: ticket.customer, body: response })
  await ticket.update({ status: '$.Resolved' })
})

// No imperative code - just reactions to events

4. Global Infrastructure

// Deploy to edge globally
await service.deploy({
  regions: 'all',  // 300+ locations worldwide
  scaling: 'auto',  // 0 to millions automatically
  pricing: 'usage'  // pay per execution
})

Complete Example: AI Customer Support Service

import { $, service, on, send, ai } from 'sdk.do'

export default service({
  name: 'AI Customer Support',
  version: '1.0.0',

  // Business-as-Code: Define what service does
  capabilities: {
    triage: { automation: 1.0, sla: '30s' },
    response: { quality: 0.95, tone: 'helpful' },
    resolution: { target: 0.85, escalation: 'smart' }
  },

  // Outcome-based pricing
  pricing: {
    model: 'per-resolution',
    price: 0.50,
    currency: 'USD'
  },

  // Event handlers - what happens
  on: {
    // New ticket created
    '$.Ticket.created': async (event) => {
      const ticket = event.data

      // AI analyzes ticket (understands semantics)
      const analysis = await ai.generate({
        model: 'gpt-5',
        schema: $.TicketAnalysis,
        prompt: 'Analyze this support ticket',
        context: {
          ticket: ticket.content,
          customer: await $.Customer.get(ticket.customerId),
          history: await $.Ticket.history(ticket.customerId),
          products: await $.Product.list()
        }
      })

      // Update ticket with analysis
      await ticket.update({
        category: analysis.category,
        priority: analysis.priority,
        sentiment: analysis.sentiment
      })

      // Determine if auto-resolvable
      if (analysis.confidence > 0.90 && analysis.complexity === 'low') {
        // Generate solution
        const solution = await ai.generate({
          model: 'claude-sonnet-4.5',
          prompt: 'Generate helpful solution',
          context: {
            ticket,
            analysis,
            knowledge: await $.Knowledge.search(analysis.category)
          }
        })

        // Send response to customer
        await send($.Email.sent, {
          to: ticket.customer.email,
          subject: `Re: ${ticket.subject}`,
          body: solution,
          template: 'support-response'
        })

        // Mark resolved
        await ticket.update({
          status: '$.Resolved',
          resolution: solution,
          resolvedBy: 'AI',
          resolvedAt: new Date()
        })

        // Record usage for billing
        await send($.Usage.recorded, {
          customerId: ticket.customerId,
          metric: 'tickets_resolved',
          quantity: 1,
          cost: 0.50
        })
      } else {
        // Escalate to human
        await send($.Support.escalated, {
          ticket,
          analysis,
          reason: 'requires_human_judgment'
        })
      }
    }
  }
})

Deploy:

$ do deploy

 Service validated
 Deployed to 300+ locations
 Event handlers registered
 Billing configured
 Monitoring enabled

Service URL: https://support-ai.do
Dashboard: https://dashboard.do/services/support-ai

Result: Autonomous customer support service operating 24/7 globally, charging $0.50 per resolution, handling thousands of tickets automatically.

Conclusion: The Inevitable Future

Just as Infrastructure-as-Code made Software-as-a-Service inevitable, Business-as-Code makes Services-as-Software inevitable.

The Pattern Is Clear:

  1. Cloud Era: Code → Infrastructure → Multi-tenant software
  2. AI Era: Code → Business Logic → Autonomous services

The Opportunity Is Massive:

  • SaaS market: $500B
  • Service labor market: $84T (168x larger)
  • Potential Services-as-Software market: $8-42T

The Technology Is Ready:

  • AI models reached human-level capability (2024)
  • Semantic standards are mature (Schema.org, GS1, O*NET)
  • Edge infrastructure is global and elastic (Cloudflare Workers)

The Question Is: Will you build the next Salesforce of the AI era?

Next Steps


Back: Services Overview · Next: Architecture →

On this page

The Pattern of Technology EvolutionThe Cloud Era: Infrastructure-as-Code → SaaSThe Problem (Pre-Cloud, 1990s-2005)The Solution: Infrastructure-as-Code (2006+)The Business Model It Unlocked: SaaSThe AI Era: Business-as-Code → Services-as-SoftwareThe Problem (Current, 2010-2024)The Solution: Business-as-Code (2024+)The Business Model It Unlocks: Services-as-SoftwareThe Complete EvolutionPhase 1: Software Licenses (1990s-2005)Phase 2: Software-as-a-Service (2006-2024)Phase 3: Services-as-Software (2024+)Why the Analogy WorksInfrastructure-as-Code → SaaSBusiness-as-Code → Services-as-SoftwareWhat Makes It DifferentSaaS Still Requires HumansServices-as-Software Delivers OutcomesThe Economic ShiftTraditional SaaS EconomicsServices-as-Software EconomicsWhat This Means for BuildersThe OpportunityThe PlatformCase Studies: The TransformationCase Study 1: Customer SupportTraditional Model (Pre-2024)Services-as-Software Model (2024+)Case Study 2: Content MarketingTraditional Model (Pre-2024)Services-as-Software Model (2024+)Case Study 3: Lead Qualification (SDR)Traditional Model (Pre-2024)Services-as-Software Model (2024+)The Technical FoundationWhat Makes Business-as-Code DifferentInfrastructure-as-Code (IaC)Business-as-Code (BaC)The Semantic FoundationThe Market ImplicationsMarket Size ComparisonIndustries Being TransformedThe Builder's OpportunityThe SaaS Playbook (2006-2024)The Services-as-Software Playbook (2024+)What to BuildTechnical RequirementsTo Build Services-as-Software, You Need1. Semantic Patterns (Business-as-Code)2. AI Integration3. Event-Driven Architecture4. Global InfrastructureComplete Example: AI Customer Support ServiceConclusion: The Inevitable FutureNext Steps