Workers allow you to process tasks defined in your workflows and can run in various envionments.
This guide shows you how to interact with and setup workers. Workers execute tasks in your workflows - you can deploy workers through the frontend, cli or from the API directly.
Workers can be deployed in various environments, including:
The local executor runs tasks directly on your machine. This is useful for development and testing purposes. To use the local executor, run the following command with the wt cli:
wt worker start --type localThis will start a worker that runs tasks locally. You can then define your workflows and tasks in the usual way. The local executor is not suitable for production use, as it does not provide any scaling or fault tolerance.
The Docker executor runs tasks in a Docker container. This is useful for isolating dependencies and ensuring that tasks run in a consistent environment. To use the Docker executor, run the following command with the wt cli:
wt run --executor dockerThis will start a worker that runs tasks in a Docker container. You can then define your workflows and tasks in the usual way. The Docker executor is suitable for production use, as it provides scaling and fault tolerance.
The Kubernetes executor runs tasks in a Kubernetes cluster. This is useful for scaling and managing tasks in a distributed environment. To use the Kubernetes executor, run the following command with the wt cli:
wt run --executor kubernetesThis will start a worker that runs tasks in a Kubernetes cluster. You can then define your workflows and tasks in the usual way. The Kubernetes executor is suitable for production use, as it provides scaling and fault tolerance.
The AWS Lambda executor runs tasks as serverless functions on AWS. This is useful for running tasks in a scalable and cost-effective way. To use the AWS Lambda executor, run the following command with the wt cli:
wt run --executor aws-lambdaThis will start a worker that runs tasks as serverless functions on AWS. You can then define your workflows and tasks in the usual way. The AWS Lambda executor is suitable for production use, as it provides scaling and fault tolerance.
The Google Cloud Functions executor runs tasks as serverless functions on Google Cloud. This is useful for running tasks in a scalable and cost-effective way. To use the Google Cloud Functions executor, run the following command with the wt cli:
wt run --executor google-cloud-functionsThis will start a worker that runs tasks as serverless functions on Google Cloud. You can then define your workflows and tasks in the usual way. The Google Cloud Functions executor is suitable for production use, as it provides scaling and fault tolerance.