[{"data":1,"prerenderedAt":1731},["ShallowReactive",2],{"navigation":3,"page:\u002Fconcepts\u002Fqueueing":1019,"surround:\u002Fconcepts\u002Fqueueing":1722},[4,21,82,133,154,1010],[5,6,7,8],"Getting started","\u002Fgetting-started","i-lucide-rocket",[9,12,15,18],[10,6,11,11],"What Kaabist is",0,[13,14,11,11],"API keys and modes","keys-and-modes",[16,17,11,11],"Your first job","first-job",[19,20,11,11],"Understanding the envelope","envelope",[22,23,24,25],"Concepts","\u002Fconcepts","i-lucide-book-open",[26,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79],[27,23,11,11],"Overview",[29,30,11,11],"Programs and versions","programs-and-versions",[32,33,11,11],"Tiers and escalation","tiers-and-escalation",[35,36,11,11],"The http tier","http-tier",[38,39,11,11],"The browser tier","browser-tier",[41,42,11,11],"Sessions","sessions",[44,45,11,11],"Human in the loop","human-in-the-loop",[47,48,11,11],"How healing works","self-healing",[50,51,11,11],"Obstacles and captchas","obstacles",[53,54,11,11],"Validation and warnings","validation-and-warnings",[56,57,11,11],"Credits and billing","credits-and-billing",[59,60,11,11],"Limits","limits",[62,63,11,11],"Locators","locators",[65,66,11,11],"Snapshots","snapshots",[68,69,11,11],"Egress and proxies","egress-and-proxies",[71,72,11,11],"Queueing and fairness","queueing",[74,75,11,11],"Accounts, organisations and roles","accounts-and-roles",[77,78,11,11],"Data retention","data-retention",[80,81,11,11],"Documents and PDFs","documents-and-pdfs",[83,84,85,86],"Guides","\u002Fguides","i-lucide-map",[87,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130],[27,84,11,11],[89,90,11,11],"Authenticated flows","authenticated-flows",[92,93,11,11],"Hosted resolve pages","hosted-resolve",[95,96,11,11],"Lists and pagination","lists-and-pagination",[98,99,11,11],"JSON and network locators","json-and-network-locators",[101,102,11,11],"Schedules and change detection","schedules-and-change-detection",[104,105,11,11],"Webhooks","webhooks",[107,108,11,11],"Bring your own providers","byo-providers",[110,111,11,11],"Testing: replay, dry-run and test mode","testing",[113,114,11,11],"Side-effect safety","side-effect-safety",[116,117,11,11],"Security & data handling","security-and-data",[119,120,11,11],"Migrating from other tools","migrating",[122,123,11,11],"Drift detection and canaries","drift-and-canaries",[125,126,11,11],"SDKs","sdks",[128,129,11,11],"The kaab CLI","cli",[131,132,11,11],"Coding agents (MCP)","mcp",[134,135,136,137],"Panel","\u002Fpanel","i-lucide-layout-dashboard",[138,139,142,145,148,151],[27,135,11,11],[140,141,11,11],"The program builder","builder",[143,144,11,11],"Picking and recording","picking-and-recording",[146,147,11,11],"Taking over a job","takeover",[149,150,11,11],"Getting help","support",[152,153,11,11],"Referrals","referrals",[155,156,157,158],"Reference","\u002Freference","i-lucide-library",[159,160,520,834,837,840,1006,1007],[27,156,11,11],[161,162,11,163],"API","api",[164,166,169,212,222,274,297,316,347,376,389,396,403,410,426,447,454],[27,165,11,11],"\u002Freference\u002Fapi",[167,168,11,11],"Interactive reference","explorer",[170,171,11,172],"Jobs","jobs",[173,176,179,182,185,188,191,194,197,200,203,206,209],[174,175,11,11],"Create job","create-job",[177,178,11,11],"List jobs","list-jobs",[180,181,11,11],"Create job batch","create-job-batch",[183,184,11,11],"Estimate job","estimate-job",[186,187,11,11],"Get job","get-job",[189,190,11,11],"List job steps","list-job-steps",[192,193,11,11],"Get job snapshot","get-job-snapshot",[195,196,11,11],"Get job screenshot","get-job-screenshot",[198,199,11,11],"Get job artifact","get-job-artifact",[201,202,11,11],"Submit job input","submit-job-input",[204,205,11,11],"Resume job","resume-job",[207,208,11,11],"Takeover job","takeover-job",[210,211,11,11],"Cancel job","cancel-job",[213,214,11,215],"Batches","batches",[216,219],[217,218,11,11],"Get batch","get-batch",[220,221,11,11],"List batch jobs","list-batch-jobs",[223,224,11,225],"Programs","programs",[226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271],[227,228,11,11],"Create program","create-program",[230,231,11,11],"List programs","list-programs",[233,234,11,11],"Lint program","lint-program",[236,237,11,11],"Get program","get-program",[239,240,11,11],"Update program","update-program",[242,243,11,11],"Delete program","delete-program",[245,246,11,11],"List program versions","list-program-versions",[248,249,11,11],"Create program version","create-program-version",[251,252,11,11],"Update program version","update-program-version",[254,255,11,11],"Delete program version","delete-program-version",[257,258,11,11],"Get program version","get-program-version",[260,261,11,11],"Publish program version","publish-program-version",[263,264,11,11],"Diff program version","diff-program-version",[266,267,11,11],"Replay program version","replay-program-version",[269,270,11,11],"Set program alias","set-program-alias",[272,273,11,11],"Delete program alias","delete-program-alias",[41,42,11,275],[276,279,282,285,288,291,294],[277,278,11,11],"Create session","create-session",[280,281,11,11],"List sessions","list-sessions",[283,284,11,11],"Get session","get-session",[286,287,11,11],"Update session","update-session",[289,290,11,11],"Delete session","delete-session",[292,293,11,11],"Verify session","verify-session",[295,296,11,11],"Refresh session","refresh-session",[298,299,11,300],"Proposals","proposals",[301,304,307,310,313],[302,303,11,11],"List proposals","list-proposals",[305,306,11,11],"Get proposal","get-proposal",[308,309,11,11],"Approve proposal","approve-proposal",[311,312,11,11],"Reject proposal","reject-proposal",[314,315,11,11],"Edit proposal","edit-proposal",[317,318,11,319],"Schedules","schedules",[320,323,326,329,332,335,338,341,344],[321,322,11,11],"Create schedule","create-schedule",[324,325,11,11],"List schedules","list-schedules",[327,328,11,11],"Get schedule","get-schedule",[330,331,11,11],"Update schedule","update-schedule",[333,334,11,11],"Delete schedule","delete-schedule",[336,337,11,11],"Pause schedule","pause-schedule",[339,340,11,11],"Resume schedule","resume-schedule",[342,343,11,11],"List schedule runs","list-schedule-runs",[345,346,11,11],"Get schedule run diff","get-schedule-run-diff",[104,105,11,348],[349,352,355,358,361,364,367,370,373],[350,351,11,11],"Create webhook","create-webhook",[353,354,11,11],"List webhooks","list-webhooks",[356,357,11,11],"Get webhook","get-webhook",[359,360,11,11],"Update webhook","update-webhook",[362,363,11,11],"Delete webhook","delete-webhook",[365,366,11,11],"Rotate webhook secret","rotate-webhook-secret",[368,369,11,11],"List webhook deliveries","list-webhook-deliveries",[371,372,11,11],"Resend webhook delivery","resend-webhook-delivery",[374,375,11,11],"Test webhook","test-webhook",[377,378,11,379],"Organisation","org",[380,383,386],[381,382,11,11],"Rotate org webhook secret","rotate-org-webhook-secret",[384,385,11,11],"Get org","get-org",[387,388,11,11],"Request data deletion","request-data-deletion",[390,391,11,392],"Credits","credits",[393],[394,395,11,11],"Get credits","get-credits",[397,398,11,399],"Ledger","ledger",[400],[401,402,11,11],"List ledger entries","list-ledger-entries",[404,405,11,406],"Usage","usage",[407],[408,409,11,11],"Get usage","get-usage",[411,412,11,413],"API keys","api-keys",[414,417,420,423],[415,416,11,11],"List API keys","list-api-keys",[418,419,11,11],"Create API key","create-api-key",[421,422,11,11],"Rotate API key","rotate-api-key",[424,425,11,11],"Revoke API key","revoke-api-key",[427,108,11,428],"BYO providers",[429,432,435,438,441,444],[430,431,11,11],"List BYO providers","list-byo-providers",[433,434,11,11],"Create BYO provider","create-byo-provider",[436,437,11,11],"Get BYO provider","get-byo-provider",[439,440,11,11],"Update BYO provider","update-byo-provider",[442,443,11,11],"Delete BYO provider","delete-byo-provider",[445,446,11,11],"Test BYO provider","test-byo-provider",[448,449,11,450],"Sites","sites",[451],[452,453,11,11],"Get site profile","get-site-profile",[455,456,11,457],"Objects","schemas",[458,460,463,466,469,470,473,476,479,482,485,487,490,493,496,499,502,505,508,511,514,517],[27,459,11,11],"\u002Freference\u002Fapi\u002Fschemas",[461,462,11,11],"ApiKey","api-key",[464,465,11,11],"Batch","batch",[467,468,11,11],"ByoProvider","byo-provider",[390,391,11,11],[471,472,11,11],"ErrorResponse","error-response",[474,475,11,11],"ExtractSchema","extract-schema",[477,478,11,11],"Job","job",[480,481,11,11],"LedgerEntry","ledger-entry",[483,484,11,11],"LintResult","lint-result",[486,378,11,11],"Org",[488,489,11,11],"Program","program",[491,492,11,11],"ProgramDefinition","program-definition",[494,495,11,11],"ProgramVersion","program-version",[497,498,11,11],"Proposal","proposal",[500,501,11,11],"Schedule","schedule",[503,504,11,11],"Session","session",[506,507,11,11],"SiteProfile","site-profile",[509,510,11,11],"StepRecord","step-record",[512,513,11,11],"Webhook","webhook",[515,516,11,11],"WebhookDelivery","webhook-delivery",[518,519,11,11],"WebhookEvent","webhook-event",[521,522,11,523],"DSL","dsl",[524,526,529,532,535,538,603,637,640,751,754,756],[27,525,11,11],"\u002Freference\u002Fdsl",[527,528,11,11],"Inputs","inputs",[530,531,11,11],"Options","options",[533,534,11,11],"Policies","policies",[536,537,11,11],"Steps","steps",[539,540,11,541],"Actions","actions",[542,544,546,548,550,552,554,556,558,560,562,565,568,570,573,575,577,579,582,585,587,589,591,594,596,598,600],[27,543,11,11],"\u002Freference\u002Fdsl\u002Factions",[545,545,11,11],"fill",[547,547,11,11],"click",[549,549,11,11],"press",[551,551,11,11],"hover",[553,553,11,11],"select",[555,555,11,11],"check",[557,557,11,11],"uncheck",[559,559,11,11],"upload",[561,561,11,11],"scroll",[563,564,11,11],"wait_for","wait-for",[566,567,11,11],"set_session","set-session",[569,569,11,11],"extract",[571,572,11,11],"capture_response","capture-response",[574,574,11,11],"evaluate",[576,576,11,11],"paginate",[578,578,11,11],"download",[580,581,11,11],"read_pdf","read-pdf",[583,584,11,11],"set_vars","set-vars",[586,586,11,11],"sleep",[588,588,11,11],"reload",[590,590,11,11],"goto",[592,593,11,11],"await_input","await-input",[595,595,11,11],"checkpoint",[597,597,11,11],"screenshot",[599,599,11,11],"when",[601,602,11,11],"loop_until","loop-until",[604,605,11,606],"Conditions","conditions",[607,609,611,613,615,617,619,621,623,625,627,629,631,633,635],[27,608,11,11],"\u002Freference\u002Fdsl\u002Fconditions",[610,610,11,11],"url",[612,612,11,11],"title",[614,614,11,11],"visible",[616,616,11,11],"hidden",[618,618,11,11],"exists",[620,620,11,11],"absent",[622,622,11,11],"text",[624,624,11,11],"count",[626,626,11,11],"network",[628,628,11,11],"var",[630,630,11,11],"landmark",[632,632,11,11],"all",[634,634,11,11],"any",[636,636,11,11],"not",[638,639,11,11],"Targets","targets",[641,642,11,643],"Fields","fields",[644,646,649,651,654,656,659,661,663,666,668,671,672,674,677,679,681,683,685,687,690,693,695,698,701,703,704,707,709,712,714,716,718,720,722,724,726,728,731,733,734,736,738,740,743,745,747,749],[27,645,11,11],"\u002Freference\u002Fdsl\u002Ffields",[647,648,11,11],"allow_suffix","allow-suffix",[650,650,11,11],"attr",[652,653,11,11],"base_url","base-url",[655,655,11,11],"candidates",[657,658,11,11],"case_insensitive","case-insensitive",[660,660,11,11],"country",[662,662,11,11],"currency",[664,665,11,11],"date_format","date-format",[667,667,11,11],"decimal",[669,670,11,11],"false_values","false-values",[642,642,11,11],[673,673,11,11],"flags",[675,676,11,11],"follow_redirects","follow-redirects",[678,678,11,11],"frame",[680,680,11,11],"json",[682,682,11,11],"locale",[684,684,11,11],"many",[686,686,11,11],"max",[688,689,11,11],"max_items","max-items",[691,692,11,11],"max_length","max-length",[694,694,11,11],"min",[696,697,11,11],"min_items","min-items",[699,700,11,11],"min_length","min-length",[702,702,11,11],"name",[626,626,11,11],[705,706,11,11],"null_markers","null-markers",[708,708,11,11],"nullable",[710,711,11,11],"on_invalid","on-invalid",[713,713,11,11],"pattern",[715,715,11,11],"presence",[717,717,11,11],"regex",[719,719,11,11],"required",[721,721,11,11],"role",[723,723,11,11],"sample",[725,725,11,11],"selector",[727,727,11,11],"source",[729,730,11,11],"strip_fragment","strip-fragment",[732,732,11,11],"testid",[622,622,11,11],[735,735,11,11],"thousands",[737,737,11,11],"timezone",[739,739,11,11],"transforms",[741,742,11,11],"true_values","true-values",[744,744,11,11],"type",[746,746,11,11],"unique",[748,748,11,11],"values",[750,750,11,11],"xpath",[752,753,11,11],"Assertions","assertions",[755,739,11,11],"Transforms",[757,758,11,759],"Lint codes","lint",[760,762,765,768,771,774,777,780,783,786,789,792,795,798,801,804,807,810,813,816,819,822,825,828,831],[27,761,11,11],"\u002Freference\u002Fdsl\u002Flint",[763,764,11,11],"E001","e001",[766,767,11,11],"E002","e002",[769,770,11,11],"E003","e003",[772,773,11,11],"E004","e004",[775,776,11,11],"E005","e005",[778,779,11,11],"E006","e006",[781,782,11,11],"E007","e007",[784,785,11,11],"E008","e008",[787,788,11,11],"E009","e009",[790,791,11,11],"E010","e010",[793,794,11,11],"E011","e011",[796,797,11,11],"E012","e012",[799,800,11,11],"E013","e013",[802,803,11,11],"E014","e014",[805,806,11,11],"W001","w001",[808,809,11,11],"W002","w002",[811,812,11,11],"W003","w003",[814,815,11,11],"W004","w004",[817,818,11,11],"W005","w005",[820,821,11,11],"W006","w006",[823,824,11,11],"W007","w007",[826,827,11,11],"W008","w008",[829,830,11,11],"W009","w009",[832,833,11,11],"W010","w010",[835,836,11,11],"Codes","codes",[838,839,11,11],"Events","events",[841,129,11,842],"CLI",[843,845,847,850,853,856,859,862,865,868,871,874,877,880,883,886,889,892,895,898,901,904,907,910,913,916,919,922,925,928,931,934,937,940,943,946,949,952,955,958,961,964,967,970,973,976,979,982,985,988,991,994,997,1000,1003],[27,844,11,11],"\u002Freference\u002Fcli",[846,846,11,11],"kaab",[848,849,11,11],"kaab auth","kaab-auth",[851,852,11,11],"kaab auth login","kaab-auth-login",[854,855,11,11],"kaab auth logout","kaab-auth-logout",[857,858,11,11],"kaab auth status","kaab-auth-status",[860,861,11,11],"kaab completion","kaab-completion",[863,864,11,11],"kaab completion bash","kaab-completion-bash",[866,867,11,11],"kaab completion fish","kaab-completion-fish",[869,870,11,11],"kaab completion powershell","kaab-completion-powershell",[872,873,11,11],"kaab completion zsh","kaab-completion-zsh",[875,876,11,11],"kaab credits","kaab-credits",[878,879,11,11],"kaab jobs","kaab-jobs",[881,882,11,11],"kaab jobs cancel","kaab-jobs-cancel",[884,885,11,11],"kaab jobs get","kaab-jobs-get",[887,888,11,11],"kaab jobs input","kaab-jobs-input",[890,891,11,11],"kaab jobs list","kaab-jobs-list",[893,894,11,11],"kaab jobs resume","kaab-jobs-resume",[896,897,11,11],"kaab jobs run","kaab-jobs-run",[899,900,11,11],"kaab jobs snapshot","kaab-jobs-snapshot",[902,903,11,11],"kaab jobs steps","kaab-jobs-steps",[905,906,11,11],"kaab jobs takeover","kaab-jobs-takeover",[908,909,11,11],"kaab open","kaab-open",[911,912,11,11],"kaab open job","kaab-open-job",[914,915,11,11],"kaab programs","kaab-programs",[917,918,11,11],"kaab programs alias","kaab-programs-alias",[920,921,11,11],"kaab programs alias set","kaab-programs-alias-set",[923,924,11,11],"kaab programs diff","kaab-programs-diff",[926,927,11,11],"kaab programs lint","kaab-programs-lint",[929,930,11,11],"kaab programs list","kaab-programs-list",[932,933,11,11],"kaab programs pull","kaab-programs-pull",[935,936,11,11],"kaab programs push","kaab-programs-push",[938,939,11,11],"kaab proposals","kaab-proposals",[941,942,11,11],"kaab proposals approve","kaab-proposals-approve",[944,945,11,11],"kaab proposals list","kaab-proposals-list",[947,948,11,11],"kaab proposals reject","kaab-proposals-reject",[950,951,11,11],"kaab proposals show","kaab-proposals-show",[953,954,11,11],"kaab schedules","kaab-schedules",[956,957,11,11],"kaab schedules create","kaab-schedules-create",[959,960,11,11],"kaab schedules list","kaab-schedules-list",[962,963,11,11],"kaab schedules pause","kaab-schedules-pause",[965,966,11,11],"kaab schedules resume","kaab-schedules-resume",[968,969,11,11],"kaab schedules runs","kaab-schedules-runs",[971,972,11,11],"kaab sessions","kaab-sessions",[974,975,11,11],"kaab sessions create","kaab-sessions-create",[977,978,11,11],"kaab sessions delete","kaab-sessions-delete",[980,981,11,11],"kaab sessions list","kaab-sessions-list",[983,984,11,11],"kaab sessions verify","kaab-sessions-verify",[986,987,11,11],"kaab usage","kaab-usage",[989,990,11,11],"kaab version","kaab-version",[992,993,11,11],"kaab webhooks","kaab-webhooks",[995,996,11,11],"kaab webhooks create","kaab-webhooks-create",[998,999,11,11],"kaab webhooks deliveries","kaab-webhooks-deliveries",[1001,1002,11,11],"kaab webhooks list","kaab-webhooks-list",[1004,1005,11,11],"kaab webhooks test","kaab-webhooks-test",[125,126,11,11],[1008,1009,11,11],"Plans and pricing","plans",[1011,1012,1013,1014],"Changelog","\u002Fchangelog","i-lucide-history",[1015,1016],[27,1012,11,11],[1017,1018,11,11],"Deprecations","deprecations",{"id":1020,"title":71,"body":1021,"breaking":1712,"date":1713,"description":1714,"extension":1715,"generated":1712,"meta":1716,"navigation":1717,"path":1718,"seo":1719,"stem":1720,"version":1713,"__hash__":1721},"docs\u002F2.concepts\u002F15.queueing.md",{"type":1022,"value":1023,"toc":1699},"minimark",[1024,1028,1033,1049,1053,1160,1173,1177,1185,1188,1204,1215,1219,1230,1234,1241,1251,1255,1262,1283,1293,1297,1311,1315,1333,1337,1358,1368,1455,1467,1539,1554,1581,1585,1632,1635,1695],[1025,1026,1027],"p",{},"Creating a job does not start it: the job is written down, a dispatcher picks it up, usually within a quarter of a second, and a worker runs it. This page is what happens in between, because \"why has my job not started yet\" has a short list of answers, and only one of them needs you to do something.",[1029,1030,1032],"h2",{"id":1031},"when-to-use-it","When to use it",[1025,1034,1035,1036,1040,1041,1044,1045,1048],{},"Read this page when a job stays ",[1037,1038,1039],"code",{},"queued"," longer than you expect, when you see ",[1037,1042,1043],{},"meta.blocked_reason"," or receive a ",[1037,1046,1047],{},"job.blocked"," event, when you submit large batches next to latency-sensitive jobs, or when you want to know what a worker crash means for a job that was halfway through.",[1029,1050,1052],{"id":1051},"why-a-job-is-waiting","Why a job is waiting",[1054,1055,1056,1072],"table",{},[1057,1058,1059],"thead",{},[1060,1061,1062,1066,1069],"tr",{},[1063,1064,1065],"th",{},"What you see",[1063,1067,1068],{},"What it means",[1063,1070,1071],{},"What changes it",[1073,1074,1075,1089,1113,1129,1144],"tbody",{},[1060,1076,1077,1083,1086],{},[1078,1079,1080,1082],"td",{},[1037,1081,1039],{},", briefly",[1078,1084,1085],{},"it is waiting its turn; ordinary, and measured in milliseconds",[1078,1087,1088],{},"nothing",[1060,1090,1091,1096,1110],{},[1078,1092,1093,1095],{},[1037,1094,1039],{},", with your plan's slots at this tier all busy",[1078,1097,1098,1099,1102,1103,1106,1107],{},"your concurrency limit; ",[1037,1100,1101],{},"GET \u002Fv1\u002Forg"," shows ",[1037,1104,1105],{},"in_use"," equal to ",[1037,1108,1109],{},"limit",[1078,1111,1112],{},"one of your jobs at that tier finishes",[1060,1114,1115,1123,1126],{},[1078,1116,1117,1119,1120],{},[1037,1118,1039],{},", with ",[1037,1121,1122],{},"meta.blocked_reason: \"insufficient_credits\"",[1078,1124,1125],{},"the job needs a reservation it does not hold, and your balance cannot cover it",[1078,1127,1128],{},"credits arrive",[1060,1130,1131,1138,1141],{},[1078,1132,1133,1119,1135],{},[1037,1134,1039],{},[1037,1136,1137],{},"meta.blocked_reason: \"session_locked\"",[1078,1139,1140],{},"another job of yours holds the exclusive lock on the session this job needs",[1078,1142,1143],{},"that job ends",[1060,1145,1146,1154,1157],{},[1078,1147,1148,1119,1150,1153],{},[1037,1149,1039],{},[1037,1151,1152],{},"scheduled_for"," in the future",[1078,1155,1156],{},"you, or a schedule, asked for it to run later",[1078,1158,1159],{},"the time arrives",[1025,1161,1162,1163,1165,1166,1169,1170,1172],{},"Only the credits case needs you to act. The ",[1037,1164,1047],{}," event fires once when a job enters that state, with ",[1037,1167,1168],{},"reason: \"insufficient_credits\"",", not on every attempt to dispatch it. ",[1037,1171,1043],{}," is cleared when the job is dispatched. A job waiting for a session lock is served in the order the jobs asked for it, and fires no event.",[1029,1174,1176],{"id":1175},"your-turn-is-weighted-not-first-come-first-served","Your turn is weighted, not first-come-first-served",[1025,1178,1179,1180,1184],{},"If one customer submits fifty thousand jobs, everybody else's jobs still start in seconds. Each organisation has a share of the queue proportional to its plan's ",[1181,1182,1183],"strong",{},"weight"," (1 on free, 2 on developer, 4 on team, 8 on scale), and dispatching a job spends that share in proportion to what the job is expected to cost: a stealth-tier run spends twenty times what an http-tier one does.",[1025,1186,1187],{},"Two consequences:",[1189,1190,1191,1198],"ul",{},[1192,1193,1194,1197],"li",{},[1181,1195,1196],{},"Idleness is not saved up."," An organisation that has been quiet for an hour does not get to empty the queue when it wakes up; it rejoins at the current position and takes its share from there.",[1192,1199,1200,1203],{},[1181,1201,1202],{},"A big batch does not lock anyone out, including you."," Your own five thousand jobs are spread across rounds rather than dispatched in one go, so a job you submit afterwards is not stuck behind all of them.",[1025,1205,1206,1209,1210,1214],{},[1037,1207,1208],{},"priority"," (0 to 9 on job creation) sits ",[1211,1212,1213],"em",{},"above"," all of this: a priority-9 job goes before every priority-0 job, whatever the weights say. Fairness then decides the order inside each priority band.",[1029,1216,1218],{"id":1217},"concurrency-is-per-plan-and-per-tier","Concurrency is per plan and per tier",[1025,1220,1221,1222,1224,1225,1229],{},"Your plan buys a number of concurrent jobs at each tier, and the three are counted separately: using all your browser slots does not stop http jobs from running. A job over the limit stays ",[1037,1223,1039],{}," and starts as soon as one of your own jobs at that tier finishes; it is never failed for it. The numbers per plan are on ",[1226,1227,1008],"a",{"href":1228},"\u002Freference\u002Fplans",".",[1029,1231,1233],{"id":1232},"credits-are-reserved-then-settled","Credits are reserved, then settled",[1025,1235,1236,1237,1240],{},"Creating a job reserves what it might cost; finishing it settles what it did cost and gives the rest back. If the reservation cannot be made at creation, the request answers ",[1037,1238,1239],{},"402 insufficient_credits"," and no job exists. A job that fails because of an internal error is refunded in full. Time a job spends parked is free.",[1025,1242,1243,1244,1247,1248,1229],{},"Some jobs need to reserve again after they were created, and that is when one can wait as ",[1037,1245,1246],{},"insufficient_credits"," instead of failing. An escalation is the common case: a job that starts at the http tier and finds a page that needs a browser goes back to the queue asking for a browser, and must reserve the difference. See ",[1226,1249,56],{"href":1250},"\u002Fconcepts\u002Fcredits-and-billing",[1029,1252,1254],{"id":1253},"what-happens-when-a-worker-dies","What happens when a worker dies",[1025,1256,1257,1258,1261],{},"A running job holds a ",[1181,1259,1260],{},"lease"," that its worker renews every ten seconds. If the worker is replaced, crashes or is killed, the lease expires, and within fifteen seconds of that the job goes back to the queue and restarts from its last checkpoint, without reserving its credits twice. You see this as a job that took longer, not as a job that failed. Its session lock, if it had one, is released at the same moment.",[1025,1263,1264,1265,1268,1269,1271,1272,1275,1276,1279,1280,1229],{},"There is one exception, and it is deliberate. If the worker stopped in the middle of a step marked ",[1037,1266,1267],{},"side_effect: true"," (placing an order, sending a message), nobody can know whether it happened. The job is ",[1181,1270,636],{}," retried. It parks as ",[1037,1273,1274],{},"needs_attention"," with the reason ",[1037,1277,1278],{},"side_effect_ambiguous",", and a person decides. Kaabist would rather ask you than place an order twice. See ",[1226,1281,113],{"href":1282},"\u002Fguides\u002Fside-effect-safety",[1025,1284,1285,1286,1289,1290,1229],{},"A job always ends: a step that runs past its own budget, or a job past its ",[1037,1287,1288],{},"max_duration_ms",", is stopped by the worker's watchdog and fails with ",[1037,1291,1292],{},"timeout",[1029,1294,1296],{"id":1295},"cancelling","Cancelling",[1025,1298,1299,1302,1303,1306,1307,1310],{},[1037,1300,1301],{},"POST \u002Fv1\u002Fjobs\u002F{id}\u002Fcancel"," on a job that is queued or parked cancels it at once and releases the credits it reserved. On a running job it answers with the job still ",[1037,1304,1305],{},"running"," and the cancel recorded; the worker hears it at once and stops the run within seconds, and a job whose worker has not ended it thirty seconds after the request is ended for it. A job inside an open side-effect fence cannot be canceled (",[1037,1308,1309],{},"409 fence_open","), for the same reason it is not retried.",[1029,1312,1314],{"id":1313},"resuming-a-parked-job","Resuming a parked job",[1025,1316,1317,1320,1321,1324,1325,1328,1329,1332],{},[1037,1318,1319],{},"POST \u002Fv1\u002Fjobs\u002F{id}\u002Finput"," and ",[1037,1322,1323],{},"POST \u002Fv1\u002Fjobs\u002F{id}\u002Fresume"," put a parked job back in the queue, and the dispatcher sends it to a worker again. Both reserve credits first, and answer ",[1037,1326,1327],{},"402"," if they cannot. When the value arrives while the browser context is still alive (within the step's keep-alive window, five minutes by default), the job goes straight back to the worker holding that context and carries on from exactly where it stopped. After that it resumes from its last checkpoint instead, which is slower but produces the same result. ",[1037,1330,1331],{},"meta.resumed_from"," says which happened.",[1029,1334,1336],{"id":1335},"worked-example","Worked example",[1025,1338,1339,1342,1343,1346,1347,1320,1350,1353,1354,1357],{},[1181,1340,1341],{},"Blocked on credits."," An organisation runs a program against ",[1037,1344,1345],{},"https:\u002F\u002Fapp.example.com\u002Fp\u002F1",", whose server prints a placeholder price, with ",[1037,1348,1349],{},"prefer_tier: \"http\"",[1037,1351,1352],{},"max_tier: \"browser\"",". The http fetch reads the server's placeholder, the program's ",[1037,1355,1356],{},"expect"," on the price fails, and the job must escalate to a browser, which costs five credits instead of one. The organisation's available balance is two.",[1025,1359,1360,1361,1363,1364,1367],{},"The job goes back to ",[1037,1362,1039],{},", and ",[1037,1365,1366],{},"GET \u002Fv1\u002Fjobs\u002F{id}"," shows:",[1369,1370,1374],"pre",{"className":1371,"code":1372,"language":680,"meta":1373,"style":1373},"language-json shiki shiki-themes kaab-code kaab-code kaab-code","{\n  \"id\": \"job_01J…\",\n  \"status\": \"queued\",\n  \"meta\": { \"tier_requested\": \"http\", \"blocked_reason\": \"insufficient_credits\" }\n}\n","",[1037,1375,1376,1385,1403,1416,1449],{"__ignoreMap":1373},[1377,1378,1381],"span",{"class":1379,"line":1380},"line",1,[1377,1382,1384],{"class":1383},"sTzsn","{\n",[1377,1386,1388,1392,1396,1400],{"class":1379,"line":1387},2,[1377,1389,1391],{"class":1390},"sqn18","  \"id\"",[1377,1393,1395],{"class":1394},"sQm2-",":",[1377,1397,1399],{"class":1398},"suOy4"," \"job_01J…\"",[1377,1401,1402],{"class":1394},",\n",[1377,1404,1406,1409,1411,1414],{"class":1379,"line":1405},3,[1377,1407,1408],{"class":1390},"  \"status\"",[1377,1410,1395],{"class":1394},[1377,1412,1413],{"class":1398}," \"queued\"",[1377,1415,1402],{"class":1394},[1377,1417,1419,1422,1424,1427,1430,1432,1435,1438,1441,1443,1446],{"class":1379,"line":1418},4,[1377,1420,1421],{"class":1390},"  \"meta\"",[1377,1423,1395],{"class":1394},[1377,1425,1426],{"class":1383}," { ",[1377,1428,1429],{"class":1390},"\"tier_requested\"",[1377,1431,1395],{"class":1394},[1377,1433,1434],{"class":1398}," \"http\"",[1377,1436,1437],{"class":1394},",",[1377,1439,1440],{"class":1390}," \"blocked_reason\"",[1377,1442,1395],{"class":1394},[1377,1444,1445],{"class":1398}," \"insufficient_credits\"",[1377,1447,1448],{"class":1383}," }\n",[1377,1450,1452],{"class":1379,"line":1451},5,[1377,1453,1454],{"class":1383},"}\n",[1025,1456,1457,1458,1460,1461,1320,1463,1466],{},"A webhook endpoint subscribed to ",[1037,1459,1047],{}," receives one event; its ",[1037,1462,744],{},[1037,1464,1465],{},"data"," are:",[1369,1468,1470],{"className":1371,"code":1469,"language":680,"meta":1373,"style":1373},"{\n  \"type\": \"job.blocked\",\n  \"data\": { \"job\": \"job_01J…\", \"program\": \"ssr-price@1\", \"reason\": \"insufficient_credits\", \"url\": \"https:\u002F\u002Fapi.kaab.ist\u002Fv1\u002Fjobs\u002Fjob_01J…\" }\n}\n",[1037,1471,1472,1476,1488,1535],{"__ignoreMap":1373},[1377,1473,1474],{"class":1379,"line":1380},[1377,1475,1384],{"class":1383},[1377,1477,1478,1481,1483,1486],{"class":1379,"line":1387},[1377,1479,1480],{"class":1390},"  \"type\"",[1377,1482,1395],{"class":1394},[1377,1484,1485],{"class":1398}," \"job.blocked\"",[1377,1487,1402],{"class":1394},[1377,1489,1490,1493,1495,1497,1500,1502,1504,1506,1509,1511,1514,1516,1519,1521,1523,1525,1528,1530,1533],{"class":1379,"line":1405},[1377,1491,1492],{"class":1390},"  \"data\"",[1377,1494,1395],{"class":1394},[1377,1496,1426],{"class":1383},[1377,1498,1499],{"class":1390},"\"job\"",[1377,1501,1395],{"class":1394},[1377,1503,1399],{"class":1398},[1377,1505,1437],{"class":1394},[1377,1507,1508],{"class":1390}," \"program\"",[1377,1510,1395],{"class":1394},[1377,1512,1513],{"class":1398}," \"ssr-price@1\"",[1377,1515,1437],{"class":1394},[1377,1517,1518],{"class":1390}," \"reason\"",[1377,1520,1395],{"class":1394},[1377,1522,1445],{"class":1398},[1377,1524,1437],{"class":1394},[1377,1526,1527],{"class":1390}," \"url\"",[1377,1529,1395],{"class":1394},[1377,1531,1532],{"class":1398}," \"https:\u002F\u002Fapi.kaab.ist\u002Fv1\u002Fjobs\u002Fjob_01J…\"",[1377,1534,1448],{"class":1383},[1377,1536,1537],{"class":1379,"line":1418},[1377,1538,1454],{"class":1383},[1025,1540,1541,1542,1545,1546,1549,1550,1553],{},"Someone buys a pack on the billing page. The dispatcher's next round finds the balance can cover the reservation, the job is dispatched, ",[1037,1543,1544],{},"blocked_reason"," disappears, and the job finishes at the browser tier with an ",[1037,1547,1548],{},"escalated"," warning and ",[1037,1551,1552],{},"meta.escalations"," recording the move.",[1025,1555,1556,1559,1560,1562,1563,1566,1567,1570,1571,1320,1574,1576,1577,1580],{},[1181,1557,1558],{},"Requeued after a worker was replaced."," A long browser job is running when its worker is replaced during a deployment. The job's ",[1181,1561,838],{}," tab in the panel shows ",[1037,1564,1565],{},"started",", then ",[1037,1568,1569],{},"lease_expired"," once the lease runs out, then ",[1037,1572,1573],{},"leased",[1037,1575,1565],{}," again as another worker picks it up from its last checkpoint, then ",[1037,1578,1579],{},"finished",". The result is the same as an uninterrupted run, it took longer, and it was not charged twice.",[1029,1582,1584],{"id":1583},"pitfalls","Pitfalls",[1189,1586,1587,1598,1607,1620,1626],{},[1192,1588,1589,1597],{},[1181,1590,1591,1593,1594,1596],{},[1037,1592,1039],{}," with no ",[1037,1595,1544],{}," is not a problem."," It is your concurrency limit or the queue working as sold. Raise concurrency with a bigger plan, not with more API keys.",[1192,1599,1600,1603,1604,1606],{},[1181,1601,1602],{},"A batch shares your concurrency with everything else."," Give latency-sensitive jobs a higher ",[1037,1605,1208],{}," instead of waiting for the batch to drain.",[1192,1608,1609,1612,1613,1616,1617,1229],{},[1181,1610,1611],{},"An exclusive session serialises its jobs."," Ten jobs on one exclusive session run one at a time. Mark the session ",[1037,1614,1615],{},"shared"," only when the site tolerates parallel use; see ",[1226,1618,41],{"href":1619},"\u002Fconcepts\u002Fsessions",[1192,1621,1622,1625],{},[1181,1623,1624],{},"Every side-effect step should be followed by a checkpoint."," A requeued job restarts from its last checkpoint; without one after the side effect, a crash parks the job for a person.",[1192,1627,1628,1631],{},[1181,1629,1630],{},"Out of credits pauses schedules too."," They resume when credits arrive, and they do not fire while paused.",[1029,1633,155],{"id":1634},"reference",[1189,1636,1637,1652,1663,1673,1688],{},[1192,1638,1639,1643,1644,1643,1648],{},[1226,1640,1642],{"href":1641},"\u002Freference\u002Fapi\u002Fjobs\u002Fget-job","Get a job",", ",[1226,1645,1647],{"href":1646},"\u002Freference\u002Fapi\u002Fjobs\u002Fcancel-job","cancel a job",[1226,1649,1651],{"href":1650},"\u002Freference\u002Fapi\u002Fjobs\u002Fresume-job","resume a job",[1192,1653,1654,1658,1659,1662],{},[1226,1655,1657],{"href":1656},"\u002Freference\u002Fapi\u002Forg\u002Fget-org","Get the organisation"," (its ",[1037,1660,1661],{},"quotas",")",[1192,1664,1665,1320,1669],{},[1226,1666,1668],{"href":1667},"\u002Freference\u002Fcodes#job-statuses","Job statuses",[1226,1670,1672],{"href":1671},"\u002Freference\u002Fcodes#attention-reasons","attention reasons",[1192,1674,1675,1676,1643,1678,1320,1681,1684,1685],{},"The ",[1037,1677,1047],{},[1037,1679,1680],{},"job.queued",[1037,1682,1683],{},"job.started"," ",[1226,1686,839],{"href":1687},"\u002Freference\u002Fevents",[1192,1689,1690,1320,1693],{},[1226,1691,59],{"href":1692},"\u002Fconcepts\u002Flimits",[1226,1694,56],{"href":1250},[1696,1697,1698],"style",{},"html pre.shiki code .sTzsn, html code.shiki .sTzsn{--shiki-light:var(--kaab-code-foreground);--shiki-default:var(--kaab-code-foreground);--shiki-dark:var(--kaab-code-foreground)}html pre.shiki code .sqn18, html code.shiki .sqn18{--shiki-light:var(--kaab-code-token-keyword);--shiki-default:var(--kaab-code-token-keyword);--shiki-dark:var(--kaab-code-token-keyword)}html pre.shiki code .sQm2-, html code.shiki .sQm2-{--shiki-light:var(--kaab-code-token-punctuation);--shiki-default:var(--kaab-code-token-punctuation);--shiki-dark:var(--kaab-code-token-punctuation)}html pre.shiki code .suOy4, html code.shiki .suOy4{--shiki-light:var(--kaab-code-token-string-expression);--shiki-default:var(--kaab-code-token-string-expression);--shiki-dark:var(--kaab-code-token-string-expression)}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":1373,"searchDepth":1405,"depth":1405,"links":1700},[1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711],{"id":1031,"depth":1387,"text":1032},{"id":1051,"depth":1387,"text":1052},{"id":1175,"depth":1387,"text":1176},{"id":1217,"depth":1387,"text":1218},{"id":1232,"depth":1387,"text":1233},{"id":1253,"depth":1387,"text":1254},{"id":1295,"depth":1387,"text":1296},{"id":1313,"depth":1387,"text":1314},{"id":1335,"depth":1387,"text":1336},{"id":1583,"depth":1387,"text":1584},{"id":1634,"depth":1387,"text":155},false,null,"Why your job starts when it does: priorities, plan weights, concurrency, credits, session locks, and what happens to a job when its worker dies.","md",{},true,"\u002Fconcepts\u002Fqueueing",{"title":71,"description":1714},"2.concepts\u002F15.queueing","N-f8OcOyI9eP4jITQiXOD5p15YPPYk9kCY5KMxqwHV0",[1723,1727],{"title":68,"path":1724,"stem":1725,"description":1726,"children":-1},"\u002Fconcepts\u002Fegress-and-proxies","2.concepts\u002F14.egress-and-proxies","How a job's traffic reaches a site: proxy pools, countries, your own proxy, pacing per site, what is refused before it leaves, and what is recorded.",{"title":74,"path":1728,"stem":1729,"description":1730,"children":-1},"\u002Fconcepts\u002Faccounts-and-roles","2.concepts\u002F16.accounts-and-roles","Signing in to the panel, organisations and invitations, the five roles and what each may do, API key scopes, and two-factor authentication.",1793593413559]