[{"data":1,"prerenderedAt":570},["ShallowReactive",2],{"navigation":3,"page-\u002Fresources\u002Fworkers":217,"surround-\u002Fresources\u002Fworkers":565},[4,17,48,79,95,118,137,148,159,171,190],{"title":5,"path":6,"stem":7,"children":8,"icon":16,"exact":11},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12],{"title":10,"path":6,"stem":7,"exact":11,"children":-1},"Introduction",true,{"title":13,"path":14,"stem":15,"exact":11,"children":-1},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F2.quickstart","i-lucide-rocket",{"title":18,"path":19,"stem":20,"children":21,"icon":47,"exact":11},"Reference","\u002Freference","10.reference\u002F1.index",[22,23,27,31,35,39,43],{"title":18,"path":19,"stem":20,"exact":11,"children":-1},{"title":24,"path":25,"stem":26,"exact":11,"children":-1},"Variables","\u002Freference\u002Fvariables","10.reference\u002F2.variables",{"title":28,"path":29,"stem":30,"exact":11,"children":-1},"Hostnames and DNS","\u002Freference\u002Fhostnames-and-dns","10.reference\u002F3.hostnames-and-dns",{"title":32,"path":33,"stem":34,"exact":11,"children":-1},"Statuses","\u002Freference\u002Fstatuses","10.reference\u002F4.statuses",{"title":36,"path":37,"stem":38,"exact":11,"children":-1},"Limits","\u002Freference\u002Flimits","10.reference\u002F5.limits",{"title":40,"path":41,"stem":42,"exact":11,"children":-1},"Sizes","\u002Freference\u002Fsizes","10.reference\u002F6.sizes",{"title":44,"path":45,"stem":46,"exact":11,"children":-1},"The GitHub App","\u002Freference\u002Fgithub-app","10.reference\u002F7.github-app","i-lucide-book-open",{"title":49,"path":50,"stem":51,"children":52,"icon":78,"exact":11},"Troubleshooting","\u002Ftroubleshooting","11.troubleshooting\u002F1.index",[53,54,58,62,66,70,74],{"title":49,"path":50,"stem":51,"exact":11,"children":-1},{"title":55,"path":56,"stem":57,"exact":11,"children":-1},"Build failures","\u002Ftroubleshooting\u002Fbuild-failures","11.troubleshooting\u002F2.build-failures",{"title":59,"path":60,"stem":61,"exact":11,"children":-1},"Start and health failures","\u002Ftroubleshooting\u002Fstart-and-health-failures","11.troubleshooting\u002F3.start-and-health-failures",{"title":63,"path":64,"stem":65,"exact":11,"children":-1},"Reference failures","\u002Ftroubleshooting\u002Freference-failures","11.troubleshooting\u002F4.reference-failures",{"title":67,"path":68,"stem":69,"exact":11,"children":-1},"Failures that are Kuppit's","\u002Ftroubleshooting\u002Ffailures-that-are-kuppits","11.troubleshooting\u002F5.failures-that-are-kuppits",{"title":71,"path":72,"stem":73,"exact":11,"children":-1},"Domain issues","\u002Ftroubleshooting\u002Fdomain-issues","11.troubleshooting\u002F6.domain-issues",{"title":75,"path":76,"stem":77,"exact":11,"children":-1},"No preview for a pull request","\u002Ftroubleshooting\u002Fno-preview-for-a-pull-request","11.troubleshooting\u002F7.no-preview-for-a-pull-request","i-lucide-life-buoy",{"title":80,"path":81,"stem":82,"children":83,"icon":94,"exact":11},"Concepts","\u002Fconcepts","2.concepts\u002F1.index",[84,86,90],{"title":85,"path":81,"stem":82,"exact":11,"children":-1},"The Kuppit model",{"title":87,"path":88,"stem":89,"exact":11,"children":-1},"The application graph","\u002Fconcepts\u002Fthe-application-graph","2.concepts\u002F2.the-application-graph",{"title":91,"path":92,"stem":93,"exact":11,"children":-1},"How a service runs","\u002Fconcepts\u002Fhow-a-service-runs","2.concepts\u002F3.how-a-service-runs","i-lucide-shapes",{"title":96,"path":97,"stem":98,"children":99,"icon":117,"exact":11},"Deployments","\u002Fdeployments","3.deployments\u002F1.index",[100,101,105,109,113],{"title":96,"path":97,"stem":98,"exact":11,"children":-1},{"title":102,"path":103,"stem":104,"exact":11,"children":-1},"Builds","\u002Fdeployments\u002Fbuilds","3.deployments\u002F2.builds",{"title":106,"path":107,"stem":108,"exact":11,"children":-1},"Redeploy and roll back","\u002Fdeployments\u002Fredeploy-and-rollback","3.deployments\u002F3.redeploy-and-rollback",{"title":110,"path":111,"stem":112,"exact":11,"children":-1},"Logs","\u002Fdeployments\u002Flogs","3.deployments\u002F4.logs",{"title":114,"path":115,"stem":116,"exact":11,"children":-1},"When a deployment fails","\u002Fdeployments\u002Fwhen-a-deployment-fails","3.deployments\u002F5.when-a-deployment-fails","i-lucide-cloud-upload",{"title":119,"path":120,"stem":121,"children":122,"icon":136,"exact":11},"Resources","\u002Fresources","4.resources\u002F1.index",[123,124,128,132],{"title":119,"path":120,"stem":121,"exact":11,"children":-1},{"title":125,"path":126,"stem":127,"exact":11,"children":-1},"Web services","\u002Fresources\u002Fweb-services","4.resources\u002F2.web-services",{"title":129,"path":130,"stem":131,"exact":11,"children":-1},"PostgreSQL","\u002Fresources\u002Fpostgresql","4.resources\u002F3.postgresql",{"title":133,"path":134,"stem":135,"exact":11,"children":-1},"Workers","\u002Fresources\u002Fworkers","4.resources\u002F4.workers","i-lucide-boxes",{"title":138,"icon":139,"path":140,"stem":141,"children":142,"page":147,"exact":11},"Configuration","i-lucide-sliders-horizontal","\u002Fconfiguration","5.configuration",[143],{"title":144,"path":145,"stem":146,"exact":11,"children":-1},"Environment variables","\u002Fconfiguration\u002Fvariables","5.configuration\u002F1.variables",false,{"title":149,"path":150,"stem":151,"children":152,"icon":158,"exact":11},"Networking","\u002Fnetworking","6.networking\u002F1.index",[153,154],{"title":149,"path":150,"stem":151,"exact":11,"children":-1},{"title":155,"path":156,"stem":157,"exact":11,"children":-1},"Reaching a database","\u002Fnetworking\u002Freaching-a-database","6.networking\u002F2.reaching-a-database","i-lucide-network",{"title":160,"path":161,"stem":162,"children":163,"icon":170,"exact":11},"Domains","\u002Fdomains","7.domains\u002F1.index",[164,166],{"title":165,"path":161,"stem":162,"exact":11,"children":-1},"Hostnames",{"title":167,"path":168,"stem":169,"exact":11,"children":-1},"Custom domains","\u002Fdomains\u002Fcustom-domains","7.domains\u002F2.custom-domains","i-lucide-globe",{"title":172,"path":173,"stem":174,"children":175,"icon":189,"exact":11},"Environments","\u002Fenvironments","8.environments\u002F1.index",[176,177,181,185],{"title":172,"path":173,"stem":174,"exact":11,"children":-1},{"title":178,"path":179,"stem":180,"exact":11,"children":-1},"Preview environments","\u002Fenvironments\u002Fpreview-environments","8.environments\u002F2.preview-environments",{"title":182,"path":183,"stem":184,"exact":11,"children":-1},"Named environments","\u002Fenvironments\u002Fnamed-environments","8.environments\u002F3.named-environments",{"title":186,"path":187,"stem":188,"exact":11,"children":-1},"Deleting an environment","\u002Fenvironments\u002Fdeleting-an-environment","8.environments\u002F4.deleting-an-environment","i-lucide-git-branch",{"title":191,"path":192,"stem":193,"children":194,"icon":216,"exact":11},"Guides","\u002Fguides","9.guides\u002F1.index",[195,196,200,204,208,212],{"title":191,"path":192,"stem":193,"exact":11,"children":-1},{"title":197,"path":198,"stem":199,"exact":11,"children":-1},"Deploy a Nuxt application","\u002Fguides\u002Fdeploy-a-nuxt-application","9.guides\u002F2.deploy-a-nuxt-application",{"title":201,"path":202,"stem":203,"exact":11,"children":-1},"Deploy a Next.js application","\u002Fguides\u002Fdeploy-a-nextjs-application","9.guides\u002F3.deploy-a-nextjs-application",{"title":205,"path":206,"stem":207,"exact":11,"children":-1},"Deploy an Express application","\u002Fguides\u002Fdeploy-an-express-application","9.guides\u002F4.deploy-an-express-application",{"title":209,"path":210,"stem":211,"exact":11,"children":-1},"Deploy with a Dockerfile","\u002Fguides\u002Fdeploy-with-a-dockerfile","9.guides\u002F5.deploy-with-a-dockerfile",{"title":213,"path":214,"stem":215,"exact":11,"children":-1},"Create a staging environment","\u002Fguides\u002Fcreate-a-staging-environment","9.guides\u002F6.create-a-staging-environment","i-lucide-map",{"id":218,"title":133,"badge":219,"body":220,"category":219,"description":559,"draft":147,"extension":560,"links":219,"meta":561,"navigation":11,"path":134,"seo":562,"sitemap":563,"stem":135,"__hash__":564},"docs\u002F4.resources\u002F4.workers.md",null,{"type":221,"value":222,"toc":543},"minimark",[223,227,230,235,265,268,313,328,331,335,338,341,347,352,370,373,377,380,404,408,413,477,484,487,491,502,505,514,517,521,536,540],[224,225,226],"p",{},"A worker is an application built from your repository and kept running, with no public hostname. A scheduled worker is built the same way and run on a schedule, one run at a time, until the command exits. Both have deployments, logs and variables; neither has domains.",[224,228,229],{},"Use a worker for something that waits for work: a queue consumer, a listener, a process that polls. Use a scheduled worker for something that should happen at a time and then stop: a nightly report, an hourly sync, a cleanup.",[231,232,234],"h2",{"id":233},"adding-one","Adding one",[224,236,237,238,242,243,246,247,250,251,254,255,260,261,264],{},"On an environment's ",[239,240,241],"strong",{},"Overview",", choose ",[239,244,245],{},"Add resource",", then ",[239,248,249],{},"Worker"," or ",[239,252,253],{},"Scheduled worker",". Kuppit analyses the branch the environment deploys and proposes what to build, as it does for a ",[256,257,259],"a",{"href":258},"\u002Fresources\u002Fweb-services#adding-a-web-service","web service",". A worker can point at a different ",[239,262,263],{},"Root directory"," of the same repository, so an application and its background process can live side by side.",[224,266,267],{},"Then, for either kind:",[269,270,271,284],"table",{},[272,273,274],"thead",{},[275,276,277,281],"tr",{},[278,279,280],"th",{},"Field",[278,282,283],{},"What it is",[285,286,287,303],"tbody",{},[275,288,289,295],{},[290,291,292],"td",{},[239,293,294],{},"Command",[290,296,297,298,302],{},"The executable and its arguments, separated by spaces. Leave it empty to run the image's own command. On an automatic build the command runs inside the detected runtime, so ",[299,300,301],"code",{},"node"," and the installed packages are available exactly as they are to the start command.",[275,304,305,310],{},[290,306,307],{},[239,308,309],{},"Arguments",[290,311,312],{},"One per line, passed exactly as written. No shell expands them.",[224,314,315,316,319,320,323,324,327],{},"A worker also asks for its ",[239,317,318],{},"Instances",": how many copies are kept running, whether or not there is work. A scheduled worker asks for its ",[239,321,322],{},"Schedule"," and ",[239,325,326],{},"Time zone"," instead.",[224,329,330],{},"A worker can be added to Production or a named environment, never to a preview.",[231,332,334],{"id":333},"how-a-worker-runs","How a worker runs",[224,336,337],{},"A worker's deployment goes through the same steps a web service's does: a build, a revision, then the new revision takes over. What differs is the last step. A web service moves traffic; a worker moves its instances. Until the new revision is running, the previous one keeps working, so a failed deployment never stops a worker that was working.",[224,339,340],{},"A worker's instances are allocated for as long as it exists, and are billed for that time whether or not there is work to do. That is what makes it a worker rather than a web service that scales to zero.",[224,342,343,346],{},[299,344,345],{},"PORT"," is not set, and nothing routes to a worker. A worker that starts an HTTP server is not wrong, but nothing will reach it.",[348,349,351],"h3",{"id":350},"capacity","Capacity",[224,353,354,355,357,358,361,362,365,366,369],{},"The worker's ",[239,356,241],{}," shows how many instances it keeps. ",[239,359,360],{},"Pause"," sets that to zero: the deployment stays, nothing runs, and nothing is billed for compute until ",[239,363,364],{},"Resume",". The ",[239,367,368],{},"Settings"," tab changes the number, from zero up to ten.",[224,371,372],{},"A change to capacity takes effect at once when a deployment is live. If nothing is live yet, it is saved and applied by the first deployment.",[231,374,376],{"id":375},"how-a-scheduled-worker-runs","How a scheduled worker runs",[224,378,379],{},"A scheduled worker's deployment builds the image and prepares the job; when it goes live, the schedule is pointed at the new job. Each run starts the container with the command, waits for it to exit, and records the outcome. A run has one hour to finish.",[224,381,382,383,385,386,389,390,393,394,396,397,250,400,403],{},"The ",[239,384,322],{}," is a five-field cron expression, in the order minute, hour, day of month, month, day of week, with numbers, ranges, lists and steps: ",[299,387,388],{},"0 * * * *"," runs hourly, ",[299,391,392],{},"30 2 * * 1-5"," at 02:30 on weekdays. The ",[239,395,326],{}," is an IANA name, such as ",[299,398,399],{},"UTC",[299,401,402],{},"Europe\u002FAmsterdam",".",[348,405,407],{"id":406},"runs","Runs",[224,409,382,410,412],{},[239,411,241],{}," lists the recent runs, each with its outcome:",[269,414,415,425],{},[272,416,417],{},[275,418,419,422],{},[278,420,421],{},"Run",[278,423,424],{},"Meaning",[285,426,427,437,447,457,467],{},[275,428,429,434],{},[290,430,431],{},[239,432,433],{},"Pending",[290,435,436],{},"Waiting for the runtime to start it.",[275,438,439,444],{},[290,440,441],{},[239,442,443],{},"Running",[290,445,446],{},"The run is executing.",[275,448,449,454],{},[290,450,451],{},[239,452,453],{},"Succeeded",[290,455,456],{},"The run finished and exited cleanly.",[275,458,459,464],{},[290,460,461],{},[239,462,463],{},"Failed",[290,465,466],{},"The run exited with an error or ran out of time.",[275,468,469,474],{},[290,470,471],{},[239,472,473],{},"Cancelled",[290,475,476],{},"The run was stopped before it finished.",[224,478,479,480,483],{},"Every run names the deployment it ran, so a failed run is one click from that deployment and its ",[256,481,482],{"href":111},"runtime logs",". A run that fails is not repeated; the next one starts at the next scheduled time.",[224,485,486],{},"A run that the runtime did not accept — a transient refusal at the moment the schedule fired — is retried once. That means a run may, rarely, start twice. Write the task so that a repeat is harmless.",[348,488,490],{"id":489},"pausing","Pausing",[224,492,493,495,496,498,499,501],{},[239,494,360],{}," keeps the deployment and the schedule; nothing starts until ",[239,497,364],{},". A run already in progress finishes. The ",[239,500,368],{}," tab changes the expression and time zone. As with a worker's capacity, a change takes effect at once when a deployment is live, and with the first deployment otherwise.",[231,503,24],{"id":504},"variables",[224,506,507,508,511,512,403],{},"A worker has its own variables and inherits every variable set on its environment, exactly as a web service does. Values can be literals or references to what another resource exposes, such as a database's ",[299,509,510],{},"DATABASE_URL",". See ",[256,513,144],{"href":145},[224,515,516],{},"A worker does not expose any variables of its own for other resources to reference.",[231,518,520],{"id":519},"in-a-named-environment","In a named environment",[224,522,523,524,527,528,531,532,535],{},"A worker is a component of its environment like any other. When a ",[256,525,526],{"href":183},"named environment"," is created from one that has a worker, the plan offers ",[239,529,530],{},"New worker",", deployed from the new environment's branch with the source's configuration copied across, or ",[239,533,534],{},"Don't include",". A worker copied forward keeps its command, its capacity or schedule, and its variables; a scheduled worker copied forward starts with its schedule paused as its source was.",[231,537,539],{"id":538},"removing-a-worker","Removing a worker",[224,541,542],{},"Deleting a worker stops it, destroys the workload and removes its deployment history and, for a scheduled worker, its runs. Deleting an environment removes its workers with it.",{"title":544,"searchDepth":545,"depth":545,"links":546},"",3,[547,549,552,556,557,558],{"id":233,"depth":548,"text":234},2,{"id":333,"depth":548,"text":334,"children":550},[551],{"id":350,"depth":545,"text":351},{"id":375,"depth":548,"text":376,"children":553},[554,555],{"id":406,"depth":545,"text":407},{"id":489,"depth":545,"text":490},{"id":504,"depth":548,"text":24},{"id":519,"depth":548,"text":520},{"id":538,"depth":548,"text":539},"A worker runs your code continuously without a hostname; a scheduled worker runs it on a cron schedule until it exits. Both build and deploy exactly as a web service does.","md",{},{"title":133,"description":559},{"loc":134},"Y1fFE1UjggyUKpp70SETOeRxgAPHIDIkYfa-g0cJ5Ag",[566,568],{"title":129,"path":130,"stem":131,"description":567,"children":-1},"Provision a managed PostgreSQL database in an environment and connect your services to it through variables.",{"title":144,"path":145,"stem":146,"description":569,"children":-1},"How variables are set on services and environments, how references connect resources, and how secrets are handled.",1788900990287]