Contextual Workers
Create, deploy, and update application code with Contextual Workers.
Bring your own code to Contextual. Workers run applications built with the languages, libraries, and tools you choose. Your code runs alongside the platform's data, events, and workflows.
What Is a Worker?
A Worker is a tenant resource that runs your application code from container images. The Worker configuration selects the application, compute size, runtime settings, and how work starts. Contextual Workers are not Flow topic workers or Cloudflare Workers.
Application code and build files stay in your source repository. The Contextual CLI can build and push images, deploy a Worker, and update application code or Worker runtime settings. Saved configuration changes start a deployment, so code and runtime settings can evolve independently.
Workers can use platform data and events alongside Flows, Native Objects, AI Search, and Sites. A container receives platform credentials only for the features it requests, and those credentials are tenant-wide. Native Objects and external data stores provide persistent storage for application state.
About Workers explains configuration, templates, the runtime environment, and the deployment lifecycle. Read its Runtime Environment section before you move an existing application to a Worker.
What You Can Build
Workers can power a small utility, a complete service, or the backend of a larger solution. Your application code can provide:
- Application Backends: Custom APIs, webhook endpoints, and business logic for Sites or other clients.
- AI Agents and Tools: Assistants that coordinate model calls, use tools, and act on application data.
- Document Processing: Applications that extract information from files, classify documents, or prepare content for search.
- Data Validation and Enrichment: Code that checks incoming records, calculates values, and adds information from other sources.
- Integrations: Connectors that synchronize data with external systems and react to changes in your tenant.
- Automation: Jobs that generate reports, send notifications, reconcile records, or perform scheduled maintenance.
A document-processing Worker could enrich Native Object records and expose an API for a Site to show the processing results.
Work can start in several ways:
- HTTP: Run a service that handles requests at the Worker's URL.
- Events: Process events from the Worker's topic with a managed event template or a custom Compose service.
- Schedule: Run a job on a UTC cron schedule. The job must finish and exit within 30 minutes.
Create Your First Worker
Follow Deploy Your First Worker for a complete HTTP example, from local testing through deployment and a CLI configuration update. The example needs no application framework or platform SDK.
Then use:
- Custom Domains to serve an HTTP Worker at your own hostname.
- Configure a Custom Worker Size to set CPU and memory for each replica.
- Workers CLI Reference to build images, change configuration, inspect deployments, read logs, and remove a Worker.
- Connect to Contextual when your application needs platform data, events, or a schedule.
- Coordinate Worker Deployments and Service Releases to coordinate Service releases and Worker deployments between development and production tenants.
- x-contextual Specification for supported Compose fields, defaults, validation rules, and JSON Schemas.
- Troubleshooting when access, image builds, or deployment checks fail.
- Managed Workers to write only a handler, in TypeScript, Rust, Go, or Python, and let a platform template run it with events, HTTP, or a schedule and with platform access to records, files, and AI.
For questions during early access, contact Contextual support. For a reproducible issue, follow Report a Failure and include the tenant ID, Worker ID, configuration version, and failing check.