A step-by-step guide to moving Render background worker services to AWS: what a worker does on Render, the SQS and ECS Fargate version with scaling and shutdown, and a TypeScript version where the queue and the worker are declared in the same code as the API.

A Render background worker runs all the time without receiving traffic, polling a queue in Render Key Value through BullMQ, Celery, Sidekiq or Asynq. The web service enqueues jobs, and the two share a Redis instance and a copy of the environment variables.
On AWS that becomes a queue, a long-running container and a scaling policy that someone has to wire together. This guide covers each piece and then the same worker declared in code.
Render's worker model is described in its background workers docs, checked on November 20, 2026. The shutdown limits are in the ECS task definition parameters, and SQS's redelivery behavior is in the visibility timeout guide.
List every job type the worker handles, the queue names it reads, how long the slowest job takes and how many jobs run at the same time per process (BullMQ's concurrency, Celery's --concurrency). Check which jobs are safe to run twice, since every AWS option delivers at least once and a job that charges a card needs an idempotency key before it moves. Write down the scheduled jobs too, such as BullMQ repeatable jobs, because those belong on a scheduler and not in the worker loop.
The shortest path keeps the library and points it at ElastiCache for Redis in the same VPC as the worker, which means the job code does not change and the Redis instance moves from Render's bill to yours. The longer path moves the queue to SQS, which removes Redis from the job path and gives each queue a dead-letter queue through a redrive policy. With SQS, set the visibility timeout above your slowest job, since a message that is still being processed becomes visible again when the timeout runs out and a second task picks it up.
The worker becomes an ECS service with a task definition that runs the worker command, no load balancer and a desired count of one or more. Its task role needs sqs:ReceiveMessage, sqs:DeleteMessage and sqs:ChangeMessageVisibility on the queue, plus whatever the job touches, such as s3:PutObject on a reports bucket. To scale on work instead of CPU, AWS recommends a target tracking policy on backlog per task, calculated from ApproximateNumberOfMessagesVisible divided by the running task count, as described in scaling based on SQS.
Handle SIGTERM in the worker: stop receiving new messages, finish or abandon the current one, and exit before stopTimeout. A job that cannot finish in 120 seconds should be written so that stopping halfway is safe, and the message returns to the queue when its visibility timeout ends.
Encore brings infrastructure from code, and a background worker becomes a Pub/Sub subscription whose handler is the job, declared in the same TypeScript as the API that enqueues it. Per the AWS infrastructure docs, Pub/Sub runs on SNS and SQS in your account with a dead-letter queue per subscription, and the services run on Fargate, with Encore provisioning an IAM role for the service. There is no worker service, Redis instance or scaling policy to create alongside it.

Run in your terminal to get started locally.
A report job that a Render worker used to pick up from a BullMQ queue:
// workers/workers.ts
import { api, APIError } from "encore.dev/api";
import { Topic, Subscription } from "encore.dev/pubsub";
import { Bucket } from "encore.dev/storage/objects";
import log from "encore.dev/log";
export interface ReportRequested {
reportID: string;
accountID: string;
month: string; // YYYY-MM
}
// Replaces the Redis list that the Render worker polled with BullMQ.
export const reportRequested = new Topic<ReportRequested>("report-requested", {
deliveryGuarantee: "at-least-once",
});
export const reports = new Bucket("reports", { versioned: false });
// The web side: enqueue and return right away.
export const requestReport = api(
{ expose: true, method: "POST", path: "/accounts/:accountID/reports" },
async (p: { accountID: string; month: string }): Promise<{ reportID: string }> => {
if (!/^\d{4}-\d{2}$/.test(p.month)) throw APIError.invalidArgument("month must be YYYY-MM");
const reportID = `${p.accountID}-${p.month}`;
await reportRequested.publish({ reportID, accountID: p.accountID, month: p.month });
return { reportID };
},
);
// The worker side: what the Render background worker process did in its loop.
const _ = new Subscription(reportRequested, "build-report", {
maxConcurrency: 5,
ackDeadline: "5m",
retryPolicy: { minBackoff: "30s", maxBackoff: "10m", maxRetries: 5 },
handler: async (msg) => {
const key = `${msg.accountID}/${msg.month}.csv`;
// Delivery is at least once, so a redelivered message finds the file and stops.
if (await reports.exists(key)) {
log.info("report already built", { reportID: msg.reportID });
return;
}
const csv = `account,month\n${msg.accountID},${msg.month}\n`; // stand-in for the real query
await reports.upload(key, Buffer.from(csv), { contentType: "text/csv" });
log.info("report built", { reportID: msg.reportID, key });
},
});
export const reportStatus = api(
{ expose: true, method: "GET", path: "/accounts/:accountID/reports/:month" },
async (p: { accountID: string; month: string }): Promise<{ ready: boolean }> => {
return { ready: await reports.exists(`${p.accountID}/${p.month}.csv`) };
},
);
Under encore run, two quick requests for the same month are both built by the handler, which is harmless since they write the same file. A third request after the file exists logs report already built, a malformed month gets invalid_argument, and the status endpoint returns ready: true. The maxConcurrency setting is the per-instance equivalent of BullMQ's concurrency, and ackDeadline plays the part of the SQS visibility timeout, as the Pub/Sub docs explain together with the retry policy. The object storage docs cover the bucket that replaces files a Render worker might have written to disk.
To deploy, connect your AWS account as described in Connect your cloud account and push with git push encore.
When a coding agent adds a new job type, it declares a topic and a subscription next to the endpoint that publishes to it, and encore run delivers messages to the handler locally on the first run, so the agent can test the whole path before anything is deployed.
Best fit: Backends leaving Render for their own AWS account that want queued jobs, retries and dead letters declared next to the code that produces them.
Point the web service at the new queue first, so new jobs go to AWS while the Render worker keeps working through what is left in Key Value. When the old queue is empty and has stayed empty for a while, scale the Render worker to zero and delete it after a few days. Repeatable jobs that lived in BullMQ move to a scheduler at the same time, or they will stop without an error.
An ECS service on Fargate with no load balancer is the closest match, since it keeps a container running that polls a queue. For short jobs, a Lambda function with an SQS event source replaces the always-on process and runs only when messages arrive.
Yes. You can point them at ElastiCache for Redis instead of Render Key Value, and the worker code stays the same. Moving to SQS removes the Redis instance from the job path and gives you dead-letter queues and visibility timeouts managed by AWS, at the cost of rewriting the enqueue and consume calls.
ECS sends SIGTERM and waits for the container's stopTimeout, which defaults to 30 seconds and can be raised to 120 seconds on Fargate. Jobs that take longer must be safe to stop halfway, so that the message becomes visible again and another task picks it up.
With Encore you declare a Pub/Sub topic and a subscription in application code, and the subscription handler is the worker. Deploying to your AWS account provisions SNS and SQS with a dead-letter queue and runs the handler in your services on Fargate.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.