# Contextual Workers

These instructions apply to the current Admin Console.

{% hint style="info" %}
Contextual Workers are in early access and may not be available in your account. [Contact Contextual support](mailto:help@contextual.io) to request that Workers be enabled for your tenant.
{% endhint %}

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](https://docs.contextual.io/build/object-types.md), [AI Search](https://docs.contextual.io/connect/ai-search.md), and Sites. A container receives platform credentials only for the [features](https://docs.contextual.io/build/contextual-workers/connect-to-contextual.md#request-platform-access) it requests, and those credentials are tenant-wide. Native Objects and external data stores provide persistent storage for application state.

[About Workers](https://docs.contextual.io/build/contextual-workers/about-workers.md) explains configuration, templates, the runtime environment, and the deployment lifecycle. Read its [Runtime Environment](https://docs.contextual.io/build/contextual-workers/about-workers.md#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](https://docs.contextual.io/build/contextual-workers/quickstart.md) 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](https://docs.contextual.io/build/contextual-workers/custom-domains.md) to serve an HTTP Worker at your own hostname.
* [Configure a Custom Worker Size](https://docs.contextual.io/build/contextual-workers/configure-worker-size.md) to set CPU and memory for each replica.
* [Workers CLI Reference](https://docs.contextual.io/build/contextual-workers/contextual-cli.md) to build images, change configuration, inspect deployments, read logs, and remove a Worker.
* [Connect to Contextual](https://docs.contextual.io/build/contextual-workers/connect-to-contextual.md) when your application needs platform data, events, or a schedule.
* [Coordinate Worker Deployments and Service Releases](https://docs.contextual.io/build/contextual-workers/releases.md) to coordinate Service releases and Worker deployments between development and production tenants.
* [x-contextual Specification](https://docs.contextual.io/build/contextual-workers/x-contextual-specification.md) for supported Compose fields, defaults, validation rules, and JSON Schemas.
* [Troubleshooting](https://docs.contextual.io/build/contextual-workers/troubleshooting.md) when access, image builds, or deployment checks fail.
* [Managed Workers](https://docs.contextual.io/build/contextual-workers/managed-workers.md) 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](mailto:help@contextual.io). For a reproducible issue, follow [Report a Failure](https://docs.contextual.io/build/contextual-workers/troubleshooting.md#report-a-failure) and include the tenant ID, Worker ID, configuration version, and failing check.
