Workers Services
Workers Services are the building blocks for deploying applications on Cloudflare Workers.
Workers Services are scripts that can contain bindings to KV stores, Durable Objects, or other services, as well as environment variables and secrets.
A Workers Service is composable, which allows Workers Services to talk to each other. This opens up the ability to develop new kinds of microservices like: routers, middlewares, deployment managers, or traffic gateways.
To understand Workers Services better, it will help to know about Bindings and Deployments.
Bindings
Bindings allow your Workers to interact with resources on the Workers platform. Bindings can be configured by logging in to the Cloudflare dashboard > Account Home > Workers > your Worker > Settings> Variables. Bindings also provide a security model for interacting with those resources. Workers only have access to other resources that are explicitly defined as a binding in configuration.
There are multiple types of bindings available today:
- Service bindings for communication with another Worker.
- KV namespace bindings for communication between a Worker and a KV namespace.
- R2 bucket bindings for communication between a Worker and an R2 bucket.
- Durable Object bindings for communication between a Worker and a Durable Object.
- Queue bindings for communication between a Worker and a Queue.
- mTLS certificate bindings enable communication between a Worker and an origin server secured by mTLS using an uploaded certificate.
Deployments
Deployments provide static historical versions of your Worker. They include the bundled code, configuration, and bindings associated with your Worker at a given point in time, and are created when changes to Worker code or configuration is detected.
Read more about Deployments.