[{"data":1,"prerenderedAt":2439},["ShallowReactive",2],{"docs:\u002Fen\u002Fguide\u002Fflow":3},{"page":4,"untranslated":2438,"translated":78},{"id":5,"title":6,"body":7,"description":2429,"extension":2430,"meta":2431,"navigation":78,"path":2432,"publishedAt":2433,"seo":2434,"stem":2435,"updatedAt":2436,"__hash__":2437},"docs_en\u002Fen\u002Fguide\u002Fflow.md","Flow",{"type":8,"value":9,"toc":2411},"minimark",[10,14,22,27,41,402,421,453,457,494,533,536,571,574,616,631,635,642,795,823,841,844,853,1045,1063,1088,1101,1105,1117,1121,1130,1187,1394,1432,1450,1523,1527,1552,1639,1647,1651,1678,1712,1721,1725,1749,1753,1756,1833,1848,1869,1881,1885,1908,1912,1921,1927,1931,1940,2076,2113,2116,2128,2139,2158,2162,2174,2321,2337,2377,2407],[11,12,6],"h1",{"id":13},"flow",[15,16,17,18,21],"p",{},"A Flow defines multiple dependent jobs as a directed acyclic graph (DAG).",[19,20],"br",{},"\nA Run is a single execution of a Flow.",[23,24,26],"h2",{"id":25},"定義","Definition",[15,28,29,33,34,37,38,40],{},[30,31,32],"code",{},"createFlow"," takes ",[30,35,36],{},"performers"," and returns a function that defines a Flow.",[19,39],{},"\nBinding names and payload types are type-checked in the same way as for standalone jobs.",[42,43,48],"pre",{"className":44,"code":45,"language":46,"meta":47,"style":47},"language-ts shiki shiki-themes github-light github-dark","import { createFlow, defineTsumugi } from 'tsumugi';\n\nconst performers = { ListNames, Greet, Report };\nconst flow = createFlow(performers);\n\nconst flows = {\n  GREETINGS: flow\u003C{ prefix: string }>((f) => {\n    const list = f.node('list', 'ListNames', {\n      input: (i) => ({ prefix: i.prefix }),\n    });\n\n    const each = f.fanOut('greet', 'Greet', {\n      after: { list },\n      over: (_i, d) => d.list.names,\n      input: (name) => ({ name }),\n    });\n\n    f.node('report', 'Report', {\n      after: { each },\n      input: (_i, d) => ({ total: d.each.total, failed: d.each.failed }),\n    });\n  }),\n};\n\nconst tsumugi = defineTsumugi({ performers, flows, auth: \u002F* ... *\u002F });\n","ts","",[30,49,50,73,80,96,113,118,131,166,198,217,223,228,255,261,284,301,306,311,331,337,357,362,368,374,379],{"__ignoreMap":47},[51,52,55,59,63,66,70],"span",{"class":53,"line":54},"line",1,[51,56,58],{"class":57},"szBVR","import",[51,60,62],{"class":61},"sVt8B"," { createFlow, defineTsumugi } ",[51,64,65],{"class":57},"from",[51,67,69],{"class":68},"sZZnC"," 'tsumugi'",[51,71,72],{"class":61},";\n",[51,74,76],{"class":53,"line":75},2,[51,77,79],{"emptyLinePlaceholder":78},true,"\n",[51,81,83,86,90,93],{"class":53,"line":82},3,[51,84,85],{"class":57},"const",[51,87,89],{"class":88},"sj4cs"," performers",[51,91,92],{"class":57}," =",[51,94,95],{"class":61}," { ListNames, Greet, Report };\n",[51,97,99,101,104,106,110],{"class":53,"line":98},4,[51,100,85],{"class":57},[51,102,103],{"class":88}," flow",[51,105,92],{"class":57},[51,107,109],{"class":108},"sScJk"," createFlow",[51,111,112],{"class":61},"(performers);\n",[51,114,116],{"class":53,"line":115},5,[51,117,79],{"emptyLinePlaceholder":78},[51,119,121,123,126,128],{"class":53,"line":120},6,[51,122,85],{"class":57},[51,124,125],{"class":88}," flows",[51,127,92],{"class":57},[51,129,130],{"class":61}," {\n",[51,132,134,137,139,142,146,149,152,155,158,161,164],{"class":53,"line":133},7,[51,135,136],{"class":61},"  GREETINGS: ",[51,138,13],{"class":108},[51,140,141],{"class":61},"\u003C{ ",[51,143,145],{"class":144},"s4XuR","prefix",[51,147,148],{"class":57},":",[51,150,151],{"class":88}," string",[51,153,154],{"class":61}," }>((",[51,156,157],{"class":144},"f",[51,159,160],{"class":61},") ",[51,162,163],{"class":57},"=>",[51,165,130],{"class":61},[51,167,169,172,175,177,180,183,186,189,192,195],{"class":53,"line":168},8,[51,170,171],{"class":57},"    const",[51,173,174],{"class":88}," list",[51,176,92],{"class":57},[51,178,179],{"class":61}," f.",[51,181,182],{"class":108},"node",[51,184,185],{"class":61},"(",[51,187,188],{"class":68},"'list'",[51,190,191],{"class":61},", ",[51,193,194],{"class":68},"'ListNames'",[51,196,197],{"class":61},", {\n",[51,199,201,204,207,210,212,214],{"class":53,"line":200},9,[51,202,203],{"class":108},"      input",[51,205,206],{"class":61},": (",[51,208,209],{"class":144},"i",[51,211,160],{"class":61},[51,213,163],{"class":57},[51,215,216],{"class":61}," ({ prefix: i.prefix }),\n",[51,218,220],{"class":53,"line":219},10,[51,221,222],{"class":61},"    });\n",[51,224,226],{"class":53,"line":225},11,[51,227,79],{"emptyLinePlaceholder":78},[51,229,231,233,236,238,240,243,245,248,250,253],{"class":53,"line":230},12,[51,232,171],{"class":57},[51,234,235],{"class":88}," each",[51,237,92],{"class":57},[51,239,179],{"class":61},[51,241,242],{"class":108},"fanOut",[51,244,185],{"class":61},[51,246,247],{"class":68},"'greet'",[51,249,191],{"class":61},[51,251,252],{"class":68},"'Greet'",[51,254,197],{"class":61},[51,256,258],{"class":53,"line":257},13,[51,259,260],{"class":61},"      after: { list },\n",[51,262,264,267,269,272,274,277,279,281],{"class":53,"line":263},14,[51,265,266],{"class":108},"      over",[51,268,206],{"class":61},[51,270,271],{"class":144},"_i",[51,273,191],{"class":61},[51,275,276],{"class":144},"d",[51,278,160],{"class":61},[51,280,163],{"class":57},[51,282,283],{"class":61}," d.list.names,\n",[51,285,287,289,291,294,296,298],{"class":53,"line":286},15,[51,288,203],{"class":108},[51,290,206],{"class":61},[51,292,293],{"class":144},"name",[51,295,160],{"class":61},[51,297,163],{"class":57},[51,299,300],{"class":61}," ({ name }),\n",[51,302,304],{"class":53,"line":303},16,[51,305,222],{"class":61},[51,307,309],{"class":53,"line":308},17,[51,310,79],{"emptyLinePlaceholder":78},[51,312,314,317,319,321,324,326,329],{"class":53,"line":313},18,[51,315,316],{"class":61},"    f.",[51,318,182],{"class":108},[51,320,185],{"class":61},[51,322,323],{"class":68},"'report'",[51,325,191],{"class":61},[51,327,328],{"class":68},"'Report'",[51,330,197],{"class":61},[51,332,334],{"class":53,"line":333},19,[51,335,336],{"class":61},"      after: { each },\n",[51,338,340,342,344,346,348,350,352,354],{"class":53,"line":339},20,[51,341,203],{"class":108},[51,343,206],{"class":61},[51,345,271],{"class":144},[51,347,191],{"class":61},[51,349,276],{"class":144},[51,351,160],{"class":61},[51,353,163],{"class":57},[51,355,356],{"class":61}," ({ total: d.each.total, failed: d.each.failed }),\n",[51,358,360],{"class":53,"line":359},21,[51,361,222],{"class":61},[51,363,365],{"class":53,"line":364},22,[51,366,367],{"class":61},"  }),\n",[51,369,371],{"class":53,"line":370},23,[51,372,373],{"class":61},"};\n",[51,375,377],{"class":53,"line":376},24,[51,378,79],{"emptyLinePlaceholder":78},[51,380,382,384,387,389,392,395,399],{"class":53,"line":381},25,[51,383,85],{"class":57},[51,385,386],{"class":88}," tsumugi",[51,388,92],{"class":57},[51,390,391],{"class":108}," defineTsumugi",[51,393,394],{"class":61},"({ performers, flows, auth: ",[51,396,398],{"class":397},"sJ8bj","\u002F* ... *\u002F",[51,400,401],{"class":61}," });\n",[15,403,404,405,408,409,411,412,417,418,420],{},"The first argument of ",[30,406,407],{},"f.node"," is the node ID, and the second is the binding name.",[19,410],{},"\nThe binding name must match the ",[413,414,416],"a",{"href":415},"\u002Fen\u002Fguide\u002Fperformer#binding%E5%90%8D","exported name",".",[19,419],{},"\nA node ID consists of alphanumeric characters, hyphens, and underscores.",[15,422,423,426,427,429,430,417,433,435,436,191,439,191,442,191,445,448,449,452],{},[30,424,425],{},"input"," is a function that generates the payload from the Flow input and the return values of upstream nodes.",[19,428],{},"\nIts second argument is an object whose property names are the keys of the object passed to ",[30,431,432],{},"after",[19,434],{},"\nIn a node definition, you can optionally specify the same options as when enqueuing a job (such as ",[30,437,438],{},"maxAttempts",[30,440,441],{},"backoff",[30,443,444],{},"timeoutMs",[30,446,447],{},"priority",", and ",[30,450,451],{},"concurrencyKey",").",[23,454,456],{"id":455},"開始","Starting a Run",[42,458,460],{"className":44,"code":459,"language":46,"meta":47,"style":47},"const runId = await tsumugi.start(env, 'GREETINGS', { prefix: 'hello' });\n",[30,461,462],{"__ignoreMap":47},[51,463,464,466,469,471,474,477,480,483,486,489,492],{"class":53,"line":54},[51,465,85],{"class":57},[51,467,468],{"class":88}," runId",[51,470,92],{"class":57},[51,472,473],{"class":57}," await",[51,475,476],{"class":61}," tsumugi.",[51,478,479],{"class":108},"start",[51,481,482],{"class":61},"(env, ",[51,484,485],{"class":68},"'GREETINGS'",[51,487,488],{"class":61},", { prefix: ",[51,490,491],{"class":68},"'hello'",[51,493,401],{"class":61},[15,495,496,497,499,500,502,503,506,507,509,510,417,513,515,516,518,519,521,522,524,527,528,532],{},"The type of ",[30,498,425],{}," is derived from the type argument of the Flow.",[19,501],{},"\nIf you pass ",[30,504,505],{},"{ id }"," as the fourth argument of ",[30,508,479],{},", the runId is fixed to ",[30,511,512],{},"\u003Cflow>:\u003Cid>",[19,514],{},"\nIf you start a Flow a second time with the same ID, no new Run is created and the existing runId is returned.",[19,517],{},"\nCalling ",[30,520,479],{}," from an HTTP handler that is retried therefore does not create duplicate Runs.",[19,523],{},[30,525,526],{},"{ deadlineMs }"," in the fourth argument sets the ",[413,529,531],{"href":530},"#%E6%9C%9F%E9%99%90","deadline"," for the entire Run.",[23,534,535],{"id":535},"fan-out",[15,537,538,539,542,543,545,546,417,549,551,552,555,556,417,559,502,561,564,565,567,568,570],{},"Use ",[30,540,541],{},"f.fanOut"," to define parallel processing based on the number of elements in an array.",[19,544],{},"\nOne child node is created for each element of the value returned by ",[30,547,548],{},"over",[19,550],{},"\nThe ID of a child node is the element's index. For example, ",[30,553,554],{},"greet:0"," and ",[30,557,558],{},"greet:1",[19,560],{},[30,562,563],{},"key",", the value returned by ",[30,566,563],{}," is used instead of the index.",[19,569],{},"\nThe allowed characters are the same as for node IDs.",[15,572,573],{},"Downstream nodes receive an aggregate in the following format.",[42,575,577],{"className":44,"code":576,"language":46,"meta":47,"style":47},"{ total: 3, succeeded: 2, failed: 1 }\n",[30,578,579],{"__ignoreMap":47},[51,580,581,584,587,590,593,595,598,600,603,605,608,610,613],{"class":53,"line":54},[51,582,583],{"class":61},"{ ",[51,585,586],{"class":108},"total",[51,588,589],{"class":61},": ",[51,591,592],{"class":88},"3",[51,594,191],{"class":61},[51,596,597],{"class":108},"succeeded",[51,599,589],{"class":61},[51,601,602],{"class":88},"2",[51,604,191],{"class":61},[51,606,607],{"class":108},"failed",[51,609,589],{"class":61},[51,611,612],{"class":88},"1",[51,614,615],{"class":61}," }\n",[15,617,618,619,621,622,624,625,627,628,630],{},"The return value of each child node is not passed to downstream nodes.",[19,620],{},"\nIf you need individual results, have the performer write them to R2, D1, or a similar store, and return a reference to them.",[19,623],{},"\nIf a child node fails, the fan-out node itself does not fail.",[19,626],{},"\nTo detect failures, check the ",[30,629,607],{}," value that downstream nodes receive.",[23,632,634],{"id":633},"perform内からのノード追加","Adding nodes from within perform",[15,636,637,638,641],{},"Calling ",[30,639,640],{},"ctx.spawn"," adds a child node to the running node.",[42,643,645],{"className":44,"code":644,"language":46,"meta":47,"style":47},"class Crawl extends Performer\u003C{ url: string }, void, {}, Env> {\n  async perform(payload: { url: string }, ctx: JobContext): Promise\u003Cvoid> {\n    for (const found of await this.discover(payload.url)) {\n      ctx.spawn(found.id, 'CRAWL', { url: found.url });\n    }\n  }\n}\n",[30,646,647,685,734,763,780,785,790],{"__ignoreMap":47},[51,648,649,652,655,658,661,663,666,668,670,673,676,679,682],{"class":53,"line":54},[51,650,651],{"class":57},"class",[51,653,654],{"class":108}," Crawl",[51,656,657],{"class":57}," extends",[51,659,660],{"class":108}," Performer",[51,662,141],{"class":61},[51,664,665],{"class":144},"url",[51,667,148],{"class":57},[51,669,151],{"class":88},[51,671,672],{"class":61}," }, ",[51,674,675],{"class":88},"void",[51,677,678],{"class":61},", {}, ",[51,680,681],{"class":108},"Env",[51,683,684],{"class":61},"> {\n",[51,686,687,690,693,695,698,700,703,705,707,709,711,714,716,719,722,724,727,730,732],{"class":53,"line":75},[51,688,689],{"class":57},"  async",[51,691,692],{"class":108}," perform",[51,694,185],{"class":61},[51,696,697],{"class":144},"payload",[51,699,148],{"class":57},[51,701,702],{"class":61}," { ",[51,704,665],{"class":144},[51,706,148],{"class":57},[51,708,151],{"class":88},[51,710,672],{"class":61},[51,712,713],{"class":144},"ctx",[51,715,148],{"class":57},[51,717,718],{"class":108}," JobContext",[51,720,721],{"class":61},")",[51,723,148],{"class":57},[51,725,726],{"class":108}," Promise",[51,728,729],{"class":61},"\u003C",[51,731,675],{"class":88},[51,733,684],{"class":61},[51,735,736,739,742,744,747,750,752,755,757,760],{"class":53,"line":82},[51,737,738],{"class":57},"    for",[51,740,741],{"class":61}," (",[51,743,85],{"class":57},[51,745,746],{"class":88}," found",[51,748,749],{"class":57}," of",[51,751,473],{"class":57},[51,753,754],{"class":88}," this",[51,756,417],{"class":61},[51,758,759],{"class":108},"discover",[51,761,762],{"class":61},"(payload.url)) {\n",[51,764,765,768,771,774,777],{"class":53,"line":98},[51,766,767],{"class":61},"      ctx.",[51,769,770],{"class":108},"spawn",[51,772,773],{"class":61},"(found.id, ",[51,775,776],{"class":68},"'CRAWL'",[51,778,779],{"class":61},", { url: found.url });\n",[51,781,782],{"class":53,"line":115},[51,783,784],{"class":61},"    }\n",[51,786,787],{"class":53,"line":120},[51,788,789],{"class":61},"  }\n",[51,791,792],{"class":53,"line":133},[51,793,794],{"class":61},"}\n",[15,796,797,798,800,801,804,805,518,807,809,810,812,813,816,817,819,820,822],{},"The ID in the first argument is required.",[19,799],{},"\nThe ID of a child node is composed as ",[30,802,803],{},"\u003Cparent node ID>:\u003Cspecified ID>",", and the allowed characters are the same as for node IDs.",[19,806],{},[30,808,770],{}," multiple times with the same ID does not create duplicate child nodes.",[19,811],{},"\nChild nodes added during an attempt in which ",[30,814,815],{},"perform"," failed are not created.",[19,818],{},"\nAdd them again in the ",[30,821,815],{}," of the retry.",[15,824,825,826,417,828,830,831,833,834,417],{},"Type checking does not apply to ",[30,827,770],{},[19,829],{},"\nThe binding name and payload are passed as runtime values.",[19,832],{},"\nWhen calling it from a performer in a different Worker, ",[413,835,837,840],{"href":836},"\u002Fen\u002Fguide\u002Fperformer#%E5%88%A5worker%E3%81%AB%E9%85%8D%E7%BD%AE%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88%E3%81%AE%E5%88%B6%E7%B4%84",[30,838,839],{},"await"," is required",[23,842,843],{"id":843},"subflow",[15,845,846,849,850,852],{},[30,847,848],{},"f.subflow"," starts another Flow as a Run.",[19,851],{},"\nThe node completes when that Run finishes.",[42,854,856],{"className":44,"code":855,"language":46,"meta":47,"style":47},"const REPORTING = flow\u003C{ ids: string[] }>((f) => {\n  \u002F\u002F ...\n});\n\nconst PIPELINE = flow\u003C{ prefix: string }>((f) => {\n  const list = f.node('list', 'LIST', { input: (i) => ({ prefix: i.prefix }) });\n  const reported = f.subflow('report', REPORTING, { input: (_i, d) => ({ ids: d.list.ids }) });\n  f.node('notify', 'NOTIFY', { after: { reported }, input: () => ({}) });\n});\n",[30,857,858,889,894,899,903,932,970,1011,1041],{"__ignoreMap":47},[51,859,860,862,865,867,869,871,874,876,878,881,883,885,887],{"class":53,"line":54},[51,861,85],{"class":57},[51,863,864],{"class":88}," REPORTING",[51,866,92],{"class":57},[51,868,103],{"class":108},[51,870,141],{"class":61},[51,872,873],{"class":144},"ids",[51,875,148],{"class":57},[51,877,151],{"class":88},[51,879,880],{"class":61},"[] }>((",[51,882,157],{"class":144},[51,884,160],{"class":61},[51,886,163],{"class":57},[51,888,130],{"class":61},[51,890,891],{"class":53,"line":75},[51,892,893],{"class":397},"  \u002F\u002F ...\n",[51,895,896],{"class":53,"line":82},[51,897,898],{"class":61},"});\n",[51,900,901],{"class":53,"line":98},[51,902,79],{"emptyLinePlaceholder":78},[51,904,905,907,910,912,914,916,918,920,922,924,926,928,930],{"class":53,"line":115},[51,906,85],{"class":57},[51,908,909],{"class":88}," PIPELINE",[51,911,92],{"class":57},[51,913,103],{"class":108},[51,915,141],{"class":61},[51,917,145],{"class":144},[51,919,148],{"class":57},[51,921,151],{"class":88},[51,923,154],{"class":61},[51,925,157],{"class":144},[51,927,160],{"class":61},[51,929,163],{"class":57},[51,931,130],{"class":61},[51,933,934,937,939,941,943,945,947,949,951,954,957,959,961,963,965,967],{"class":53,"line":120},[51,935,936],{"class":57},"  const",[51,938,174],{"class":88},[51,940,92],{"class":57},[51,942,179],{"class":61},[51,944,182],{"class":108},[51,946,185],{"class":61},[51,948,188],{"class":68},[51,950,191],{"class":61},[51,952,953],{"class":68},"'LIST'",[51,955,956],{"class":61},", { ",[51,958,425],{"class":108},[51,960,206],{"class":61},[51,962,209],{"class":144},[51,964,160],{"class":61},[51,966,163],{"class":57},[51,968,969],{"class":61}," ({ prefix: i.prefix }) });\n",[51,971,972,974,977,979,981,983,985,987,989,992,994,996,998,1000,1002,1004,1006,1008],{"class":53,"line":133},[51,973,936],{"class":57},[51,975,976],{"class":88}," reported",[51,978,92],{"class":57},[51,980,179],{"class":61},[51,982,843],{"class":108},[51,984,185],{"class":61},[51,986,323],{"class":68},[51,988,191],{"class":61},[51,990,991],{"class":88},"REPORTING",[51,993,956],{"class":61},[51,995,425],{"class":108},[51,997,206],{"class":61},[51,999,271],{"class":144},[51,1001,191],{"class":61},[51,1003,276],{"class":144},[51,1005,160],{"class":61},[51,1007,163],{"class":57},[51,1009,1010],{"class":61}," ({ ids: d.list.ids }) });\n",[51,1012,1013,1016,1018,1020,1023,1025,1028,1031,1033,1036,1038],{"class":53,"line":168},[51,1014,1015],{"class":61},"  f.",[51,1017,182],{"class":108},[51,1019,185],{"class":61},[51,1021,1022],{"class":68},"'notify'",[51,1024,191],{"class":61},[51,1026,1027],{"class":68},"'NOTIFY'",[51,1029,1030],{"class":61},", { after: { reported }, ",[51,1032,425],{"class":108},[51,1034,1035],{"class":61},": () ",[51,1037,163],{"class":57},[51,1039,1040],{"class":61}," ({}) });\n",[51,1042,1043],{"class":53,"line":200},[51,1044,898],{"class":61},[15,1046,1047,1048,1050,1051,1053,1054,1056,1057,417,1060,1062],{},"Pass the Flow definition itself as the second argument.",[19,1049],{},"\nThe type of ",[30,1052,425],{}," is derived from the type argument of the Flow you pass.",[19,1055],{},"\nRegister the Flow to be started in ",[30,1058,1059],{},"flows",[19,1061],{},"\nIf it is not registered, an error occurs at start time.",[15,1064,1065,1066,417,1069,1071,1072,1074,1075,191,1078,1081,1082,417,1085,1087],{},"The runId of the child Run is ",[30,1067,1068],{},"\u003Cchild Flow name>:\u003Clocal part of the parent runId>-\u003Cnode ID>",[19,1070],{},"\nThe state of the child Run is reflected as-is as the state of the node.",[19,1073],{},"\nThe state is one of ",[30,1076,1077],{},"COMPLETED",[30,1079,1080],{},"FAILED",", or ",[30,1083,1084],{},"CANCELLED",[19,1086],{},"\nCancelling the parent Run also cancels the child Run.",[15,1089,1090,1091,1093,1094,1096,1097,417],{},"The parent node does not receive a return value from the child Run.",[19,1092],{},"\nIf you need the result, have the performer write it to R2, D1, or a similar store.",[19,1095],{},"\nFor the nesting limit, see ",[413,1098,1100],{"href":1099},"#%E5%88%B6%E7%B4%84","Limits",[23,1102,1104],{"id":1103},"待ち合わせ","Synchronization",[15,1106,1107,1108,1110,1111,1113,1114,1116],{},"A node completes when the node itself and all of its descendant nodes have finished.",[19,1109],{},"\nDownstream nodes that depend on a node specified in ",[30,1112,432],{}," run after the fan-out child nodes and the descendant nodes added by ",[30,1115,770],{}," have finished.",[23,1118,1120],{"id":1119},"実行条件","Execution conditions",[15,1122,1123,1124,1126,1129],{},"By default, a node runs only when all the nodes it depends on have succeeded.",[19,1125],{},[30,1127,1128],{},"trigger"," specifies the behavior when a node it depends on fails.",[1131,1132,1133,1146],"table",{},[1134,1135,1136],"thead",{},[1137,1138,1139,1143],"tr",{},[1140,1141,1142],"th",{},"Value",[1140,1144,1145],{},"Condition under which the node runs",[1147,1148,1149,1160,1177],"tbody",{},[1137,1150,1151,1157],{},[1152,1153,1154],"td",{},[30,1155,1156],{},"'success'",[1152,1158,1159],{},"All dependencies succeeded. Default",[1137,1161,1162,1167],{},[1152,1163,1164],{},[30,1165,1166],{},"'failure'",[1152,1168,1169,1170,191,1172,1081,1175],{},"At least one dependency is ",[30,1171,1080],{},[30,1173,1174],{},"STALLED",[30,1176,1084],{},[1137,1178,1179,1184],{},[1152,1180,1181],{},[30,1182,1183],{},"'always'",[1152,1185,1186],{},"All dependencies have finished, regardless of success or failure",[42,1188,1190],{"className":44,"code":1189,"language":46,"meta":47,"style":47},"const flows = {\n  BACKUP: flow\u003C{ target: string }>((f) => {\n    const dump = f.node('dump', 'DUMP', { input: (i) => ({ target: i.target }) });\n\n    \u002F\u002F Runs only on failure\n    f.node('alert', 'ALERT', {\n      after: { dump },\n      trigger: 'failure',\n      input: (i) => ({ message: `backup failed: ${i.target}` }),\n    });\n\n    \u002F\u002F Runs regardless of success or failure\n    f.node('unlock', 'UNLOCK', { after: { dump }, trigger: 'always', input: (i) => ({ target: i.target }) });\n  }),\n};\n",[30,1191,1192,1202,1228,1266,1270,1275,1293,1298,1308,1338,1342,1346,1351,1386,1390],{"__ignoreMap":47},[51,1193,1194,1196,1198,1200],{"class":53,"line":54},[51,1195,85],{"class":57},[51,1197,125],{"class":88},[51,1199,92],{"class":57},[51,1201,130],{"class":61},[51,1203,1204,1207,1209,1211,1214,1216,1218,1220,1222,1224,1226],{"class":53,"line":75},[51,1205,1206],{"class":61},"  BACKUP: ",[51,1208,13],{"class":108},[51,1210,141],{"class":61},[51,1212,1213],{"class":144},"target",[51,1215,148],{"class":57},[51,1217,151],{"class":88},[51,1219,154],{"class":61},[51,1221,157],{"class":144},[51,1223,160],{"class":61},[51,1225,163],{"class":57},[51,1227,130],{"class":61},[51,1229,1230,1232,1235,1237,1239,1241,1243,1246,1248,1251,1253,1255,1257,1259,1261,1263],{"class":53,"line":82},[51,1231,171],{"class":57},[51,1233,1234],{"class":88}," dump",[51,1236,92],{"class":57},[51,1238,179],{"class":61},[51,1240,182],{"class":108},[51,1242,185],{"class":61},[51,1244,1245],{"class":68},"'dump'",[51,1247,191],{"class":61},[51,1249,1250],{"class":68},"'DUMP'",[51,1252,956],{"class":61},[51,1254,425],{"class":108},[51,1256,206],{"class":61},[51,1258,209],{"class":144},[51,1260,160],{"class":61},[51,1262,163],{"class":57},[51,1264,1265],{"class":61}," ({ target: i.target }) });\n",[51,1267,1268],{"class":53,"line":98},[51,1269,79],{"emptyLinePlaceholder":78},[51,1271,1272],{"class":53,"line":115},[51,1273,1274],{"class":397},"    \u002F\u002F Runs only on failure\n",[51,1276,1277,1279,1281,1283,1286,1288,1291],{"class":53,"line":120},[51,1278,316],{"class":61},[51,1280,182],{"class":108},[51,1282,185],{"class":61},[51,1284,1285],{"class":68},"'alert'",[51,1287,191],{"class":61},[51,1289,1290],{"class":68},"'ALERT'",[51,1292,197],{"class":61},[51,1294,1295],{"class":53,"line":133},[51,1296,1297],{"class":61},"      after: { dump },\n",[51,1299,1300,1303,1305],{"class":53,"line":168},[51,1301,1302],{"class":61},"      trigger: ",[51,1304,1166],{"class":68},[51,1306,1307],{"class":61},",\n",[51,1309,1310,1312,1314,1316,1318,1320,1323,1326,1328,1330,1332,1335],{"class":53,"line":200},[51,1311,203],{"class":108},[51,1313,206],{"class":61},[51,1315,209],{"class":144},[51,1317,160],{"class":61},[51,1319,163],{"class":57},[51,1321,1322],{"class":61}," ({ message: ",[51,1324,1325],{"class":68},"`backup failed: ${",[51,1327,209],{"class":61},[51,1329,417],{"class":68},[51,1331,1213],{"class":61},[51,1333,1334],{"class":68},"}`",[51,1336,1337],{"class":61}," }),\n",[51,1339,1340],{"class":53,"line":219},[51,1341,222],{"class":61},[51,1343,1344],{"class":53,"line":225},[51,1345,79],{"emptyLinePlaceholder":78},[51,1347,1348],{"class":53,"line":230},[51,1349,1350],{"class":397},"    \u002F\u002F Runs regardless of success or failure\n",[51,1352,1353,1355,1357,1359,1362,1364,1367,1370,1372,1374,1376,1378,1380,1382,1384],{"class":53,"line":257},[51,1354,316],{"class":61},[51,1356,182],{"class":108},[51,1358,185],{"class":61},[51,1360,1361],{"class":68},"'unlock'",[51,1363,191],{"class":61},[51,1365,1366],{"class":68},"'UNLOCK'",[51,1368,1369],{"class":61},", { after: { dump }, trigger: ",[51,1371,1183],{"class":68},[51,1373,191],{"class":61},[51,1375,425],{"class":108},[51,1377,206],{"class":61},[51,1379,209],{"class":144},[51,1381,160],{"class":61},[51,1383,163],{"class":57},[51,1385,1265],{"class":61},[51,1387,1388],{"class":53,"line":263},[51,1389,367],{"class":61},[51,1391,1392],{"class":53,"line":286},[51,1393,373],{"class":61},[15,1395,1396,1397,1399,1400,1402,1403,1405,1406,1408,1409,1411,1412,1415,1416,1418,1419,1422,1423,1425,1426,1428,1429,1431],{},"Specifying ",[30,1398,1128],{}," on a node without ",[30,1401,432],{}," causes an error.",[19,1404],{},"\nOnly nodes that actually failed count toward the ",[30,1407,1166],{}," condition.",[19,1410],{},"\nA node that became ",[30,1413,1414],{},"SKIPPED"," because its ",[30,1417,1128],{}," or ",[30,1420,1421],{},"when"," condition was not met does not count as a failure.",[19,1424],{},"\nIf all the nodes it depends on are ",[30,1427,1414],{},", a ",[30,1430,1166],{}," node does not run.",[15,1433,1434,1435,555,1437,1439,1440,1442,1443,1445,1446,1449],{},"With ",[30,1436,1166],{},[30,1438,1183],{},", a failed node has no return value.",[19,1441],{},"\nThe type of the second argument of ",[30,1444,425],{}," includes ",[30,1447,1448],{},"undefined",", so write code that handles the case where there is no value.",[42,1451,1453],{"className":44,"code":1452,"language":46,"meta":47,"style":47},"f.node('alert', 'ALERT', {\n  after: { dump },\n  trigger: 'always',\n  \u002F\u002F d.dump may be undefined\n  input: (_i, d) => ({ size: d.dump?.size ?? 0 }),\n});\n",[30,1454,1455,1472,1477,1486,1491,1519],{"__ignoreMap":47},[51,1456,1457,1460,1462,1464,1466,1468,1470],{"class":53,"line":54},[51,1458,1459],{"class":61},"f.",[51,1461,182],{"class":108},[51,1463,185],{"class":61},[51,1465,1285],{"class":68},[51,1467,191],{"class":61},[51,1469,1290],{"class":68},[51,1471,197],{"class":61},[51,1473,1474],{"class":53,"line":75},[51,1475,1476],{"class":61},"  after: { dump },\n",[51,1478,1479,1482,1484],{"class":53,"line":82},[51,1480,1481],{"class":61},"  trigger: ",[51,1483,1183],{"class":68},[51,1485,1307],{"class":61},[51,1487,1488],{"class":53,"line":98},[51,1489,1490],{"class":397},"  \u002F\u002F d.dump may be undefined\n",[51,1492,1493,1496,1498,1500,1502,1504,1506,1508,1511,1514,1517],{"class":53,"line":115},[51,1494,1495],{"class":108},"  input",[51,1497,206],{"class":61},[51,1499,271],{"class":144},[51,1501,191],{"class":61},[51,1503,276],{"class":144},[51,1505,160],{"class":61},[51,1507,163],{"class":57},[51,1509,1510],{"class":61}," ({ size: d.dump?.size ",[51,1512,1513],{"class":57},"??",[51,1515,1516],{"class":88}," 0",[51,1518,1337],{"class":61},[51,1520,1521],{"class":53,"line":120},[51,1522,898],{"class":61},[23,1524,1526],{"id":1525},"条件分岐","Conditional branching",[15,1528,1529,1531,1532,1534,1535,1537,1538,1541,1542,1544,1545,1547,1548,1541,1550,417],{},[30,1530,1421],{}," determines whether a node runs, based on the Flow input and the results of upstream nodes.",[19,1533],{},"\nIf ",[30,1536,1421],{}," returns ",[30,1539,1540],{},"false",", the node transitions to ",[30,1543,1414],{},", and downstream nodes that depend on it do not run either.",[19,1546],{},"\nIf an exception occurs inside ",[30,1549,1421],{},[30,1551,1080],{},[42,1553,1555],{"className":44,"code":1554,"language":46,"meta":47,"style":47},"f.node('detail', 'DETAIL', {\n  after: { list },\n  when: (i, d) => i.verbose && d.list.items.length > 0,\n  input: (_i, d) => ({ items: d.list.items }),\n});\n",[30,1556,1557,1575,1580,1616,1635],{"__ignoreMap":47},[51,1558,1559,1561,1563,1565,1568,1570,1573],{"class":53,"line":54},[51,1560,1459],{"class":61},[51,1562,182],{"class":108},[51,1564,185],{"class":61},[51,1566,1567],{"class":68},"'detail'",[51,1569,191],{"class":61},[51,1571,1572],{"class":68},"'DETAIL'",[51,1574,197],{"class":61},[51,1576,1577],{"class":53,"line":75},[51,1578,1579],{"class":61},"  after: { list },\n",[51,1581,1582,1585,1587,1589,1591,1593,1595,1597,1600,1603,1606,1609,1612,1614],{"class":53,"line":82},[51,1583,1584],{"class":108},"  when",[51,1586,206],{"class":61},[51,1588,209],{"class":144},[51,1590,191],{"class":61},[51,1592,276],{"class":144},[51,1594,160],{"class":61},[51,1596,163],{"class":57},[51,1598,1599],{"class":61}," i.verbose ",[51,1601,1602],{"class":57},"&&",[51,1604,1605],{"class":61}," d.list.items.",[51,1607,1608],{"class":88},"length",[51,1610,1611],{"class":57}," >",[51,1613,1516],{"class":88},[51,1615,1307],{"class":61},[51,1617,1618,1620,1622,1624,1626,1628,1630,1632],{"class":53,"line":98},[51,1619,1495],{"class":108},[51,1621,206],{"class":61},[51,1623,271],{"class":144},[51,1625,191],{"class":61},[51,1627,276],{"class":144},[51,1629,160],{"class":61},[51,1631,163],{"class":57},[51,1633,1634],{"class":61}," ({ items: d.list.items }),\n",[51,1636,1637],{"class":53,"line":115},[51,1638,898],{"class":61},[15,1640,1641,1642,555,1644,1646],{},"When evaluating ",[30,1643,1421],{},[30,1645,425],{},", use only the values of the arguments and do not make any external calls.",[23,1648,1650],{"id":1649},"失敗時の動作","Behavior on failure",[15,1652,1653,1654,1656,1657,417,1659,1661,1662,1664,1665,1418,1667,1669,1670,1672,1673,1675,1676,417],{},"When a node fails, downstream nodes that depend on it with ",[30,1655,1156],{}," transition to ",[30,1658,1414],{},[19,1660],{},"\nDownstream nodes whose ",[30,1663,1128],{}," is ",[30,1666,1166],{},[30,1668,1183],{}," run.",[19,1671],{},"\nNodes that do not depend on the failed node run to the end.",[19,1674],{},"\nWhen all nodes have finished, the Run transitions to ",[30,1677,1080],{},[15,1679,1680,1681,1683,1684,1686,1687,1418,1689,1691,1692,1694,1695,1698,1699,1701,1702,1704,1705,1707,1708,1711],{},"A Run becomes ",[30,1682,1080],{}," only when there is a failed node.",[19,1685],{},"\nNodes that did not run because of a ",[30,1688,1128],{},[30,1690,1421],{}," condition do not count as failures.",[19,1693],{},"\nEven if a ",[30,1696,1697],{},"trigger: 'failure'"," node succeeds, the Run ends as ",[30,1700,1080],{}," if an upstream node failed.",[19,1703],{},"\nThe reason a node became ",[30,1706,1414],{}," is recorded in the node's ",[30,1709,1710],{},"error"," and shown in the Run details on the dashboard.",[15,1713,1714,1715,1717,1718,1720],{},"Resume a ",[30,1716,1080],{}," Run from the dashboard or the REST API.",[19,1719],{},"\nThe results of nodes that succeeded are reused as they are, and all other nodes are treated as not yet run and are executed again.",[23,1722,1724],{"id":1723},"取り消し","Cancellation",[15,1726,1727,1728,1730,1731,1735,1736,1738,1739,1741,1742,1744,1745,1748],{},"When you cancel a Run, nodes that have not yet run are not started.",[19,1729],{},"\nA ",[413,1732,1734],{"href":1733},"\u002Fen\u002Fguide\u002Fexecution#%E5%AE%9F%E8%A1%8C%E4%B8%AD%E3%81%AE%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%97","cancellation request"," is sent to running nodes.",[19,1737],{},"\nRunning jobs are not stopped.",[19,1740],{},"\nThe Run transitions to ",[30,1743,1084],{}," when the performer checks the request and finishes, or when no result has been reported after ",[30,1746,1747],{},"reaperGraceMs"," (default 30 seconds) has passed since the request.",[23,1750,1752],{"id":1751},"期限","Deadline",[15,1754,1755],{},"Specify the deadline for the entire Run in the second argument of the Flow definition.",[42,1757,1759],{"className":44,"code":1758,"language":46,"meta":47,"style":47},"const GREETINGS = flow\u003C{ prefix: string }>(\n  (f) => {\n    \u002F\u002F ...\n  },\n  { deadlineMs: 10 * 60 * 1000 },\n);\n",[30,1760,1761,1783,1796,1801,1806,1828],{"__ignoreMap":47},[51,1762,1763,1765,1768,1770,1772,1774,1776,1778,1780],{"class":53,"line":54},[51,1764,85],{"class":57},[51,1766,1767],{"class":88}," GREETINGS",[51,1769,92],{"class":57},[51,1771,103],{"class":108},[51,1773,141],{"class":61},[51,1775,145],{"class":144},[51,1777,148],{"class":57},[51,1779,151],{"class":88},[51,1781,1782],{"class":61}," }>(\n",[51,1784,1785,1788,1790,1792,1794],{"class":53,"line":75},[51,1786,1787],{"class":61},"  (",[51,1789,157],{"class":144},[51,1791,160],{"class":61},[51,1793,163],{"class":57},[51,1795,130],{"class":61},[51,1797,1798],{"class":53,"line":82},[51,1799,1800],{"class":397},"    \u002F\u002F ...\n",[51,1802,1803],{"class":53,"line":98},[51,1804,1805],{"class":61},"  },\n",[51,1807,1808,1811,1814,1817,1820,1822,1825],{"class":53,"line":115},[51,1809,1810],{"class":61},"  { deadlineMs: ",[51,1812,1813],{"class":88},"10",[51,1815,1816],{"class":57}," *",[51,1818,1819],{"class":88}," 60",[51,1821,1816],{"class":57},[51,1823,1824],{"class":88}," 1000",[51,1826,1827],{"class":61}," },\n",[51,1829,1830],{"class":53,"line":120},[51,1831,1832],{"class":61},");\n",[15,1834,1835,1836,1839,1840,502,1842,1844,1845,1847],{},"Specify ",[30,1837,1838],{},"deadlineMs"," as a positive integer (milliseconds).",[19,1841],{},[30,1843,526],{}," in the fourth argument of ",[30,1846,479],{},", that value takes precedence.",[15,1849,1850,1851,1853,1854,1856,1857,417,1860,1862,1863,1865,1866,1868],{},"A Run that passes its deadline is aborted by the same procedure as cancellation.",[19,1852],{},"\nNodes that have not yet run transition to ",[30,1855,1080],{}," with the error ",[30,1858,1859],{},"run deadline exceeded",[19,1861],{},"\nRunning jobs are not stopped, and the Run transitions to ",[30,1864,1080],{}," when those jobs finish.",[19,1867],{},"\nRunning child Runs are cancelled.",[15,1870,1871,1872,1874,1875,1877,1878,1880],{},"A Run that does not finish by its deadline transitions to ",[30,1873,1080],{}," even if all remaining nodes succeed.",[19,1876],{},"\nSuch a Run can be resumed, just like a Run that failed in the usual way.",[19,1879],{},"\nWhen you resume it, the deadline is measured anew from the time of resumption.",[23,1882,1884],{"id":1883},"保持期間","Retention period",[15,1886,1887,1888,1891,1892,1730,1894,1896,1897,1900,1901,1903,1904,417],{},"A finished Run is deleted after ",[30,1889,1890],{},"runs.sweepAfterMs"," (default 5 minutes) has elapsed.",[19,1893],{},[30,1895,1080],{}," Run is deleted after ",[30,1898,1899],{},"runs.failedRetentionMs"," (default 7 days) has elapsed.",[19,1902],{},"\nFor details, see ",[413,1905,1907],{"href":1906},"\u002Fen\u002Freference\u002Fconfig#runsettings","RunSettings",[23,1909,1911],{"id":1910},"デプロイと実行中のrun","Deployment and running Runs",[15,1913,1914,1915,1917,1918,1920],{},"A running Run continues with the node configuration it had when it started.",[19,1916],{},"\nIf you change functions such as ",[30,1919,425],{},", the change takes effect starting with the next node that starts.",[15,1922,1923,1924,1926],{},"If you remove a node from the definition, any running Run that contains that node fails at that node.",[19,1925],{},"\nWhen removing a node, deploy after all running Runs have finished.",[23,1928,1930],{"id":1929},"テスト","Testing",[15,1932,1933,1936,1937,1939],{},[30,1934,1935],{},"simulateFlow"," verifies the execution order of nodes and the payload passed to each node for a given input.",[19,1938],{},"\nThe actual processing of the performers is not executed.",[42,1941,1943],{"className":44,"code":1942,"language":46,"meta":47,"style":47},"import { simulateFlow } from 'tsumugi\u002Ftesting';\n\nconst result = simulateFlow(flows.GREETINGS, { prefix: 'hello' }, { results: { list: { names: ['a', 'b'] } } });\n\nexpect(result.nodes.map((node) => node.id)).toEqual(['list', 'greet:0', 'greet:1', 'greet', 'report']);\nexpect(result.nodes[1].payload).toEqual({ name: 'a' });\n",[30,1944,1945,1959,1963,1999,2003,2055],{"__ignoreMap":47},[51,1946,1947,1949,1952,1954,1957],{"class":53,"line":54},[51,1948,58],{"class":57},[51,1950,1951],{"class":61}," { simulateFlow } ",[51,1953,65],{"class":57},[51,1955,1956],{"class":68}," 'tsumugi\u002Ftesting'",[51,1958,72],{"class":61},[51,1960,1961],{"class":53,"line":75},[51,1962,79],{"emptyLinePlaceholder":78},[51,1964,1965,1967,1970,1972,1975,1978,1981,1983,1985,1988,1991,1993,1996],{"class":53,"line":82},[51,1966,85],{"class":57},[51,1968,1969],{"class":88}," result",[51,1971,92],{"class":57},[51,1973,1974],{"class":108}," simulateFlow",[51,1976,1977],{"class":61},"(flows.",[51,1979,1980],{"class":88},"GREETINGS",[51,1982,488],{"class":61},[51,1984,491],{"class":68},[51,1986,1987],{"class":61}," }, { results: { list: { names: [",[51,1989,1990],{"class":68},"'a'",[51,1992,191],{"class":61},[51,1994,1995],{"class":68},"'b'",[51,1997,1998],{"class":61},"] } } });\n",[51,2000,2001],{"class":53,"line":98},[51,2002,79],{"emptyLinePlaceholder":78},[51,2004,2005,2008,2011,2014,2017,2019,2021,2023,2026,2029,2032,2034,2036,2039,2041,2044,2046,2048,2050,2052],{"class":53,"line":115},[51,2006,2007],{"class":108},"expect",[51,2009,2010],{"class":61},"(result.nodes.",[51,2012,2013],{"class":108},"map",[51,2015,2016],{"class":61},"((",[51,2018,182],{"class":144},[51,2020,160],{"class":61},[51,2022,163],{"class":57},[51,2024,2025],{"class":61}," node.id)).",[51,2027,2028],{"class":108},"toEqual",[51,2030,2031],{"class":61},"([",[51,2033,188],{"class":68},[51,2035,191],{"class":61},[51,2037,2038],{"class":68},"'greet:0'",[51,2040,191],{"class":61},[51,2042,2043],{"class":68},"'greet:1'",[51,2045,191],{"class":61},[51,2047,247],{"class":68},[51,2049,191],{"class":61},[51,2051,323],{"class":68},[51,2053,2054],{"class":61},"]);\n",[51,2056,2057,2059,2062,2064,2067,2069,2072,2074],{"class":53,"line":120},[51,2058,2007],{"class":108},[51,2060,2061],{"class":61},"(result.nodes[",[51,2063,612],{"class":88},[51,2065,2066],{"class":61},"].payload).",[51,2068,2028],{"class":108},[51,2070,2071],{"class":61},"({ name: ",[51,2073,1990],{"class":68},[51,2075,401],{"class":61},[15,2077,2078,2079,2082,2083,2085,2086,2088,2089,417,2091,2093,2094,2097,2098,417,2100,1741,2102,417,2104,2106,2107,2109,2110,2112],{},"Pass the return value of each node in ",[30,2080,2081],{},"results",", keyed by node ID.",[19,2084],{},"\nA value can be either the return value itself or a function that produces it.",[19,2087],{},"\nThe return value of a node you do not pass is ",[30,2090,1448],{},[19,2092],{},"\nA node you pass in ",[30,2095,2096],{},"fails"," fails, and downstream nodes transition to ",[30,2099,1414],{},[19,2101],{},[30,2103,1080],{},[19,2105],{},"\nFan-out child nodes are created from the value returned by ",[30,2108,548],{},", but child nodes added by ",[30,2111,640],{}," are not included.",[23,2114,1100],{"id":2115},"制約",[15,2117,2118,2121,2122,2124,2125,2127],{},[30,2119,2120],{},"uniqueKey"," cannot be used with nodes.",[19,2123],{},"\nSpecifying a performer that requires ",[30,2126,2120],{}," as a node causes a type error.",[15,2129,2130,2131,2133,2134,417,2136,2138],{},"If the return value of a node exceeds 8,192 characters or cannot be serialized, the attempt is treated as a failure.",[19,2132],{},"\nAfter a failure, retries are made up to ",[30,2135,438],{},[19,2137],{},"\nWrite large results to R2 or a similar store, and return a reference to them.",[15,2140,2141,2142,2144,2145,2147,2148,555,2151,2154,2155,417],{},"The number of nodes a single Run can contain is 10,000 by default.",[19,2143],{},"\nThe nesting depth of subflows is 3 levels by default.",[19,2146],{},"\nChange these limits with ",[30,2149,2150],{},"runs.maxNodes",[30,2152,2153],{},"runs.maxDepth"," in ",[30,2156,2157],{},"defineTsumugi",[23,2159,2161],{"id":2160},"設定","Configuration",[15,2163,2164,2165,2167,2168,2170,2171,2173],{},"If you specify ",[30,2166,1059],{},", add the following two entries to your wrangler configuration.",[19,2169],{},"\nIf you do not specify ",[30,2172,1059],{},", these settings are not needed.",[42,2175,2179],{"className":2176,"code":2177,"language":2178,"meta":47,"style":47},"language-jsonc shiki shiki-themes github-light github-dark","{\n  \"durable_objects\": {\n    \"bindings\": [\n      { \"name\": \"JOB_SHARD\", \"class_name\": \"TsumugiJobShard\" },\n      { \"name\": \"RUN\", \"class_name\": \"TsumugiRun\" },\n    ],\n  },\n  \"migrations\": [\n    { \"tag\": \"v1\", \"new_sqlite_classes\": [\"TsumugiJobShard\"] },\n    { \"tag\": \"v2\", \"new_sqlite_classes\": [\"TsumugiRun\"] },\n  ],\n}\n","jsonc",[30,2180,2181,2186,2194,2202,2227,2249,2254,2258,2265,2291,2312,2317],{"__ignoreMap":47},[51,2182,2183],{"class":53,"line":54},[51,2184,2185],{"class":61},"{\n",[51,2187,2188,2191],{"class":53,"line":75},[51,2189,2190],{"class":88},"  \"durable_objects\"",[51,2192,2193],{"class":61},": {\n",[51,2195,2196,2199],{"class":53,"line":82},[51,2197,2198],{"class":88},"    \"bindings\"",[51,2200,2201],{"class":61},": [\n",[51,2203,2204,2207,2210,2212,2215,2217,2220,2222,2225],{"class":53,"line":98},[51,2205,2206],{"class":61},"      { ",[51,2208,2209],{"class":88},"\"name\"",[51,2211,589],{"class":61},[51,2213,2214],{"class":68},"\"JOB_SHARD\"",[51,2216,191],{"class":61},[51,2218,2219],{"class":88},"\"class_name\"",[51,2221,589],{"class":61},[51,2223,2224],{"class":68},"\"TsumugiJobShard\"",[51,2226,1827],{"class":61},[51,2228,2229,2231,2233,2235,2238,2240,2242,2244,2247],{"class":53,"line":115},[51,2230,2206],{"class":61},[51,2232,2209],{"class":88},[51,2234,589],{"class":61},[51,2236,2237],{"class":68},"\"RUN\"",[51,2239,191],{"class":61},[51,2241,2219],{"class":88},[51,2243,589],{"class":61},[51,2245,2246],{"class":68},"\"TsumugiRun\"",[51,2248,1827],{"class":61},[51,2250,2251],{"class":53,"line":120},[51,2252,2253],{"class":61},"    ],\n",[51,2255,2256],{"class":53,"line":133},[51,2257,1805],{"class":61},[51,2259,2260,2263],{"class":53,"line":168},[51,2261,2262],{"class":88},"  \"migrations\"",[51,2264,2201],{"class":61},[51,2266,2267,2270,2273,2275,2278,2280,2283,2286,2288],{"class":53,"line":200},[51,2268,2269],{"class":61},"    { ",[51,2271,2272],{"class":88},"\"tag\"",[51,2274,589],{"class":61},[51,2276,2277],{"class":68},"\"v1\"",[51,2279,191],{"class":61},[51,2281,2282],{"class":88},"\"new_sqlite_classes\"",[51,2284,2285],{"class":61},": [",[51,2287,2224],{"class":68},[51,2289,2290],{"class":61},"] },\n",[51,2292,2293,2295,2297,2299,2302,2304,2306,2308,2310],{"class":53,"line":219},[51,2294,2269],{"class":61},[51,2296,2272],{"class":88},[51,2298,589],{"class":61},[51,2300,2301],{"class":68},"\"v2\"",[51,2303,191],{"class":61},[51,2305,2282],{"class":88},[51,2307,2285],{"class":61},[51,2309,2246],{"class":68},[51,2311,2290],{"class":61},[51,2313,2314],{"class":53,"line":225},[51,2315,2316],{"class":61},"  ],\n",[51,2318,2319],{"class":53,"line":230},[51,2320,794],{"class":61},[15,2322,2323,2324,2327,2328,2331,2332,417,2334,2336],{},"Export ",[30,2325,2326],{},"TsumugiRun"," by extending the ",[30,2329,2330],{},"runClass"," included in the return value of ",[30,2333,2157],{},[19,2335],{},"\nThe D1 migrations must be applied again.",[42,2338,2340],{"className":44,"code":2339,"language":46,"meta":47,"style":47},"export { TsumugiJobShard } from 'tsumugi';\nexport class TsumugiRun extends tsumugi.runClass {}\n",[30,2341,2342,2356],{"__ignoreMap":47},[51,2343,2344,2347,2350,2352,2354],{"class":53,"line":54},[51,2345,2346],{"class":57},"export",[51,2348,2349],{"class":61}," { TsumugiJobShard } ",[51,2351,65],{"class":57},[51,2353,69],{"class":68},[51,2355,72],{"class":61},[51,2357,2358,2360,2363,2366,2368,2370,2372,2374],{"class":53,"line":75},[51,2359,2346],{"class":57},[51,2361,2362],{"class":57}," class",[51,2364,2365],{"class":108}," TsumugiRun",[51,2367,657],{"class":57},[51,2369,386],{"class":108},[51,2371,417],{"class":61},[51,2373,2330],{"class":108},[51,2375,2376],{"class":61}," {}\n",[42,2378,2382],{"className":2379,"code":2380,"language":2381,"meta":47,"style":47},"language-bash shiki shiki-themes github-light github-dark","pnpm wrangler d1 migrations apply my-jobs --remote\n","bash",[30,2383,2384],{"__ignoreMap":47},[51,2385,2386,2389,2392,2395,2398,2401,2404],{"class":53,"line":54},[51,2387,2388],{"class":108},"pnpm",[51,2390,2391],{"class":68}," wrangler",[51,2393,2394],{"class":68}," d1",[51,2396,2397],{"class":68}," migrations",[51,2399,2400],{"class":68}," apply",[51,2402,2403],{"class":68}," my-jobs",[51,2405,2406],{"class":88}," --remote\n",[2408,2409,2410],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}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":47,"searchDepth":82,"depth":82,"links":2412},[2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428],{"id":25,"depth":75,"text":26},{"id":455,"depth":75,"text":456},{"id":535,"depth":75,"text":535},{"id":633,"depth":75,"text":634},{"id":843,"depth":75,"text":843},{"id":1103,"depth":75,"text":1104},{"id":1119,"depth":75,"text":1120},{"id":1525,"depth":75,"text":1526},{"id":1649,"depth":75,"text":1650},{"id":1723,"depth":75,"text":1724},{"id":1751,"depth":75,"text":1752},{"id":1883,"depth":75,"text":1884},{"id":1910,"depth":75,"text":1911},{"id":1929,"depth":75,"text":1930},{"id":2115,"depth":75,"text":1100},{"id":2160,"depth":75,"text":2161},"Defining Flows, which describe multiple dependent jobs as a directed acyclic graph (DAG), plus fan-out, conditional branching, and failure behavior","md",{},"\u002Fen\u002Fguide\u002Fflow","2026-07-22",{"title":6,"description":2429},"en\u002Fguide\u002Fflow","2026-10-25","6z5HAo0uhJ7P5kHVm55eIKb8EGaA3o6t8NhlVSyBQ3k",false,1794027576317]