Skip to main content
Version: v2.0.0-rc

Workloads

Workloads are composed of one or more WebAssembly (Wasm) components and an optional service.

A wasmCloud workload is an application-level abstraction that consists of one or more components and optionally a service.

Workload diagram

  • Components are portable, interoperable binaries (.wasm files) that implement stateless logic, typically enacting the core logic of an application (for example, the API for a web application), while leaving stateful or reusable functionality (e.g., key-value storage or HTTP) to services, hosts, and host plugins.

  • Services are persistent, stateful Wasm binaries that can act as localhost within the workload boundary and provide long-running processes.

The wasmCloud host runs workloads in cloud and edge environments, while the Wasm Shell (wash) CLI helps developers build and publish components and services.

Workloads are defined according to the wasmCloud runtime's Workload API. For most users, this means defining the workload in a Kubernetes manifest with the WorkloadDeployment custom resource.

Components vs Services

FeatureComponentsServices
LifecycleInvocation-based (stateless)Long-running (stateful)
StateNo state between invocationsMaintains state across lifetime
TCP Listening❌ Cannot listen on ports✅ Can listen on TCP ports
TCP Outbound✅ Can connect out✅ Can connect out
Execution ModelInvoked per requestRuns continuously (like traditional binaries)
WASI InterfaceComponent modelwasi:cli/run
Restart PolicyN/A (invoked as needed)Automatically restarted on crash

When to use components and services

Use a component when you need:

  • Stateless request/response patterns
  • Pure computation or transformation
  • Scaling with invocation-based concurrency
  • Standard WIT interface implementations

Use a service when you need:

  • Persistent connections (database connection pooling)
  • Long-running state (in-memory caches)
  • TCP server capabilities
  • Cron/scheduled task execution
  • Protocol adapters and bridges

Keep reading