[{"data":1,"prerenderedAt":5361},["ShallowReactive",2],{"navigation_docs":3,"-docs-architecture-workflows":493,"-docs-architecture-workflows-surround":5356},[4,46,135,218,257,292,355,377,420],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":45},"Getting Started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"What is Heximon?","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F01.getting-started\u002F01.introduction","i-lucide-info",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F01.getting-started\u002F02.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F01.getting-started\u002F03.quick-start","i-lucide-zap",{"title":26,"path":27,"stem":28,"icon":29},"Core Concepts","\u002Fdocs\u002Fgetting-started\u002Fcore-concepts","docs\u002F01.getting-started\u002F04.core-concepts","i-lucide-shapes",{"title":31,"path":32,"stem":33,"icon":34},"Examples","\u002Fdocs\u002Fgetting-started\u002Fexamples","docs\u002F01.getting-started\u002F05.examples","i-lucide-library",{"title":36,"path":37,"stem":38,"icon":39},"Where Next?","\u002Fdocs\u002Fgetting-started\u002Fwhere-next","docs\u002F01.getting-started\u002F06.where-next","i-lucide-signpost",{"title":41,"path":42,"stem":43,"icon":44},"Troubleshooting","\u002Fdocs\u002Fgetting-started\u002Ftroubleshooting","docs\u002F01.getting-started\u002F07.troubleshooting","i-lucide-life-buoy",false,{"title":47,"icon":48,"path":49,"stem":50,"children":51,"page":45},"Essentials","i-lucide-boxes","\u002Fdocs\u002Fessentials","docs\u002F02.essentials",[52,56,61,66,71,76,81,86,91,96,101,105,110,115,120,125,130],{"title":53,"path":54,"stem":55,"icon":48},"Modules & DI","\u002Fdocs\u002Fessentials\u002Fmodules-and-di","docs\u002F02.essentials\u002F01.modules-and-di",{"title":57,"path":58,"stem":59,"icon":60},"Controllers","\u002Fdocs\u002Fessentials\u002Fcontrollers","docs\u002F02.essentials\u002F02.controllers","i-lucide-route",{"title":62,"path":63,"stem":64,"icon":65},"Validation & DTOs","\u002Fdocs\u002Fessentials\u002Fvalidation","docs\u002F02.essentials\u002F03.validation","i-lucide-shield-check",{"title":67,"path":68,"stem":69,"icon":70},"Contracts","\u002Fdocs\u002Fessentials\u002Fcontracts","docs\u002F02.essentials\u002F04.contracts","i-lucide-file-signature",{"title":72,"path":73,"stem":74,"icon":75},"REST Client","\u002Fdocs\u002Fessentials\u002Fclient","docs\u002F02.essentials\u002F05.client","i-lucide-plug",{"title":77,"path":78,"stem":79,"icon":80},"Database","\u002Fdocs\u002Fessentials\u002Fdatabase","docs\u002F02.essentials\u002F06.database","i-lucide-database",{"title":82,"path":83,"stem":84,"icon":85},"Drizzle ORM","\u002Fdocs\u002Fessentials\u002Fdrizzle","docs\u002F02.essentials\u002F07.drizzle","i-lucide-database-zap",{"title":87,"path":88,"stem":89,"icon":90},"Persistence & Transactions","\u002Fdocs\u002Fessentials\u002Fpersistence","docs\u002F02.essentials\u002F08.persistence","i-lucide-database-backup",{"title":92,"path":93,"stem":94,"icon":95},"Migrations","\u002Fdocs\u002Fessentials\u002Fmigrations","docs\u002F02.essentials\u002F09.migrations","i-lucide-git-branch",{"title":97,"path":98,"stem":99,"icon":100},"Authentication","\u002Fdocs\u002Fessentials\u002Fauthentication","docs\u002F02.essentials\u002F10.authentication","i-lucide-key-round",{"title":102,"path":103,"stem":104,"icon":65},"Permissions & scopes","\u002Fdocs\u002Fessentials\u002Fpermissions","docs\u002F02.essentials\u002F11.permissions",{"title":106,"path":107,"stem":108,"icon":109},"Error Handling","\u002Fdocs\u002Fessentials\u002Ferrors","docs\u002F02.essentials\u002F12.errors","i-lucide-triangle-alert",{"title":111,"path":112,"stem":113,"icon":114},"Testing a Heximon App","\u002Fdocs\u002Fessentials\u002Ftesting","docs\u002F02.essentials\u002F13.testing","i-lucide-flask-conical",{"title":116,"path":117,"stem":118,"icon":119},"Test app harness","\u002Fdocs\u002Fessentials\u002Fcreatetestapp","docs\u002F02.essentials\u002F14.createtestapp","i-lucide-test-tube",{"title":121,"path":122,"stem":123,"icon":124},"Logging & Observability","\u002Fdocs\u002Fessentials\u002Flogging","docs\u002F02.essentials\u002F17.logging","i-lucide-scroll-text",{"title":126,"path":127,"stem":128,"icon":129},"Context & Lifecycle","\u002Fdocs\u002Fessentials\u002Fcontext-and-lifecycle","docs\u002F02.essentials\u002F18.context-and-lifecycle","i-lucide-radio",{"title":131,"path":132,"stem":133,"icon":134},"Project Structure","\u002Fdocs\u002Fessentials\u002Fproject-structure","docs\u002F02.essentials\u002F19.project-structure","i-lucide-folder-tree",{"title":136,"icon":137,"path":138,"stem":139,"children":140,"page":45},"Capabilities","i-lucide-sparkles","\u002Fdocs\u002Fcapabilities","docs\u002F03.capabilities",[141,145,150,155,160,164,169,174,179,184,188,193,198,203,208,213],{"title":142,"path":143,"stem":144,"icon":137},"Overview","\u002Fdocs\u002Fcapabilities\u002Foverview","docs\u002F03.capabilities\u002F01.overview",{"title":146,"path":147,"stem":148,"icon":149},"Events","\u002Fdocs\u002Fcapabilities\u002Fevents","docs\u002F03.capabilities\u002F02.events","i-lucide-radio-tower",{"title":151,"path":152,"stem":153,"icon":154},"Queue","\u002Fdocs\u002Fcapabilities\u002Fbackground-jobs","docs\u002F03.capabilities\u002F03.background-jobs","i-lucide-list-ordered",{"title":156,"path":157,"stem":158,"icon":159},"Scheduled Work","\u002Fdocs\u002Fcapabilities\u002Fscheduled-jobs","docs\u002F03.capabilities\u002F04.scheduled-jobs","i-lucide-clock",{"title":161,"path":162,"stem":163,"icon":85},"Caching","\u002Fdocs\u002Fcapabilities\u002Fcaching","docs\u002F03.capabilities\u002F05.caching",{"title":165,"path":166,"stem":167,"icon":168},"Key\u002FValue Storage","\u002Fdocs\u002Fcapabilities\u002Fkey-value","docs\u002F03.capabilities\u002F06.key-value","i-lucide-hard-drive",{"title":170,"path":171,"stem":172,"icon":173},"Blob Storage","\u002Fdocs\u002Fcapabilities\u002Fblob","docs\u002F03.capabilities\u002F07.blob","i-lucide-folder-open",{"title":175,"path":176,"stem":177,"icon":178},"Health & Readiness","\u002Fdocs\u002Fcapabilities\u002Fhealth","docs\u002F03.capabilities\u002F08.health","i-lucide-heart-pulse",{"title":180,"path":181,"stem":182,"icon":183},"Notifications","\u002Fdocs\u002Fcapabilities\u002Fnotifications","docs\u002F03.capabilities\u002F09.notifications","i-lucide-mail",{"title":185,"path":186,"stem":187,"icon":65},"Idempotency","\u002Fdocs\u002Fcapabilities\u002Fidempotency","docs\u002F03.capabilities\u002F10.idempotency",{"title":189,"path":190,"stem":191,"icon":192},"Security Hardening","\u002Fdocs\u002Fcapabilities\u002Fsecurity","docs\u002F03.capabilities\u002F11.security","i-lucide-shield",{"title":194,"path":195,"stem":196,"icon":197},"Observability & Tracing","\u002Fdocs\u002Fcapabilities\u002Fobservability","docs\u002F03.capabilities\u002F12.observability","i-lucide-activity",{"title":199,"path":200,"stem":201,"icon":202},"OpenAPI","\u002Fdocs\u002Fcapabilities\u002Fopenapi","docs\u002F03.capabilities\u002F13.openapi","i-lucide-book-marked",{"title":204,"path":205,"stem":206,"icon":207},"MCP Server","\u002Fdocs\u002Fcapabilities\u002Fmcp","docs\u002F03.capabilities\u002F14.mcp","i-lucide-bot",{"title":209,"path":210,"stem":211,"icon":212},"Schema DTOs","\u002Fdocs\u002Fcapabilities\u002Fschema","docs\u002F03.capabilities\u002F15.schema","i-lucide-file-json",{"title":214,"path":215,"stem":216,"icon":217},"Branded IDs","\u002Fdocs\u002Fcapabilities\u002Fbranded-ids","docs\u002F03.capabilities\u002F16.branded-ids","i-lucide-tag",{"title":219,"icon":220,"path":221,"stem":222,"children":223,"page":45},"Architecture","i-lucide-building","\u002Fdocs\u002Farchitecture","docs\u002F04.architecture",[224,227,232,237,242,247,252],{"title":142,"path":225,"stem":226,"icon":220},"\u002Fdocs\u002Farchitecture\u002Foverview","docs\u002F04.architecture\u002F01.overview",{"title":228,"path":229,"stem":230,"icon":231},"Domain-Driven Design","\u002Fdocs\u002Farchitecture\u002Fddd","docs\u002F04.architecture\u002F02.ddd","i-lucide-hexagon",{"title":233,"path":234,"stem":235,"icon":236},"CQRS","\u002Fdocs\u002Farchitecture\u002Fcqrs","docs\u002F04.architecture\u002F03.cqrs","i-lucide-split",{"title":238,"path":239,"stem":240,"icon":241},"Repository Pattern","\u002Fdocs\u002Farchitecture\u002Frepository-pattern","docs\u002F04.architecture\u002F04.repository-pattern","i-lucide-archive",{"title":243,"path":244,"stem":245,"icon":246},"Integration Events","\u002Fdocs\u002Farchitecture\u002Fintegration-events","docs\u002F04.architecture\u002F05.integration-events","i-lucide-send-horizontal",{"title":248,"path":249,"stem":250,"icon":251},"Saga Orchestration","\u002Fdocs\u002Farchitecture\u002Fsagas","docs\u002F04.architecture\u002F06.sagas","i-lucide-hourglass",{"title":253,"path":254,"stem":255,"icon":256},"Durable Workflows","\u002Fdocs\u002Farchitecture\u002Fworkflows","docs\u002F04.architecture\u002F07.workflows","i-lucide-workflow",{"title":258,"icon":259,"path":260,"stem":261,"children":262,"page":45},"Realtime","i-lucide-cable","\u002Fdocs\u002Frealtime","docs\u002F05.realtime",[263,266,270,274,279,284,288],{"title":142,"path":264,"stem":265,"icon":259},"\u002Fdocs\u002Frealtime\u002Foverview","docs\u002F05.realtime\u002F01.overview",{"title":267,"path":268,"stem":269,"icon":129},"WebSockets","\u002Fdocs\u002Frealtime\u002Fwebsockets","docs\u002F05.realtime\u002F02.websockets",{"title":271,"path":272,"stem":273,"icon":70},"WebSocket Contracts","\u002Fdocs\u002Frealtime\u002Fwebsocket-contracts","docs\u002F05.realtime\u002F03.websocket-contracts",{"title":275,"path":276,"stem":277,"icon":278},"Server-Sent Events","\u002Fdocs\u002Frealtime\u002Fserver-sent-events","docs\u002F05.realtime\u002F04.server-sent-events","i-lucide-rss",{"title":280,"path":281,"stem":282,"icon":283},"Typed Clients","\u002Fdocs\u002Frealtime\u002Ftyped-clients","docs\u002F05.realtime\u002F05.typed-clients","i-lucide-plug-zap",{"title":285,"path":286,"stem":287,"icon":259},"AsyncAPI","\u002Fdocs\u002Frealtime\u002Fasyncapi","docs\u002F05.realtime\u002F06.asyncapi",{"title":289,"path":290,"stem":291,"icon":80},"Durable Objects","\u002Fdocs\u002Frealtime\u002Fdurable-objects","docs\u002F05.realtime\u002F07.durable-objects",{"title":293,"icon":294,"path":295,"stem":296,"children":297,"page":45},"Deploy","i-lucide-cloud-upload","\u002Fdocs\u002Fdeploy","docs\u002F06.deploy",[298,301,306,311,316,321,326,331,336,341,345,350],{"title":142,"path":299,"stem":300,"icon":6},"\u002Fdocs\u002Fdeploy\u002Foverview","docs\u002F06.deploy\u002F01.overview",{"title":302,"path":303,"stem":304,"icon":305},"Node","\u002Fdocs\u002Fdeploy\u002Fnode","docs\u002F06.deploy\u002F02.node","la:node-js",{"title":307,"path":308,"stem":309,"icon":310},"Cloudflare","\u002Fdocs\u002Fdeploy\u002Fcloudflare","docs\u002F06.deploy\u002F03.cloudflare","simple-icons:cloudflare",{"title":312,"path":313,"stem":314,"icon":315},"Vercel","\u002Fdocs\u002Fdeploy\u002Fvercel","docs\u002F06.deploy\u002F04.vercel","ri:vercel-fill",{"title":317,"path":318,"stem":319,"icon":320},"Netlify","\u002Fdocs\u002Fdeploy\u002Fnetlify","docs\u002F06.deploy\u002F05.netlify","i-simple-icons-netlify",{"title":322,"path":323,"stem":324,"icon":325},"AWS Lambda","\u002Fdocs\u002Fdeploy\u002Faws-lambda","docs\u002F06.deploy\u002F06.aws-lambda","hugeicons:aws-lambda",{"title":327,"path":328,"stem":329,"icon":330},"Deno Deploy","\u002Fdocs\u002Fdeploy\u002Fdeno-deploy","docs\u002F06.deploy\u002F07.deno-deploy","simple-icons:denodeploy",{"title":332,"path":333,"stem":334,"icon":335},"Nitro","\u002Fdocs\u002Fdeploy\u002Fnitro","docs\u002F06.deploy\u002F08.nitro","i-unjs-nitro",{"title":337,"path":338,"stem":339,"icon":340},"Nuxt","\u002Fdocs\u002Fdeploy\u002Fnuxt","docs\u002F06.deploy\u002F09.nuxt","i-devicon-nuxt",{"title":342,"path":343,"stem":344,"icon":236},"Mixed-runtime split","\u002Fdocs\u002Fdeploy\u002Fmixed-runtime-split","docs\u002F06.deploy\u002F10.mixed-runtime-split",{"title":346,"path":347,"stem":348,"icon":349},"Hosts","\u002Fdocs\u002Fdeploy\u002Fhosts","docs\u002F06.deploy\u002F11.hosts","i-lucide-map",{"title":351,"path":352,"stem":353,"icon":354},"Cross-service events","\u002Fdocs\u002Fdeploy\u002Fcross-service-events","docs\u002F06.deploy\u002F12.cross-service-events","i-lucide-network",{"title":356,"icon":357,"path":358,"stem":359,"children":360,"page":45},"CLI","i-lucide-terminal","\u002Fdocs\u002Fcli","docs\u002F07.cli",[361,365,369,373],{"title":362,"path":363,"stem":364,"icon":357},"The heximon CLI","\u002Fdocs\u002Fcli\u002Foverview","docs\u002F07.cli\u002F01.overview",{"title":366,"path":367,"stem":368,"icon":137},"Create a New App","\u002Fdocs\u002Fcli\u002Fcreate","docs\u002F07.cli\u002F02.create",{"title":370,"path":371,"stem":372,"icon":95},"Migrations from the CLI","\u002Fdocs\u002Fcli\u002Fmigrations","docs\u002F07.cli\u002F03.migrations",{"title":374,"path":375,"stem":376,"icon":6},"Deploying a Heximon app","\u002Fdocs\u002Fcli\u002Fdeploy","docs\u002F07.cli\u002F04.deploy",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":45},"Under the Hood","i-lucide-wrench","\u002Fdocs\u002Funder-the-hood","docs\u002F08.under-the-hood",[383,388,393,397,402,407,411,415],{"title":384,"path":385,"stem":386,"icon":387},"How the Compiler Works","\u002Fdocs\u002Funder-the-hood\u002Fhow-the-compiler-works","docs\u002F08.under-the-hood\u002F01.how-the-compiler-works","i-lucide-cog",{"title":389,"path":390,"stem":391,"icon":392},"Compiler","\u002Fdocs\u002Funder-the-hood\u002Fextending-the-compiler","docs\u002F08.under-the-hood\u002F02.extending-the-compiler","i-lucide-cpu",{"title":394,"path":395,"stem":396,"icon":357},"Compiler Diagnostics","\u002Fdocs\u002Funder-the-hood\u002Fcompiler-diagnostics","docs\u002F08.under-the-hood\u002F03.compiler-diagnostics",{"title":398,"path":399,"stem":400,"icon":401},"Library Mode","\u002Fdocs\u002Funder-the-hood\u002Flibrary-mode","docs\u002F08.under-the-hood\u002F04.library-mode","i-lucide-package",{"title":403,"path":404,"stem":405,"icon":406},"Other bundlers","\u002Fdocs\u002Funder-the-hood\u002Falternate-bundlers","docs\u002F08.under-the-hood\u002F05.alternate-bundlers","i-lucide-blocks",{"title":408,"path":409,"stem":410,"icon":401},"Packages","\u002Fdocs\u002Funder-the-hood\u002Fpackages","docs\u002F08.under-the-hood\u002F06.packages",{"title":412,"path":413,"stem":414,"icon":207},"AI Skills","\u002Fdocs\u002Funder-the-hood\u002Fai-and-agents","docs\u002F08.under-the-hood\u002F07.ai-and-agents",{"title":416,"path":417,"stem":418,"icon":419},"Advanced DI","\u002Fdocs\u002Funder-the-hood\u002Fadvanced-di","docs\u002F08.under-the-hood\u002F08.advanced-di","i-lucide-git-fork",{"title":421,"icon":422,"path":423,"stem":424,"children":425,"page":45},"Recipes","i-lucide-book-open-check","\u002Fdocs\u002Frecipes","docs\u002F09.recipes",[426,431,436,440,444,448,452,456,460,465,469,474,479,484,488],{"title":427,"path":428,"stem":429,"icon":430},"Send an Email","\u002Fdocs\u002Frecipes\u002Fsend-an-email","docs\u002F09.recipes\u002F01.send-an-email","i-lucide-send",{"title":432,"path":433,"stem":434,"icon":435},"Upload a File","\u002Fdocs\u002Frecipes\u002Fupload-a-file","docs\u002F09.recipes\u002F02.upload-a-file","i-lucide-upload",{"title":437,"path":438,"stem":439,"icon":24},"Cache an Expensive Call","\u002Fdocs\u002Frecipes\u002Fcache-an-expensive-call","docs\u002F09.recipes\u002F03.cache-an-expensive-call",{"title":441,"path":442,"stem":443,"icon":154},"Paginate a List","\u002Fdocs\u002Frecipes\u002Fpaginate-a-list","docs\u002F09.recipes\u002F04.paginate-a-list",{"title":445,"path":446,"stem":447,"icon":65},"Protect Admin Routes","\u002Fdocs\u002Frecipes\u002Fprotect-admin-routes","docs\u002F09.recipes\u002F05.protect-admin-routes",{"title":449,"path":450,"stem":451,"icon":178},"Health Probes and a Nightly Job","\u002Fdocs\u002Frecipes\u002Fhealth-probes-and-a-nightly-job","docs\u002F09.recipes\u002F06.health-probes-and-a-nightly-job",{"title":453,"path":454,"stem":455,"icon":80},"Build a CRUD API","\u002Fdocs\u002Frecipes\u002Fcrud-api","docs\u002F09.recipes\u002F07.crud-api",{"title":457,"path":458,"stem":459,"icon":100},"Add Authentication","\u002Fdocs\u002Frecipes\u002Fadd-authentication","docs\u002F09.recipes\u002F08.add-authentication",{"title":461,"path":462,"stem":463,"icon":464},"Background Jobs","\u002Fdocs\u002Frecipes\u002Fbackground-jobs","docs\u002F09.recipes\u002F09.background-jobs","i-lucide-timer",{"title":466,"path":467,"stem":468,"icon":149},"Decouple Features with Events","\u002Fdocs\u002Frecipes\u002Fevent-driven-module","docs\u002F09.recipes\u002F10.event-driven-module",{"title":470,"path":471,"stem":472,"icon":473},"Build a DDD Aggregate","\u002Fdocs\u002Frecipes\u002Fddd-aggregate","docs\u002F09.recipes\u002F11.ddd-aggregate","i-lucide-box",{"title":475,"path":476,"stem":477,"icon":478},"Publish a Feature Package","\u002Fdocs\u002Frecipes\u002Ffeature-package","docs\u002F09.recipes\u002F12.feature-package","i-lucide-package-open",{"title":480,"path":481,"stem":482,"icon":483},"Reliable Integration Events","\u002Fdocs\u002Frecipes\u002Freliable-integration-events","docs\u002F09.recipes\u002F13.reliable-integration-events","i-lucide-inbox",{"title":485,"path":486,"stem":487,"icon":95},"Reactive Choreography","\u002Fdocs\u002Frecipes\u002Freactive-choreography","docs\u002F09.recipes\u002F14.reactive-choreography",{"title":489,"path":490,"stem":491,"icon":492},"Build a Production CRUD API","\u002Fdocs\u002Frecipes\u002Fproduction-crud-api","docs\u002F09.recipes\u002F15.production-crud-api","i-lucide-layers",{"id":494,"title":253,"body":495,"description":5349,"extension":5350,"links":5351,"meta":5352,"navigation":5353,"path":254,"seo":5354,"stem":255,"__hash__":5355},"docs\u002Fdocs\u002F04.architecture\u002F07.workflows.md",{"type":496,"value":497,"toc":5330},"minimark",[498,507,530,542,547,554,653,657,676,687,1389,1419,1423,1434,1509,1513,1527,1862,1881,2006,2010,2037,2760,2764,2767,2773,3151,3156,3297,3313,3342,3345,3349,3375,3381,4790,4803,4821,4825,4848,4853,4871,4875,4888,4895,4901,4938,4941,5085,5092,5108,5222,5226,5234,5237,5276,5289,5293,5326],[499,500,501,502,506],"p",{},"Some multi-step flows can't be expressed as a choreography of events and can't block a request for minutes or\ndays waiting on external work. A durable workflow solves this: write the steps as a straight-line procedure —\n",[503,504,505],"code",{},"charge → sleep 2 days → ship"," — and the framework persists each step's result and resumes the run after a\nsleep, automatically, even across process restarts.",[499,508,509,510,513,514,517,518,521,522,525,526,529],{},"Heximon's ",[503,511,512],{},"@heximon\u002Fworkflow"," package provides that as the ",[503,515,516],{},"Workflow\u003CPayload, Config>"," concept. The run body\nis a plain ",[503,519,520],{},"async run(event, step)"," method that calls ",[503,523,524],{},"step.do(...)"," for durable checkpoints and\n",[503,527,528],{},"step.sleep(...)"," for durable pauses.",[499,531,532,533,537,538,541],{},"The implementation is ",[534,535,536],"strong",{},"target-split at build time",": on Cloudflare the native Workflows engine owns\nmemoization, sleep, and hibernation; on Node the in-process ",[503,539,540],{},"NodeWorkflowEngine"," replay engine emulates the\nsame guarantees without a platform.",[543,544,546],"h2",{"id":545},"the-mental-model","The mental model",[499,548,549,550,553],{},"A workflow is a linear procedure that ",[534,551,552],{},"calls out and waits",". Three properties make it durable:",[555,556,557,572,590,607],"ul",{},[558,559,560,563,564,567,568,571],"li",{},[534,561,562],{},"Memoization."," Each ",[503,565,566],{},"step.do(\"name\", callback)"," records the callback's result to a ",[503,569,570],{},"workflow_steps"," table\nthe moment it succeeds. On a replay the step returns the persisted result without re-running the callback, so\nwork that already happened never repeats.",[558,573,574,577,578,581,582,585,586,589],{},[534,575,576],{},"Durable sleep."," ",[503,579,580],{},"step.sleep(\"name\", new TimeSpan(2, \"d\"))"," arms a one-shot wakeup on a ",[503,583,584],{},"durable_timers"," row and\nsuspends the run. The firing wakeup re-enters ",[503,587,588],{},"run()"," from the top; the replay walks every prior step (each\nreturning its memoized result instantly) until it reaches the sleep point and continues past it.",[558,591,592,595,596,599,600,603,604,606],{},[534,593,594],{},"Determinism contract."," The run body's deterministic step sequence is what makes the replay correct. Calls\nto ",[503,597,598],{},"Date.now()"," or ",[503,601,602],{},"Math.random()"," between steps differ across replays and silently corrupt the run — move\nthem inside a ",[503,605,524],{}," callback, whose memoized result is stable.",[558,608,609,612,613,615,616,623,624,627,628,627,631,627,634,637,638,641,642,645,646,627,648,627,650,652],{},[534,610,611],{},"Serialization contract."," A ",[503,614,524],{}," result, the trigger payload, and the run output are persisted\nwith ",[617,618,622],"a",{"href":619,"rel":620},"https:\u002F\u002Fgithub.com\u002FRich-Harris\u002Fdevalue",[621],"nofollow","devalue",", so a ",[503,625,626],{},"Date"," \u002F ",[503,629,630],{},"Map",[503,632,633],{},"Set",[503,635,636],{},"BigInt"," round-trips\nintact on resume — identically on Node and Cloudflare. A value devalue can't serialize (a ",[534,639,640],{},"class instance",",\na function, a symbol) throws at the step boundary instead of degrading silently, so return ",[534,643,644],{},"plain data","\n(plain objects, arrays, primitives, ",[503,647,626],{},[503,649,630],{},[503,651,633],{},") from a step and as the output — not a domain\nentity.",[543,654,656],{"id":655},"declare-a-workflow","Declare a workflow",[499,658,659,660,663,664,667,668,671,672,675],{},"A workflow is ",[503,661,662],{},"class X implements Workflow\u003CPayload, Config>",". The ",[534,665,666],{},"payload type"," is what ",[503,669,670],{},"event.payload","\ncarries into the run; the ",[534,673,674],{},"config literal"," names the Cloudflare Workflows binding on an edge build.",[499,677,678,679,682,683,686],{},"List it under ",[503,680,681],{},"workflow: { workflows }"," in the owning module. Its constructor receives dependencies like any\nother provider — no decorators, injected by class identity. (",[503,684,685],{},"extends Workflow\u003C...>"," binds identically — use\nit when you want your own base-class hierarchy on top of a workflow.)",[688,689,695],"pre",{"className":690,"code":691,"filename":692,"language":693,"meta":694,"style":694},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { TimeSpan } from \"@heximon\u002Fprimitives\";\nimport type { Workflow, WorkflowEvent, WorkflowStep } from \"@heximon\u002Fworkflow\";\nimport { FulfillmentLog } from \".\u002Ffulfillment-log\";\n\ninterface FulfillmentPayload {\n  readonly orderId: string;\n}\n\nexport class OrderFulfillmentWorkflow implements Workflow\u003C\n  FulfillmentPayload,\n  { binding: \"ORDER_FULFILLMENT\" }\n> {\n  public constructor(private readonly log: FulfillmentLog) {}\n\n  public async run(\n    event: WorkflowEvent\u003CFulfillmentPayload>,\n    step: WorkflowStep,\n  ): Promise\u003C{ orderId: string; reservation: string }> {\n    const orderId = event.payload.orderId;\n\n    const reservation = await step.do(\"reserve\", async () => {\n      this.log.record(`reserve:${orderId}`);\n\n      return `reservation:${orderId}`;\n    });\n\n    await step.sleep(\"settle\", new TimeSpan(50, \"ms\"));\n\n    await step.do(\"charge\", async () => {\n      this.log.record(`charge:${orderId}`);\n    });\n\n    await step.do(\"ship\", async () => {\n      this.log.record(`ship:${orderId}`);\n    });\n\n    return { orderId, reservation };\n  }\n}\n","workflow\u002Forder-fulfillment.workflow.ts","ts","",[503,696,697,733,769,792,799,813,831,837,842,862,871,892,900,932,937,951,970,982,1015,1042,1047,1089,1123,1128,1148,1158,1163,1212,1217,1247,1275,1284,1289,1319,1347,1356,1361,1378,1384],{"__ignoreMap":694},[698,699,702,706,710,714,717,720,723,727,730],"span",{"class":700,"line":701},"line",1,[698,703,705],{"class":704},"s7zQu","import",[698,707,709],{"class":708},"sMK4o"," {",[698,711,713],{"class":712},"sTEyZ"," TimeSpan",[698,715,716],{"class":708}," }",[698,718,719],{"class":704}," from",[698,721,722],{"class":708}," \"",[698,724,726],{"class":725},"sfazB","@heximon\u002Fprimitives",[698,728,729],{"class":708},"\"",[698,731,732],{"class":708},";\n",[698,734,736,738,741,743,746,749,752,754,757,759,761,763,765,767],{"class":700,"line":735},2,[698,737,705],{"class":704},[698,739,740],{"class":704}," type",[698,742,709],{"class":708},[698,744,745],{"class":712}," Workflow",[698,747,748],{"class":708},",",[698,750,751],{"class":712}," WorkflowEvent",[698,753,748],{"class":708},[698,755,756],{"class":712}," WorkflowStep",[698,758,716],{"class":708},[698,760,719],{"class":704},[698,762,722],{"class":708},[698,764,512],{"class":725},[698,766,729],{"class":708},[698,768,732],{"class":708},[698,770,772,774,776,779,781,783,785,788,790],{"class":700,"line":771},3,[698,773,705],{"class":704},[698,775,709],{"class":708},[698,777,778],{"class":712}," FulfillmentLog",[698,780,716],{"class":708},[698,782,719],{"class":704},[698,784,722],{"class":708},[698,786,787],{"class":725},".\u002Ffulfillment-log",[698,789,729],{"class":708},[698,791,732],{"class":708},[698,793,795],{"class":700,"line":794},4,[698,796,798],{"emptyLinePlaceholder":797},true,"\n",[698,800,802,806,810],{"class":700,"line":801},5,[698,803,805],{"class":804},"spNyl","interface",[698,807,809],{"class":808},"sBMFI"," FulfillmentPayload",[698,811,812],{"class":708}," {\n",[698,814,816,819,823,826,829],{"class":700,"line":815},6,[698,817,818],{"class":804},"  readonly",[698,820,822],{"class":821},"swJcz"," orderId",[698,824,825],{"class":708},":",[698,827,828],{"class":808}," string",[698,830,732],{"class":708},[698,832,834],{"class":700,"line":833},7,[698,835,836],{"class":708},"}\n",[698,838,840],{"class":700,"line":839},8,[698,841,798],{"emptyLinePlaceholder":797},[698,843,845,848,851,854,857,859],{"class":700,"line":844},9,[698,846,847],{"class":704},"export",[698,849,850],{"class":804}," class",[698,852,853],{"class":808}," OrderFulfillmentWorkflow",[698,855,856],{"class":804}," implements",[698,858,745],{"class":808},[698,860,861],{"class":708},"\u003C\n",[698,863,865,868],{"class":700,"line":864},10,[698,866,867],{"class":808},"  FulfillmentPayload",[698,869,870],{"class":708},",\n",[698,872,874,877,880,882,884,887,889],{"class":700,"line":873},11,[698,875,876],{"class":708},"  {",[698,878,879],{"class":821}," binding",[698,881,825],{"class":708},[698,883,722],{"class":708},[698,885,886],{"class":725},"ORDER_FULFILLMENT",[698,888,729],{"class":708},[698,890,891],{"class":708}," }\n",[698,893,895,898],{"class":700,"line":894},12,[698,896,897],{"class":708},">",[698,899,812],{"class":708},[698,901,903,906,909,912,915,918,922,924,926,929],{"class":700,"line":902},13,[698,904,905],{"class":804},"  public",[698,907,908],{"class":804}," constructor",[698,910,911],{"class":708},"(",[698,913,914],{"class":804},"private",[698,916,917],{"class":804}," readonly",[698,919,921],{"class":920},"sHdIc"," log",[698,923,825],{"class":708},[698,925,778],{"class":808},[698,927,928],{"class":708},")",[698,930,931],{"class":708}," {}\n",[698,933,935],{"class":700,"line":934},14,[698,936,798],{"emptyLinePlaceholder":797},[698,938,940,942,945,948],{"class":700,"line":939},15,[698,941,905],{"class":804},[698,943,944],{"class":804}," async",[698,946,947],{"class":821}," run",[698,949,950],{"class":708},"(\n",[698,952,954,957,959,961,964,967],{"class":700,"line":953},16,[698,955,956],{"class":920},"    event",[698,958,825],{"class":708},[698,960,751],{"class":808},[698,962,963],{"class":708},"\u003C",[698,965,966],{"class":808},"FulfillmentPayload",[698,968,969],{"class":708},">,\n",[698,971,973,976,978,980],{"class":700,"line":972},17,[698,974,975],{"class":920},"    step",[698,977,825],{"class":708},[698,979,756],{"class":808},[698,981,870],{"class":708},[698,983,985,988,991,994,996,998,1000,1003,1006,1008,1010,1013],{"class":700,"line":984},18,[698,986,987],{"class":708},"  ):",[698,989,990],{"class":808}," Promise",[698,992,993],{"class":708},"\u003C{",[698,995,822],{"class":821},[698,997,825],{"class":708},[698,999,828],{"class":808},[698,1001,1002],{"class":708},";",[698,1004,1005],{"class":821}," reservation",[698,1007,825],{"class":708},[698,1009,828],{"class":808},[698,1011,1012],{"class":708}," }>",[698,1014,812],{"class":708},[698,1016,1018,1021,1023,1026,1029,1032,1035,1037,1040],{"class":700,"line":1017},19,[698,1019,1020],{"class":804},"    const",[698,1022,822],{"class":712},[698,1024,1025],{"class":708}," =",[698,1027,1028],{"class":712}," event",[698,1030,1031],{"class":708},".",[698,1033,1034],{"class":712},"payload",[698,1036,1031],{"class":708},[698,1038,1039],{"class":712},"orderId",[698,1041,732],{"class":708},[698,1043,1045],{"class":700,"line":1044},20,[698,1046,798],{"emptyLinePlaceholder":797},[698,1048,1050,1052,1054,1056,1059,1062,1064,1068,1070,1072,1075,1077,1079,1081,1084,1087],{"class":700,"line":1049},21,[698,1051,1020],{"class":804},[698,1053,1005],{"class":712},[698,1055,1025],{"class":708},[698,1057,1058],{"class":704}," await",[698,1060,1061],{"class":712}," step",[698,1063,1031],{"class":708},[698,1065,1067],{"class":1066},"s2Zo4","do",[698,1069,911],{"class":821},[698,1071,729],{"class":708},[698,1073,1074],{"class":725},"reserve",[698,1076,729],{"class":708},[698,1078,748],{"class":708},[698,1080,944],{"class":804},[698,1082,1083],{"class":708}," ()",[698,1085,1086],{"class":804}," =>",[698,1088,812],{"class":708},[698,1090,1092,1095,1098,1100,1103,1105,1108,1111,1114,1116,1119,1121],{"class":700,"line":1091},22,[698,1093,1094],{"class":708},"      this.",[698,1096,1097],{"class":712},"log",[698,1099,1031],{"class":708},[698,1101,1102],{"class":1066},"record",[698,1104,911],{"class":821},[698,1106,1107],{"class":708},"`",[698,1109,1110],{"class":725},"reserve:",[698,1112,1113],{"class":708},"${",[698,1115,1039],{"class":712},[698,1117,1118],{"class":708},"}`",[698,1120,928],{"class":821},[698,1122,732],{"class":708},[698,1124,1126],{"class":700,"line":1125},23,[698,1127,798],{"emptyLinePlaceholder":797},[698,1129,1131,1134,1137,1140,1142,1144,1146],{"class":700,"line":1130},24,[698,1132,1133],{"class":704},"      return",[698,1135,1136],{"class":708}," `",[698,1138,1139],{"class":725},"reservation:",[698,1141,1113],{"class":708},[698,1143,1039],{"class":712},[698,1145,1118],{"class":708},[698,1147,732],{"class":708},[698,1149,1151,1154,1156],{"class":700,"line":1150},25,[698,1152,1153],{"class":708},"    }",[698,1155,928],{"class":821},[698,1157,732],{"class":708},[698,1159,1161],{"class":700,"line":1160},26,[698,1162,798],{"emptyLinePlaceholder":797},[698,1164,1166,1169,1171,1173,1176,1178,1180,1183,1185,1187,1190,1192,1194,1198,1200,1202,1205,1207,1210],{"class":700,"line":1165},27,[698,1167,1168],{"class":704},"    await",[698,1170,1061],{"class":712},[698,1172,1031],{"class":708},[698,1174,1175],{"class":1066},"sleep",[698,1177,911],{"class":821},[698,1179,729],{"class":708},[698,1181,1182],{"class":725},"settle",[698,1184,729],{"class":708},[698,1186,748],{"class":708},[698,1188,1189],{"class":708}," new",[698,1191,713],{"class":1066},[698,1193,911],{"class":821},[698,1195,1197],{"class":1196},"sbssI","50",[698,1199,748],{"class":708},[698,1201,722],{"class":708},[698,1203,1204],{"class":725},"ms",[698,1206,729],{"class":708},[698,1208,1209],{"class":821},"))",[698,1211,732],{"class":708},[698,1213,1215],{"class":700,"line":1214},28,[698,1216,798],{"emptyLinePlaceholder":797},[698,1218,1220,1222,1224,1226,1228,1230,1232,1235,1237,1239,1241,1243,1245],{"class":700,"line":1219},29,[698,1221,1168],{"class":704},[698,1223,1061],{"class":712},[698,1225,1031],{"class":708},[698,1227,1067],{"class":1066},[698,1229,911],{"class":821},[698,1231,729],{"class":708},[698,1233,1234],{"class":725},"charge",[698,1236,729],{"class":708},[698,1238,748],{"class":708},[698,1240,944],{"class":804},[698,1242,1083],{"class":708},[698,1244,1086],{"class":804},[698,1246,812],{"class":708},[698,1248,1250,1252,1254,1256,1258,1260,1262,1265,1267,1269,1271,1273],{"class":700,"line":1249},30,[698,1251,1094],{"class":708},[698,1253,1097],{"class":712},[698,1255,1031],{"class":708},[698,1257,1102],{"class":1066},[698,1259,911],{"class":821},[698,1261,1107],{"class":708},[698,1263,1264],{"class":725},"charge:",[698,1266,1113],{"class":708},[698,1268,1039],{"class":712},[698,1270,1118],{"class":708},[698,1272,928],{"class":821},[698,1274,732],{"class":708},[698,1276,1278,1280,1282],{"class":700,"line":1277},31,[698,1279,1153],{"class":708},[698,1281,928],{"class":821},[698,1283,732],{"class":708},[698,1285,1287],{"class":700,"line":1286},32,[698,1288,798],{"emptyLinePlaceholder":797},[698,1290,1292,1294,1296,1298,1300,1302,1304,1307,1309,1311,1313,1315,1317],{"class":700,"line":1291},33,[698,1293,1168],{"class":704},[698,1295,1061],{"class":712},[698,1297,1031],{"class":708},[698,1299,1067],{"class":1066},[698,1301,911],{"class":821},[698,1303,729],{"class":708},[698,1305,1306],{"class":725},"ship",[698,1308,729],{"class":708},[698,1310,748],{"class":708},[698,1312,944],{"class":804},[698,1314,1083],{"class":708},[698,1316,1086],{"class":804},[698,1318,812],{"class":708},[698,1320,1322,1324,1326,1328,1330,1332,1334,1337,1339,1341,1343,1345],{"class":700,"line":1321},34,[698,1323,1094],{"class":708},[698,1325,1097],{"class":712},[698,1327,1031],{"class":708},[698,1329,1102],{"class":1066},[698,1331,911],{"class":821},[698,1333,1107],{"class":708},[698,1335,1336],{"class":725},"ship:",[698,1338,1113],{"class":708},[698,1340,1039],{"class":712},[698,1342,1118],{"class":708},[698,1344,928],{"class":821},[698,1346,732],{"class":708},[698,1348,1350,1352,1354],{"class":700,"line":1349},35,[698,1351,1153],{"class":708},[698,1353,928],{"class":821},[698,1355,732],{"class":708},[698,1357,1359],{"class":700,"line":1358},36,[698,1360,798],{"emptyLinePlaceholder":797},[698,1362,1364,1367,1369,1371,1373,1375],{"class":700,"line":1363},37,[698,1365,1366],{"class":704},"    return",[698,1368,709],{"class":708},[698,1370,822],{"class":712},[698,1372,748],{"class":708},[698,1374,1005],{"class":712},[698,1376,1377],{"class":708}," };\n",[698,1379,1381],{"class":700,"line":1380},38,[698,1382,1383],{"class":708},"  }\n",[698,1385,1387],{"class":700,"line":1386},39,[698,1388,836],{"class":708},[499,1390,1391,1392,1395,1396,1399,1400,1403,1404,1407,1408,1411,1412,1415,1416,1031],{},"The ",[503,1393,1394],{},"step"," argument is the abstract ",[503,1397,1398],{},"WorkflowStep"," port — the callback is ",[503,1401,1402],{},"() => Promise\u003CT>"," (no platform\ncontext), and durations are ",[503,1405,1406],{},"TimeSpan","s (",[503,1409,1410],{},"new TimeSpan(50, \"ms\")",", ",[503,1413,1414],{},"new TimeSpan(2, \"d\")","). The run body\nnever imports ",[503,1417,1418],{},"cloudflare:workers",[543,1420,1422],{"id":1421},"declare-the-factory","Declare the factory",[499,1424,1425,1426,1429,1430,1433],{},"Inject a ",[503,1427,1428],{},"WorkflowFactory\u003CW>"," to create instances and address their handles. Extend it with an empty body —\nthe compiler reads the bound workflow off the ",[503,1431,1432],{},"extends"," type argument and wires the factory over the correct\nengine binding:",[688,1435,1438],{"className":690,"code":1436,"filename":1437,"language":693,"meta":694,"style":694},"import { WorkflowFactory } from \"@heximon\u002Fworkflow\";\nimport { OrderFulfillmentWorkflow } from \".\u002Forder-fulfillment.workflow\";\n\nexport class OrderFulfillmentFactory extends WorkflowFactory\u003COrderFulfillmentWorkflow> {}\n","workflow\u002Forder-fulfillment.factory.ts",[503,1439,1440,1461,1482,1486],{"__ignoreMap":694},[698,1441,1442,1444,1446,1449,1451,1453,1455,1457,1459],{"class":700,"line":701},[698,1443,705],{"class":704},[698,1445,709],{"class":708},[698,1447,1448],{"class":712}," WorkflowFactory",[698,1450,716],{"class":708},[698,1452,719],{"class":704},[698,1454,722],{"class":708},[698,1456,512],{"class":725},[698,1458,729],{"class":708},[698,1460,732],{"class":708},[698,1462,1463,1465,1467,1469,1471,1473,1475,1478,1480],{"class":700,"line":735},[698,1464,705],{"class":704},[698,1466,709],{"class":708},[698,1468,853],{"class":712},[698,1470,716],{"class":708},[698,1472,719],{"class":704},[698,1474,722],{"class":708},[698,1476,1477],{"class":725},".\u002Forder-fulfillment.workflow",[698,1479,729],{"class":708},[698,1481,732],{"class":708},[698,1483,1484],{"class":700,"line":771},[698,1485,798],{"emptyLinePlaceholder":797},[698,1487,1488,1490,1492,1495,1498,1500,1502,1505,1507],{"class":700,"line":794},[698,1489,847],{"class":704},[698,1491,850],{"class":804},[698,1493,1494],{"class":808}," OrderFulfillmentFactory",[698,1496,1497],{"class":804}," extends",[698,1499,1448],{"class":808},[698,1501,963],{"class":708},[698,1503,1504],{"class":808},"OrderFulfillmentWorkflow",[698,1506,897],{"class":708},[698,1508,931],{"class":708},[543,1510,1512],{"id":1511},"wire-the-module","Wire the module",[499,1514,1515,1516,1519,1520,1523,1524,1526],{},"List the workflow and its factory under ",[503,1517,1518],{},"workflow: { workflows, factories }",". List the three Node-engine store\nsatisfiers in ",[503,1521,1522],{},"providers"," along with the ",[503,1525,77],{}," they read:",[688,1528,1531],{"className":690,"code":1529,"filename":1530,"language":693,"meta":694,"style":694},"import { Module } from \"@heximon\u002Fruntime\";\nimport { Database } from \".\u002Fdatabase\u002Fdatabase\";\nimport { AppDurableTimerStore } from \".\u002Fdatabase\u002Fdurable-timer-store\";\nimport { AppWorkflowInstanceStore } from \".\u002Fdatabase\u002Fworkflow-instance-store\";\nimport { AppWorkflowStepStore } from \".\u002Fdatabase\u002Fworkflow-step-store\";\nimport { FulfillmentLog } from \".\u002Fworkflow\u002Ffulfillment-log\";\nimport { OrderFulfillmentFactory } from \".\u002Fworkflow\u002Forder-fulfillment.factory\";\nimport { OrderFulfillmentWorkflow } from \".\u002Fworkflow\u002Forder-fulfillment.workflow\";\nimport { OrdersController } from \".\u002Fworkflow\u002Forders.controller\";\n\nexport class AppModule extends Module({\n  providers: [\n    Database,\n    AppWorkflowStepStore,\n    AppWorkflowInstanceStore,\n    AppDurableTimerStore,\n    FulfillmentLog,\n  ],\n  http: { controllers: [OrdersController] },\n  workflow: { workflows: [OrderFulfillmentWorkflow], factories: [OrderFulfillmentFactory] },\n}) {}\n","app.module.ts",[503,1532,1533,1555,1577,1599,1621,1643,1664,1685,1706,1728,1732,1750,1760,1767,1774,1781,1788,1795,1802,1822,1851],{"__ignoreMap":694},[698,1534,1535,1537,1539,1542,1544,1546,1548,1551,1553],{"class":700,"line":701},[698,1536,705],{"class":704},[698,1538,709],{"class":708},[698,1540,1541],{"class":712}," Module",[698,1543,716],{"class":708},[698,1545,719],{"class":704},[698,1547,722],{"class":708},[698,1549,1550],{"class":725},"@heximon\u002Fruntime",[698,1552,729],{"class":708},[698,1554,732],{"class":708},[698,1556,1557,1559,1561,1564,1566,1568,1570,1573,1575],{"class":700,"line":735},[698,1558,705],{"class":704},[698,1560,709],{"class":708},[698,1562,1563],{"class":712}," Database",[698,1565,716],{"class":708},[698,1567,719],{"class":704},[698,1569,722],{"class":708},[698,1571,1572],{"class":725},".\u002Fdatabase\u002Fdatabase",[698,1574,729],{"class":708},[698,1576,732],{"class":708},[698,1578,1579,1581,1583,1586,1588,1590,1592,1595,1597],{"class":700,"line":771},[698,1580,705],{"class":704},[698,1582,709],{"class":708},[698,1584,1585],{"class":712}," AppDurableTimerStore",[698,1587,716],{"class":708},[698,1589,719],{"class":704},[698,1591,722],{"class":708},[698,1593,1594],{"class":725},".\u002Fdatabase\u002Fdurable-timer-store",[698,1596,729],{"class":708},[698,1598,732],{"class":708},[698,1600,1601,1603,1605,1608,1610,1612,1614,1617,1619],{"class":700,"line":794},[698,1602,705],{"class":704},[698,1604,709],{"class":708},[698,1606,1607],{"class":712}," AppWorkflowInstanceStore",[698,1609,716],{"class":708},[698,1611,719],{"class":704},[698,1613,722],{"class":708},[698,1615,1616],{"class":725},".\u002Fdatabase\u002Fworkflow-instance-store",[698,1618,729],{"class":708},[698,1620,732],{"class":708},[698,1622,1623,1625,1627,1630,1632,1634,1636,1639,1641],{"class":700,"line":801},[698,1624,705],{"class":704},[698,1626,709],{"class":708},[698,1628,1629],{"class":712}," AppWorkflowStepStore",[698,1631,716],{"class":708},[698,1633,719],{"class":704},[698,1635,722],{"class":708},[698,1637,1638],{"class":725},".\u002Fdatabase\u002Fworkflow-step-store",[698,1640,729],{"class":708},[698,1642,732],{"class":708},[698,1644,1645,1647,1649,1651,1653,1655,1657,1660,1662],{"class":700,"line":815},[698,1646,705],{"class":704},[698,1648,709],{"class":708},[698,1650,778],{"class":712},[698,1652,716],{"class":708},[698,1654,719],{"class":704},[698,1656,722],{"class":708},[698,1658,1659],{"class":725},".\u002Fworkflow\u002Ffulfillment-log",[698,1661,729],{"class":708},[698,1663,732],{"class":708},[698,1665,1666,1668,1670,1672,1674,1676,1678,1681,1683],{"class":700,"line":833},[698,1667,705],{"class":704},[698,1669,709],{"class":708},[698,1671,1494],{"class":712},[698,1673,716],{"class":708},[698,1675,719],{"class":704},[698,1677,722],{"class":708},[698,1679,1680],{"class":725},".\u002Fworkflow\u002Forder-fulfillment.factory",[698,1682,729],{"class":708},[698,1684,732],{"class":708},[698,1686,1687,1689,1691,1693,1695,1697,1699,1702,1704],{"class":700,"line":839},[698,1688,705],{"class":704},[698,1690,709],{"class":708},[698,1692,853],{"class":712},[698,1694,716],{"class":708},[698,1696,719],{"class":704},[698,1698,722],{"class":708},[698,1700,1701],{"class":725},".\u002Fworkflow\u002Forder-fulfillment.workflow",[698,1703,729],{"class":708},[698,1705,732],{"class":708},[698,1707,1708,1710,1712,1715,1717,1719,1721,1724,1726],{"class":700,"line":844},[698,1709,705],{"class":704},[698,1711,709],{"class":708},[698,1713,1714],{"class":712}," OrdersController",[698,1716,716],{"class":708},[698,1718,719],{"class":704},[698,1720,722],{"class":708},[698,1722,1723],{"class":725},".\u002Fworkflow\u002Forders.controller",[698,1725,729],{"class":708},[698,1727,732],{"class":708},[698,1729,1730],{"class":700,"line":864},[698,1731,798],{"emptyLinePlaceholder":797},[698,1733,1734,1736,1738,1741,1743,1745,1747],{"class":700,"line":873},[698,1735,847],{"class":704},[698,1737,850],{"class":804},[698,1739,1740],{"class":808}," AppModule",[698,1742,1497],{"class":804},[698,1744,1541],{"class":1066},[698,1746,911],{"class":712},[698,1748,1749],{"class":708},"{\n",[698,1751,1752,1755,1757],{"class":700,"line":894},[698,1753,1754],{"class":821},"  providers",[698,1756,825],{"class":708},[698,1758,1759],{"class":712}," [\n",[698,1761,1762,1765],{"class":700,"line":902},[698,1763,1764],{"class":712},"    Database",[698,1766,870],{"class":708},[698,1768,1769,1772],{"class":700,"line":934},[698,1770,1771],{"class":712},"    AppWorkflowStepStore",[698,1773,870],{"class":708},[698,1775,1776,1779],{"class":700,"line":939},[698,1777,1778],{"class":712},"    AppWorkflowInstanceStore",[698,1780,870],{"class":708},[698,1782,1783,1786],{"class":700,"line":953},[698,1784,1785],{"class":712},"    AppDurableTimerStore",[698,1787,870],{"class":708},[698,1789,1790,1793],{"class":700,"line":972},[698,1791,1792],{"class":712},"    FulfillmentLog",[698,1794,870],{"class":708},[698,1796,1797,1800],{"class":700,"line":984},[698,1798,1799],{"class":712},"  ]",[698,1801,870],{"class":708},[698,1803,1804,1807,1809,1811,1814,1816,1819],{"class":700,"line":1017},[698,1805,1806],{"class":821},"  http",[698,1808,825],{"class":708},[698,1810,709],{"class":708},[698,1812,1813],{"class":821}," controllers",[698,1815,825],{"class":708},[698,1817,1818],{"class":712}," [OrdersController] ",[698,1820,1821],{"class":708},"},\n",[698,1823,1824,1827,1829,1831,1834,1836,1839,1841,1844,1846,1849],{"class":700,"line":1044},[698,1825,1826],{"class":821},"  workflow",[698,1828,825],{"class":708},[698,1830,709],{"class":708},[698,1832,1833],{"class":821}," workflows",[698,1835,825],{"class":708},[698,1837,1838],{"class":712}," [OrderFulfillmentWorkflow]",[698,1840,748],{"class":708},[698,1842,1843],{"class":821}," factories",[698,1845,825],{"class":708},[698,1847,1848],{"class":712}," [OrderFulfillmentFactory] ",[698,1850,1821],{"class":708},[698,1852,1853,1856,1859],{"class":700,"line":1049},[698,1854,1855],{"class":708},"}",[698,1857,1858],{"class":712},") ",[698,1860,1861],{"class":708},"{}\n",[499,1863,1864,1865,1868,1869,1872,1873,1876,1877,1880],{},"Register ",[503,1866,1867],{},"WorkflowPlugin"," in ",[503,1870,1871],{},"heximon.config.ts",". It automatically requires ",[503,1874,1875],{},"QueuePlugin"," (the durable resume\nwakeup rides the shared ",[503,1878,1879],{},"\"queue:channel\""," dispatch table):",[688,1882,1884],{"className":690,"code":1883,"filename":1871,"language":693,"meta":694,"style":694},"import { defineHeximonConfig } from \"@heximon\u002Fbuild\";\nimport { HttpPlugin } from \"@heximon\u002Fhttp\u002Fcompiler\";\nimport { WorkflowPlugin } from \"@heximon\u002Fworkflow\u002Fcompiler\";\n\nexport default defineHeximonConfig({\n  plugins: [new HttpPlugin(), new WorkflowPlugin()],\n});\n",[503,1885,1886,1908,1930,1952,1956,1969,1998],{"__ignoreMap":694},[698,1887,1888,1890,1892,1895,1897,1899,1901,1904,1906],{"class":700,"line":701},[698,1889,705],{"class":704},[698,1891,709],{"class":708},[698,1893,1894],{"class":712}," defineHeximonConfig",[698,1896,716],{"class":708},[698,1898,719],{"class":704},[698,1900,722],{"class":708},[698,1902,1903],{"class":725},"@heximon\u002Fbuild",[698,1905,729],{"class":708},[698,1907,732],{"class":708},[698,1909,1910,1912,1914,1917,1919,1921,1923,1926,1928],{"class":700,"line":735},[698,1911,705],{"class":704},[698,1913,709],{"class":708},[698,1915,1916],{"class":712}," HttpPlugin",[698,1918,716],{"class":708},[698,1920,719],{"class":704},[698,1922,722],{"class":708},[698,1924,1925],{"class":725},"@heximon\u002Fhttp\u002Fcompiler",[698,1927,729],{"class":708},[698,1929,732],{"class":708},[698,1931,1932,1934,1936,1939,1941,1943,1945,1948,1950],{"class":700,"line":771},[698,1933,705],{"class":704},[698,1935,709],{"class":708},[698,1937,1938],{"class":712}," WorkflowPlugin",[698,1940,716],{"class":708},[698,1942,719],{"class":704},[698,1944,722],{"class":708},[698,1946,1947],{"class":725},"@heximon\u002Fworkflow\u002Fcompiler",[698,1949,729],{"class":708},[698,1951,732],{"class":708},[698,1953,1954],{"class":700,"line":794},[698,1955,798],{"emptyLinePlaceholder":797},[698,1957,1958,1960,1963,1965,1967],{"class":700,"line":801},[698,1959,847],{"class":704},[698,1961,1962],{"class":704}," default",[698,1964,1894],{"class":1066},[698,1966,911],{"class":712},[698,1968,1749],{"class":708},[698,1970,1971,1974,1976,1979,1982,1984,1987,1989,1991,1993,1996],{"class":700,"line":815},[698,1972,1973],{"class":821},"  plugins",[698,1975,825],{"class":708},[698,1977,1978],{"class":712}," [",[698,1980,1981],{"class":708},"new",[698,1983,1916],{"class":1066},[698,1985,1986],{"class":712},"()",[698,1988,748],{"class":708},[698,1990,1189],{"class":708},[698,1992,1938],{"class":1066},[698,1994,1995],{"class":712},"()]",[698,1997,870],{"class":708},[698,1999,2000,2002,2004],{"class":700,"line":833},[698,2001,1855],{"class":708},[698,2003,928],{"class":712},[698,2005,732],{"class":708},[543,2007,2009],{"id":2008},"create-and-poll-instances","Create and poll instances",[499,2011,2012,2013,2016,2017,2020,2021,2024,2025,2028,2029,2032,2033,2036],{},"The factory's ",[503,2014,2015],{},"create"," starts a run, its ",[503,2018,2019],{},"get"," returns a handle to an existing one. A dedicated ",[503,2022,2023],{},"\u002Ffulfillment","\nprefix keeps the workflow surface separate from the ",[503,2026,2027],{},"\u002Forders"," contract controller: ",[503,2030,2031],{},"POST \u002Ffulfillment"," creates\nan instance, ",[503,2034,2035],{},"GET \u002Ffulfillment\u002F:id"," reads its live status:",[688,2038,2041],{"className":690,"code":2039,"filename":2040,"language":693,"meta":694,"style":694},"import { NotFoundError } from \"@heximon\u002Fruntime\u002Ferrors\";\nimport type { Controller, Get, Post } from \"@heximon\u002Fhttp\";\nimport { OrderFulfillmentFactory } from \".\u002Forder-fulfillment.factory\";\n\ninterface FulfillBody {\n  readonly orderId: string;\n}\n\ninterface FulfillmentResponse {\n  readonly id: string;\n  readonly status: string;\n  readonly output?: unknown;\n}\n\nexport class FulfillmentController implements Controller\u003C\"\u002Ffulfillment\"> {\n  public constructor(private readonly workflows: OrderFulfillmentFactory) {}\n\n  public async find(action: Get\u003C\"\u002F:id\">): Promise\u003CFulfillmentResponse> {\n    const handle = await this.workflows.get(action.request.pathParams.id);\n    const status = await handle.status();\n\n    if (status.status === \"unknown\") {\n      throw new NotFoundError(`Workflow ${action.request.pathParams.id} not found`);\n    }\n\n    return {\n      id: handle.id,\n      status: status.status,\n      ...(status.output !== undefined ? { output: status.output } : {}),\n    };\n  }\n\n  public async fulfill(action: Post\u003C\"\u002F\">): Promise\u003CFulfillmentResponse> {\n    const body = (await action.request.json()) as FulfillBody;\n    const handle = await this.workflows.create({ params: { orderId: body.orderId } });\n    const status = await handle.status();\n\n    action.response.status = 201;\n\n    return { id: handle.id, status: status.status };\n  }\n}\n","workflow\u002Ffulfillment.controller.ts",[503,2042,2043,2065,2099,2120,2124,2133,2145,2149,2153,2162,2175,2188,2203,2207,2211,2236,2258,2262,2303,2347,2368,2372,2400,2443,2448,2452,2458,2473,2488,2535,2540,2544,2548,2586,2622,2670,2690,2694,2715,2719,2750,2755],{"__ignoreMap":694},[698,2044,2045,2047,2049,2052,2054,2056,2058,2061,2063],{"class":700,"line":701},[698,2046,705],{"class":704},[698,2048,709],{"class":708},[698,2050,2051],{"class":712}," NotFoundError",[698,2053,716],{"class":708},[698,2055,719],{"class":704},[698,2057,722],{"class":708},[698,2059,2060],{"class":725},"@heximon\u002Fruntime\u002Ferrors",[698,2062,729],{"class":708},[698,2064,732],{"class":708},[698,2066,2067,2069,2071,2073,2076,2078,2081,2083,2086,2088,2090,2092,2095,2097],{"class":700,"line":735},[698,2068,705],{"class":704},[698,2070,740],{"class":704},[698,2072,709],{"class":708},[698,2074,2075],{"class":712}," Controller",[698,2077,748],{"class":708},[698,2079,2080],{"class":712}," Get",[698,2082,748],{"class":708},[698,2084,2085],{"class":712}," Post",[698,2087,716],{"class":708},[698,2089,719],{"class":704},[698,2091,722],{"class":708},[698,2093,2094],{"class":725},"@heximon\u002Fhttp",[698,2096,729],{"class":708},[698,2098,732],{"class":708},[698,2100,2101,2103,2105,2107,2109,2111,2113,2116,2118],{"class":700,"line":771},[698,2102,705],{"class":704},[698,2104,709],{"class":708},[698,2106,1494],{"class":712},[698,2108,716],{"class":708},[698,2110,719],{"class":704},[698,2112,722],{"class":708},[698,2114,2115],{"class":725},".\u002Forder-fulfillment.factory",[698,2117,729],{"class":708},[698,2119,732],{"class":708},[698,2121,2122],{"class":700,"line":794},[698,2123,798],{"emptyLinePlaceholder":797},[698,2125,2126,2128,2131],{"class":700,"line":801},[698,2127,805],{"class":804},[698,2129,2130],{"class":808}," FulfillBody",[698,2132,812],{"class":708},[698,2134,2135,2137,2139,2141,2143],{"class":700,"line":815},[698,2136,818],{"class":804},[698,2138,822],{"class":821},[698,2140,825],{"class":708},[698,2142,828],{"class":808},[698,2144,732],{"class":708},[698,2146,2147],{"class":700,"line":833},[698,2148,836],{"class":708},[698,2150,2151],{"class":700,"line":839},[698,2152,798],{"emptyLinePlaceholder":797},[698,2154,2155,2157,2160],{"class":700,"line":844},[698,2156,805],{"class":804},[698,2158,2159],{"class":808}," FulfillmentResponse",[698,2161,812],{"class":708},[698,2163,2164,2166,2169,2171,2173],{"class":700,"line":864},[698,2165,818],{"class":804},[698,2167,2168],{"class":821}," id",[698,2170,825],{"class":708},[698,2172,828],{"class":808},[698,2174,732],{"class":708},[698,2176,2177,2179,2182,2184,2186],{"class":700,"line":873},[698,2178,818],{"class":804},[698,2180,2181],{"class":821}," status",[698,2183,825],{"class":708},[698,2185,828],{"class":808},[698,2187,732],{"class":708},[698,2189,2190,2192,2195,2198,2201],{"class":700,"line":894},[698,2191,818],{"class":804},[698,2193,2194],{"class":821}," output",[698,2196,2197],{"class":708},"?:",[698,2199,2200],{"class":808}," unknown",[698,2202,732],{"class":708},[698,2204,2205],{"class":700,"line":902},[698,2206,836],{"class":708},[698,2208,2209],{"class":700,"line":934},[698,2210,798],{"emptyLinePlaceholder":797},[698,2212,2213,2215,2217,2220,2222,2224,2226,2228,2230,2232,2234],{"class":700,"line":939},[698,2214,847],{"class":704},[698,2216,850],{"class":804},[698,2218,2219],{"class":808}," FulfillmentController",[698,2221,856],{"class":804},[698,2223,2075],{"class":808},[698,2225,963],{"class":708},[698,2227,729],{"class":708},[698,2229,2023],{"class":725},[698,2231,729],{"class":708},[698,2233,897],{"class":708},[698,2235,812],{"class":708},[698,2237,2238,2240,2242,2244,2246,2248,2250,2252,2254,2256],{"class":700,"line":953},[698,2239,905],{"class":804},[698,2241,908],{"class":804},[698,2243,911],{"class":708},[698,2245,914],{"class":804},[698,2247,917],{"class":804},[698,2249,1833],{"class":920},[698,2251,825],{"class":708},[698,2253,1494],{"class":808},[698,2255,928],{"class":708},[698,2257,931],{"class":708},[698,2259,2260],{"class":700,"line":972},[698,2261,798],{"emptyLinePlaceholder":797},[698,2263,2264,2266,2268,2271,2273,2276,2278,2280,2282,2284,2287,2289,2292,2294,2296,2299,2301],{"class":700,"line":984},[698,2265,905],{"class":804},[698,2267,944],{"class":804},[698,2269,2270],{"class":821}," find",[698,2272,911],{"class":708},[698,2274,2275],{"class":920},"action",[698,2277,825],{"class":708},[698,2279,2080],{"class":808},[698,2281,963],{"class":708},[698,2283,729],{"class":708},[698,2285,2286],{"class":725},"\u002F:id",[698,2288,729],{"class":708},[698,2290,2291],{"class":708},">):",[698,2293,990],{"class":808},[698,2295,963],{"class":708},[698,2297,2298],{"class":808},"FulfillmentResponse",[698,2300,897],{"class":708},[698,2302,812],{"class":708},[698,2304,2305,2307,2310,2312,2314,2317,2320,2322,2324,2326,2328,2330,2333,2335,2338,2340,2343,2345],{"class":700,"line":1017},[698,2306,1020],{"class":804},[698,2308,2309],{"class":712}," handle",[698,2311,1025],{"class":708},[698,2313,1058],{"class":704},[698,2315,2316],{"class":708}," this.",[698,2318,2319],{"class":712},"workflows",[698,2321,1031],{"class":708},[698,2323,2019],{"class":1066},[698,2325,911],{"class":821},[698,2327,2275],{"class":712},[698,2329,1031],{"class":708},[698,2331,2332],{"class":712},"request",[698,2334,1031],{"class":708},[698,2336,2337],{"class":712},"pathParams",[698,2339,1031],{"class":708},[698,2341,2342],{"class":712},"id",[698,2344,928],{"class":821},[698,2346,732],{"class":708},[698,2348,2349,2351,2353,2355,2357,2359,2361,2364,2366],{"class":700,"line":1044},[698,2350,1020],{"class":804},[698,2352,2181],{"class":712},[698,2354,1025],{"class":708},[698,2356,1058],{"class":704},[698,2358,2309],{"class":712},[698,2360,1031],{"class":708},[698,2362,2363],{"class":1066},"status",[698,2365,1986],{"class":821},[698,2367,732],{"class":708},[698,2369,2370],{"class":700,"line":1049},[698,2371,798],{"emptyLinePlaceholder":797},[698,2373,2374,2377,2380,2382,2384,2386,2389,2391,2394,2396,2398],{"class":700,"line":1091},[698,2375,2376],{"class":704},"    if",[698,2378,2379],{"class":821}," (",[698,2381,2363],{"class":712},[698,2383,1031],{"class":708},[698,2385,2363],{"class":712},[698,2387,2388],{"class":708}," ===",[698,2390,722],{"class":708},[698,2392,2393],{"class":725},"unknown",[698,2395,729],{"class":708},[698,2397,1858],{"class":821},[698,2399,1749],{"class":708},[698,2401,2402,2405,2407,2409,2411,2413,2416,2418,2420,2422,2424,2426,2428,2430,2432,2434,2437,2439,2441],{"class":700,"line":1125},[698,2403,2404],{"class":704},"      throw",[698,2406,1189],{"class":708},[698,2408,2051],{"class":1066},[698,2410,911],{"class":821},[698,2412,1107],{"class":708},[698,2414,2415],{"class":725},"Workflow ",[698,2417,1113],{"class":708},[698,2419,2275],{"class":712},[698,2421,1031],{"class":708},[698,2423,2332],{"class":712},[698,2425,1031],{"class":708},[698,2427,2337],{"class":712},[698,2429,1031],{"class":708},[698,2431,2342],{"class":712},[698,2433,1855],{"class":708},[698,2435,2436],{"class":725}," not found",[698,2438,1107],{"class":708},[698,2440,928],{"class":821},[698,2442,732],{"class":708},[698,2444,2445],{"class":700,"line":1130},[698,2446,2447],{"class":708},"    }\n",[698,2449,2450],{"class":700,"line":1150},[698,2451,798],{"emptyLinePlaceholder":797},[698,2453,2454,2456],{"class":700,"line":1160},[698,2455,1366],{"class":704},[698,2457,812],{"class":708},[698,2459,2460,2463,2465,2467,2469,2471],{"class":700,"line":1165},[698,2461,2462],{"class":821},"      id",[698,2464,825],{"class":708},[698,2466,2309],{"class":712},[698,2468,1031],{"class":708},[698,2470,2342],{"class":712},[698,2472,870],{"class":708},[698,2474,2475,2478,2480,2482,2484,2486],{"class":700,"line":1214},[698,2476,2477],{"class":821},"      status",[698,2479,825],{"class":708},[698,2481,2181],{"class":712},[698,2483,1031],{"class":708},[698,2485,2363],{"class":712},[698,2487,870],{"class":708},[698,2489,2490,2493,2495,2497,2499,2502,2505,2508,2511,2513,2515,2517,2519,2521,2523,2525,2528,2531,2533],{"class":700,"line":1219},[698,2491,2492],{"class":708},"      ...",[698,2494,911],{"class":821},[698,2496,2363],{"class":712},[698,2498,1031],{"class":708},[698,2500,2501],{"class":712},"output",[698,2503,2504],{"class":708}," !==",[698,2506,2507],{"class":708}," undefined",[698,2509,2510],{"class":708}," ?",[698,2512,709],{"class":708},[698,2514,2194],{"class":821},[698,2516,825],{"class":708},[698,2518,2181],{"class":712},[698,2520,1031],{"class":708},[698,2522,2501],{"class":712},[698,2524,716],{"class":708},[698,2526,2527],{"class":708}," :",[698,2529,2530],{"class":708}," {}",[698,2532,928],{"class":821},[698,2534,870],{"class":708},[698,2536,2537],{"class":700,"line":1249},[698,2538,2539],{"class":708},"    };\n",[698,2541,2542],{"class":700,"line":1277},[698,2543,1383],{"class":708},[698,2545,2546],{"class":700,"line":1286},[698,2547,798],{"emptyLinePlaceholder":797},[698,2549,2550,2552,2554,2557,2559,2561,2563,2565,2567,2569,2572,2574,2576,2578,2580,2582,2584],{"class":700,"line":1291},[698,2551,905],{"class":804},[698,2553,944],{"class":804},[698,2555,2556],{"class":821}," fulfill",[698,2558,911],{"class":708},[698,2560,2275],{"class":920},[698,2562,825],{"class":708},[698,2564,2085],{"class":808},[698,2566,963],{"class":708},[698,2568,729],{"class":708},[698,2570,2571],{"class":725},"\u002F",[698,2573,729],{"class":708},[698,2575,2291],{"class":708},[698,2577,990],{"class":808},[698,2579,963],{"class":708},[698,2581,2298],{"class":808},[698,2583,897],{"class":708},[698,2585,812],{"class":708},[698,2587,2588,2590,2593,2595,2597,2600,2603,2605,2607,2609,2612,2615,2618,2620],{"class":700,"line":1321},[698,2589,1020],{"class":804},[698,2591,2592],{"class":712}," body",[698,2594,1025],{"class":708},[698,2596,2379],{"class":821},[698,2598,2599],{"class":704},"await",[698,2601,2602],{"class":712}," action",[698,2604,1031],{"class":708},[698,2606,2332],{"class":712},[698,2608,1031],{"class":708},[698,2610,2611],{"class":1066},"json",[698,2613,2614],{"class":821},"()) ",[698,2616,2617],{"class":704},"as",[698,2619,2130],{"class":808},[698,2621,732],{"class":708},[698,2623,2624,2626,2628,2630,2632,2634,2636,2638,2640,2642,2645,2648,2650,2652,2654,2656,2658,2660,2662,2664,2666,2668],{"class":700,"line":1349},[698,2625,1020],{"class":804},[698,2627,2309],{"class":712},[698,2629,1025],{"class":708},[698,2631,1058],{"class":704},[698,2633,2316],{"class":708},[698,2635,2319],{"class":712},[698,2637,1031],{"class":708},[698,2639,2015],{"class":1066},[698,2641,911],{"class":821},[698,2643,2644],{"class":708},"{",[698,2646,2647],{"class":821}," params",[698,2649,825],{"class":708},[698,2651,709],{"class":708},[698,2653,822],{"class":821},[698,2655,825],{"class":708},[698,2657,2592],{"class":712},[698,2659,1031],{"class":708},[698,2661,1039],{"class":712},[698,2663,716],{"class":708},[698,2665,716],{"class":708},[698,2667,928],{"class":821},[698,2669,732],{"class":708},[698,2671,2672,2674,2676,2678,2680,2682,2684,2686,2688],{"class":700,"line":1358},[698,2673,1020],{"class":804},[698,2675,2181],{"class":712},[698,2677,1025],{"class":708},[698,2679,1058],{"class":704},[698,2681,2309],{"class":712},[698,2683,1031],{"class":708},[698,2685,2363],{"class":1066},[698,2687,1986],{"class":821},[698,2689,732],{"class":708},[698,2691,2692],{"class":700,"line":1363},[698,2693,798],{"emptyLinePlaceholder":797},[698,2695,2696,2699,2701,2704,2706,2708,2710,2713],{"class":700,"line":1380},[698,2697,2698],{"class":712},"    action",[698,2700,1031],{"class":708},[698,2702,2703],{"class":712},"response",[698,2705,1031],{"class":708},[698,2707,2363],{"class":712},[698,2709,1025],{"class":708},[698,2711,2712],{"class":1196}," 201",[698,2714,732],{"class":708},[698,2716,2717],{"class":700,"line":1386},[698,2718,798],{"emptyLinePlaceholder":797},[698,2720,2722,2724,2726,2728,2730,2732,2734,2736,2738,2740,2742,2744,2746,2748],{"class":700,"line":2721},40,[698,2723,1366],{"class":704},[698,2725,709],{"class":708},[698,2727,2168],{"class":821},[698,2729,825],{"class":708},[698,2731,2309],{"class":712},[698,2733,1031],{"class":708},[698,2735,2342],{"class":712},[698,2737,748],{"class":708},[698,2739,2181],{"class":821},[698,2741,825],{"class":708},[698,2743,2181],{"class":712},[698,2745,1031],{"class":708},[698,2747,2363],{"class":712},[698,2749,1377],{"class":708},[698,2751,2753],{"class":700,"line":2752},41,[698,2754,1383],{"class":708},[698,2756,2758],{"class":700,"line":2757},42,[698,2759,836],{"class":708},[543,2761,2763],{"id":2762},"wire-the-store-satisfiers","Wire the store satisfiers",[499,2765,2766],{},"The Node replay engine needs three persistence ports. Each follows the same one-hop satisfier pattern: extend\nthe shipped drizzle implementation, bind the table, implement the abstract token.",[499,2768,2769,2772],{},[534,2770,2771],{},"Declare the tables"," (all three live in the same schema file in the example):",[688,2774,2777],{"className":690,"code":2775,"filename":2776,"language":693,"meta":694,"style":694},"import { workflowStepColumns, workflowInstanceColumns } from \"@heximon\u002Fworkflow\u002Fnode\";\nimport { durableTimerColumns } from \"@heximon\u002Fsaga\u002Fnode\";\nimport { primaryKey, sqliteTable } from \"drizzle-orm\u002Fsqlite-core\";\n\nexport const workflowSteps = sqliteTable(\n  \"workflow_steps\",\n  { ...workflowStepColumns(\"sqlite\") },\n  (columns) => [\n    primaryKey({ columns: [columns.workflowInstanceId, columns.stepName, columns.stepCount] }),\n  ],\n);\n\nexport const workflowInstances = sqliteTable(\"workflow_instances\", {\n  ...workflowInstanceColumns(\"sqlite\"),\n});\n\nexport const durableTimers = sqliteTable(\n  \"durable_timers\",\n  { ...durableTimerColumns(\"sqlite\") },\n  (columns) => [primaryKey({ columns: [columns.sagaName, columns.correlationKey, columns.slot] })],\n);\n","database\u002Ftables.ts",[503,2778,2779,2806,2828,2855,2859,2876,2887,2910,2924,2970,2976,2982,2986,3012,3032,3040,3044,3059,3069,3090,3145],{"__ignoreMap":694},[698,2780,2781,2783,2785,2788,2790,2793,2795,2797,2799,2802,2804],{"class":700,"line":701},[698,2782,705],{"class":704},[698,2784,709],{"class":708},[698,2786,2787],{"class":712}," workflowStepColumns",[698,2789,748],{"class":708},[698,2791,2792],{"class":712}," workflowInstanceColumns",[698,2794,716],{"class":708},[698,2796,719],{"class":704},[698,2798,722],{"class":708},[698,2800,2801],{"class":725},"@heximon\u002Fworkflow\u002Fnode",[698,2803,729],{"class":708},[698,2805,732],{"class":708},[698,2807,2808,2810,2812,2815,2817,2819,2821,2824,2826],{"class":700,"line":735},[698,2809,705],{"class":704},[698,2811,709],{"class":708},[698,2813,2814],{"class":712}," durableTimerColumns",[698,2816,716],{"class":708},[698,2818,719],{"class":704},[698,2820,722],{"class":708},[698,2822,2823],{"class":725},"@heximon\u002Fsaga\u002Fnode",[698,2825,729],{"class":708},[698,2827,732],{"class":708},[698,2829,2830,2832,2834,2837,2839,2842,2844,2846,2848,2851,2853],{"class":700,"line":771},[698,2831,705],{"class":704},[698,2833,709],{"class":708},[698,2835,2836],{"class":712}," primaryKey",[698,2838,748],{"class":708},[698,2840,2841],{"class":712}," sqliteTable",[698,2843,716],{"class":708},[698,2845,719],{"class":704},[698,2847,722],{"class":708},[698,2849,2850],{"class":725},"drizzle-orm\u002Fsqlite-core",[698,2852,729],{"class":708},[698,2854,732],{"class":708},[698,2856,2857],{"class":700,"line":794},[698,2858,798],{"emptyLinePlaceholder":797},[698,2860,2861,2863,2866,2869,2872,2874],{"class":700,"line":801},[698,2862,847],{"class":704},[698,2864,2865],{"class":804}," const",[698,2867,2868],{"class":712}," workflowSteps ",[698,2870,2871],{"class":708},"=",[698,2873,2841],{"class":1066},[698,2875,950],{"class":712},[698,2877,2878,2881,2883,2885],{"class":700,"line":815},[698,2879,2880],{"class":708},"  \"",[698,2882,570],{"class":725},[698,2884,729],{"class":708},[698,2886,870],{"class":708},[698,2888,2889,2891,2894,2897,2899,2901,2904,2906,2908],{"class":700,"line":833},[698,2890,876],{"class":708},[698,2892,2893],{"class":708}," ...",[698,2895,2896],{"class":1066},"workflowStepColumns",[698,2898,911],{"class":712},[698,2900,729],{"class":708},[698,2902,2903],{"class":725},"sqlite",[698,2905,729],{"class":708},[698,2907,1858],{"class":712},[698,2909,1821],{"class":708},[698,2911,2912,2915,2918,2920,2922],{"class":700,"line":839},[698,2913,2914],{"class":708},"  (",[698,2916,2917],{"class":920},"columns",[698,2919,928],{"class":708},[698,2921,1086],{"class":804},[698,2923,1759],{"class":712},[698,2925,2926,2929,2931,2933,2936,2938,2941,2943,2946,2948,2950,2952,2955,2957,2959,2961,2964,2966,2968],{"class":700,"line":844},[698,2927,2928],{"class":1066},"    primaryKey",[698,2930,911],{"class":712},[698,2932,2644],{"class":708},[698,2934,2935],{"class":821}," columns",[698,2937,825],{"class":708},[698,2939,2940],{"class":712}," [columns",[698,2942,1031],{"class":708},[698,2944,2945],{"class":712},"workflowInstanceId",[698,2947,748],{"class":708},[698,2949,2935],{"class":712},[698,2951,1031],{"class":708},[698,2953,2954],{"class":712},"stepName",[698,2956,748],{"class":708},[698,2958,2935],{"class":712},[698,2960,1031],{"class":708},[698,2962,2963],{"class":712},"stepCount] ",[698,2965,1855],{"class":708},[698,2967,928],{"class":712},[698,2969,870],{"class":708},[698,2971,2972,2974],{"class":700,"line":864},[698,2973,1799],{"class":712},[698,2975,870],{"class":708},[698,2977,2978,2980],{"class":700,"line":873},[698,2979,928],{"class":712},[698,2981,732],{"class":708},[698,2983,2984],{"class":700,"line":894},[698,2985,798],{"emptyLinePlaceholder":797},[698,2987,2988,2990,2992,2995,2997,2999,3001,3003,3006,3008,3010],{"class":700,"line":902},[698,2989,847],{"class":704},[698,2991,2865],{"class":804},[698,2993,2994],{"class":712}," workflowInstances ",[698,2996,2871],{"class":708},[698,2998,2841],{"class":1066},[698,3000,911],{"class":712},[698,3002,729],{"class":708},[698,3004,3005],{"class":725},"workflow_instances",[698,3007,729],{"class":708},[698,3009,748],{"class":708},[698,3011,812],{"class":708},[698,3013,3014,3017,3020,3022,3024,3026,3028,3030],{"class":700,"line":934},[698,3015,3016],{"class":708},"  ...",[698,3018,3019],{"class":1066},"workflowInstanceColumns",[698,3021,911],{"class":712},[698,3023,729],{"class":708},[698,3025,2903],{"class":725},[698,3027,729],{"class":708},[698,3029,928],{"class":712},[698,3031,870],{"class":708},[698,3033,3034,3036,3038],{"class":700,"line":939},[698,3035,1855],{"class":708},[698,3037,928],{"class":712},[698,3039,732],{"class":708},[698,3041,3042],{"class":700,"line":953},[698,3043,798],{"emptyLinePlaceholder":797},[698,3045,3046,3048,3050,3053,3055,3057],{"class":700,"line":972},[698,3047,847],{"class":704},[698,3049,2865],{"class":804},[698,3051,3052],{"class":712}," durableTimers ",[698,3054,2871],{"class":708},[698,3056,2841],{"class":1066},[698,3058,950],{"class":712},[698,3060,3061,3063,3065,3067],{"class":700,"line":984},[698,3062,2880],{"class":708},[698,3064,584],{"class":725},[698,3066,729],{"class":708},[698,3068,870],{"class":708},[698,3070,3071,3073,3075,3078,3080,3082,3084,3086,3088],{"class":700,"line":1017},[698,3072,876],{"class":708},[698,3074,2893],{"class":708},[698,3076,3077],{"class":1066},"durableTimerColumns",[698,3079,911],{"class":712},[698,3081,729],{"class":708},[698,3083,2903],{"class":725},[698,3085,729],{"class":708},[698,3087,1858],{"class":712},[698,3089,1821],{"class":708},[698,3091,3092,3094,3096,3098,3100,3102,3105,3107,3109,3111,3113,3115,3117,3120,3122,3124,3126,3129,3131,3133,3135,3138,3140,3143],{"class":700,"line":1044},[698,3093,2914],{"class":708},[698,3095,2917],{"class":920},[698,3097,928],{"class":708},[698,3099,1086],{"class":804},[698,3101,1978],{"class":712},[698,3103,3104],{"class":1066},"primaryKey",[698,3106,911],{"class":712},[698,3108,2644],{"class":708},[698,3110,2935],{"class":821},[698,3112,825],{"class":708},[698,3114,2940],{"class":712},[698,3116,1031],{"class":708},[698,3118,3119],{"class":712},"sagaName",[698,3121,748],{"class":708},[698,3123,2935],{"class":712},[698,3125,1031],{"class":708},[698,3127,3128],{"class":712},"correlationKey",[698,3130,748],{"class":708},[698,3132,2935],{"class":712},[698,3134,1031],{"class":708},[698,3136,3137],{"class":712},"slot] ",[698,3139,1855],{"class":708},[698,3141,3142],{"class":712},")]",[698,3144,870],{"class":708},[698,3146,3147,3149],{"class":700,"line":1049},[698,3148,928],{"class":712},[698,3150,732],{"class":708},[499,3152,3153],{},[534,3154,3155],{},"Bind the step-memoization store:",[688,3157,3160],{"className":690,"code":3158,"filename":3159,"language":693,"meta":694,"style":694},"import { WorkflowStepStore, DrizzleWorkflowStepStore } from \"@heximon\u002Fworkflow\u002Fnode\";\nimport { Database } from \".\u002Fdatabase\";\nimport { workflowSteps } from \".\u002Ftables\";\n\nexport class AppWorkflowStepStore extends DrizzleWorkflowStepStore implements WorkflowStepStore {\n  public constructor(database: Database) {\n    super(database, workflowSteps);\n  }\n}\n","database\u002Fworkflow-step-store.ts",[503,3161,3162,3188,3209,3231,3235,3253,3272,3289,3293],{"__ignoreMap":694},[698,3163,3164,3166,3168,3171,3173,3176,3178,3180,3182,3184,3186],{"class":700,"line":701},[698,3165,705],{"class":704},[698,3167,709],{"class":708},[698,3169,3170],{"class":712}," WorkflowStepStore",[698,3172,748],{"class":708},[698,3174,3175],{"class":712}," DrizzleWorkflowStepStore",[698,3177,716],{"class":708},[698,3179,719],{"class":704},[698,3181,722],{"class":708},[698,3183,2801],{"class":725},[698,3185,729],{"class":708},[698,3187,732],{"class":708},[698,3189,3190,3192,3194,3196,3198,3200,3202,3205,3207],{"class":700,"line":735},[698,3191,705],{"class":704},[698,3193,709],{"class":708},[698,3195,1563],{"class":712},[698,3197,716],{"class":708},[698,3199,719],{"class":704},[698,3201,722],{"class":708},[698,3203,3204],{"class":725},".\u002Fdatabase",[698,3206,729],{"class":708},[698,3208,732],{"class":708},[698,3210,3211,3213,3215,3218,3220,3222,3224,3227,3229],{"class":700,"line":771},[698,3212,705],{"class":704},[698,3214,709],{"class":708},[698,3216,3217],{"class":712}," workflowSteps",[698,3219,716],{"class":708},[698,3221,719],{"class":704},[698,3223,722],{"class":708},[698,3225,3226],{"class":725},".\u002Ftables",[698,3228,729],{"class":708},[698,3230,732],{"class":708},[698,3232,3233],{"class":700,"line":794},[698,3234,798],{"emptyLinePlaceholder":797},[698,3236,3237,3239,3241,3243,3245,3247,3249,3251],{"class":700,"line":801},[698,3238,847],{"class":704},[698,3240,850],{"class":804},[698,3242,1629],{"class":808},[698,3244,1497],{"class":804},[698,3246,3175],{"class":808},[698,3248,856],{"class":804},[698,3250,3170],{"class":808},[698,3252,812],{"class":708},[698,3254,3255,3257,3259,3261,3264,3266,3268,3270],{"class":700,"line":815},[698,3256,905],{"class":804},[698,3258,908],{"class":804},[698,3260,911],{"class":708},[698,3262,3263],{"class":920},"database",[698,3265,825],{"class":708},[698,3267,1563],{"class":808},[698,3269,928],{"class":708},[698,3271,812],{"class":708},[698,3273,3274,3277,3279,3281,3283,3285,3287],{"class":700,"line":833},[698,3275,3276],{"class":712},"    super",[698,3278,911],{"class":821},[698,3280,3263],{"class":712},[698,3282,748],{"class":708},[698,3284,3217],{"class":712},[698,3286,928],{"class":821},[698,3288,732],{"class":708},[698,3290,3291],{"class":700,"line":839},[698,3292,1383],{"class":708},[698,3294,3295],{"class":700,"line":844},[698,3296,836],{"class":708},[499,3298,3299,3300,3302,3303,3306,3307,3309,3310,3312],{},"Both ",[503,3301,1432],{}," and ",[503,3304,3305],{},"implements"," are required: ",[503,3308,1432],{}," provides the implementation; ",[503,3311,3305],{}," makes the\nclass satisfy the abstract token the engine injects.",[499,3314,3315,3316,3319,3320,3323,3324,3327,3328,3331,3332,3335,3336,3338,3339,1031],{},"The other two stores follow the identical shape — ",[503,3317,3318],{},"AppWorkflowInstanceStore extends DrizzleWorkflowInstanceStore implements WorkflowInstanceStore"," over ",[503,3321,3322],{},"workflowInstances",", and ",[503,3325,3326],{},"AppDurableTimerStore extends DrizzleDurableTimerStore implements DurableTimerStore"," (from ",[503,3329,3330],{},"@heximon\u002Fsaga",") over ",[503,3333,3334],{},"durableTimers"," — each\nconstructor just forwards ",[503,3337,3263],{}," and its table to ",[503,3340,3341],{},"super()",[499,3343,3344],{},"There's no framework-shipped migration for these three tables — generate one from the schema above with\ndrizzle-kit, the same as your domain tables.",[543,3346,3348],{"id":3347},"testing-on-node","Testing on Node",[499,3350,3351,3352,1868,3355,3358,3359,3362,3363,3366,3367,3370,3371,3374],{},"Use ",[503,3353,3354],{},"eagerInit: true",[503,3356,3357],{},"createTestApp"," so ",[503,3360,3361],{},"Database.onInit"," runs (creating the three tables) before the test\nbody. After booting, call ",[503,3364,3365],{},"engine.ready()"," to warm the engine's timer collaborators before the first ",[503,3368,3369],{},"step.sleep","\narm, then drive one ",[503,3372,3373],{},"engine.pollOnce()"," tick to fire the wakeup after the deadline has elapsed.",[499,3376,3377,3378,3380],{},"This is trimmed from the flagship monolith's durable-execution e2e suite, which drives the same workflow over\nreal HTTP against its ",[503,3379,2023],{}," routes:",[688,3382,3385],{"className":690,"code":3383,"filename":3384,"language":693,"meta":694,"style":694},"import { type TestClient, createTestClient } from \"@heximon\u002Fhttp\u002Ftesting\";\nimport { type TestApp, createTestApp } from \"@heximon\u002Ftesting\";\nimport { NodeWorkflowEngine } from \"@heximon\u002Fworkflow\u002Fnode\";\nimport { dirname, join } from \"pathe\";\nimport { fileURLToPath } from \"node:url\";\nimport { afterAll, beforeAll, describe, expect, test } from \"vitest\";\nimport heximonConfig from \"..\u002Fheximon.config\";\nimport { FulfillmentLog, OrderPaymentDeadline, SagaCompensationLog } from \"@ticketing\u002Fapp\";\n\nconst root = join(dirname(fileURLToPath(import.meta.url)), \"..\");\n\ndescribe.sequential(\"flagship monolith — durable execution (workflow replay + saga timeout)\", () => {\n  let app: TestApp;\n  let client: TestClient;\n  let engine: NodeWorkflowEngine;\n  let fulfillmentLog: FulfillmentLog;\n\n  beforeAll(async () => {\n    \u002F\u002F …\n    app = await createTestApp({\n      root,\n      plugins: heximonConfig.plugins,\n      eagerInit: true,\n    });\n    client = createTestClient(app);\n    engine = await app.get(NodeWorkflowEngine);\n    fulfillmentLog = await app.get(FulfillmentLog);\n\n    \u002F\u002F Warm both pollers' lazily-resolved collaborators (so a synchronous `arm` registers its commit hook), then\n    \u002F\u002F STOP their background Cron loops — every firing below is driven deterministically via `pollOnce()`.\n    await engine.ready();\n    engine.onShutdown();\n  });\n\n  afterAll(async () => {\n    await app[Symbol.asyncDispose]();\n  });\n\n  \u002F** Issue a request against the booted in-process server. *\u002F\n  const request = (method: string, path: string, body?: unknown): Promise\u003CResponse> =>\n    client.request(\n      new Request(`http:\u002F\u002Ftest${path}`, {\n        method,\n        ...(body === undefined\n          ? {}\n          : { headers: { \"content-type\": \"application\u002Fjson\" }, body: JSON.stringify(body) }),\n      }),\n    );\n\n  test(\"a fulfillment workflow suspends at its sleep, then resumes — replaying the memoized step\", async () => {\n    \u002F\u002F Start the workflow over HTTP: `reserve-seats` runs (recorded), the run suspends at `sleep(\"settle\")`, and\n    \u002F\u002F the create returns 201 with the instance `running`.\n    const startResponse = await request(\"POST\", \"\u002Ffulfillment\", { orderId: \"order-1\" });\n\n    expect(startResponse.status).toBe(201);\n\n    const started = (await startResponse.json()) as { id: string; status: string };\n\n    expect(started.status).toBe(\"running\");\n    expect(fulfillmentLog.events).toEqual([\"reserve:order-1\"]);\n\n    \u002F\u002F Advance past the (short) sleep deadline, then drive ONE poll tick: the engine claims the now-due wakeup and\n    \u002F\u002F re-enters `run()` from the top — `reserve-seats` is a memoization HIT (NOT re-run), then `issue-tickets` and\n    \u002F\u002F `send-confirmation` run once each and the instance completes.\n    await new Promise((resolve) => setTimeout(resolve, 80));\n    await engine.pollOnce();\n\n    expect(fulfillmentLog.events).toEqual([\"reserve:order-1\", \"issue:order-1\", \"confirm:order-1\"]);\n\n    const final = (await (await request(\"GET\", `\u002Ffulfillment\u002F${started.id}`)).json()) as {\n      status: string;\n      output?: unknown;\n    };\n\n    expect(final.status).toBe(\"complete\");\n    expect(final.output).toEqual({ orderId: \"order-1\", reservation: \"reservation:order-1\" });\n  });\n\n  \u002F\u002F …\n});\n","examples\u002Fflagship\u002Fapps\u002Fmonolith\u002Ftest\u002Fmonolith.durable.e2e.test.ts",[503,3386,3387,3416,3445,3466,3493,3515,3557,3576,3607,3611,3660,3664,3691,3705,3718,3731,3744,3748,3764,3770,3785,3792,3809,3822,3830,3848,3871,3895,3899,3904,3909,3924,3937,3946,3950,3965,3987,3995,3999,4004,4055,4065,4091,4099,4115,4123,4181,4191,4199,4204,4229,4235,4241,4293,4298,4329,4334,4376,4381,4414,4451,4456,4462,4468,4474,4510,4526,4531,4580,4585,4643,4654,4666,4671,4676,4709,4761,4770,4775,4781],{"__ignoreMap":694},[698,3388,3389,3391,3393,3395,3398,3400,3403,3405,3407,3409,3412,3414],{"class":700,"line":701},[698,3390,705],{"class":704},[698,3392,709],{"class":708},[698,3394,740],{"class":704},[698,3396,3397],{"class":712}," TestClient",[698,3399,748],{"class":708},[698,3401,3402],{"class":712}," createTestClient",[698,3404,716],{"class":708},[698,3406,719],{"class":704},[698,3408,722],{"class":708},[698,3410,3411],{"class":725},"@heximon\u002Fhttp\u002Ftesting",[698,3413,729],{"class":708},[698,3415,732],{"class":708},[698,3417,3418,3420,3422,3424,3427,3429,3432,3434,3436,3438,3441,3443],{"class":700,"line":735},[698,3419,705],{"class":704},[698,3421,709],{"class":708},[698,3423,740],{"class":704},[698,3425,3426],{"class":712}," TestApp",[698,3428,748],{"class":708},[698,3430,3431],{"class":712}," createTestApp",[698,3433,716],{"class":708},[698,3435,719],{"class":704},[698,3437,722],{"class":708},[698,3439,3440],{"class":725},"@heximon\u002Ftesting",[698,3442,729],{"class":708},[698,3444,732],{"class":708},[698,3446,3447,3449,3451,3454,3456,3458,3460,3462,3464],{"class":700,"line":771},[698,3448,705],{"class":704},[698,3450,709],{"class":708},[698,3452,3453],{"class":712}," NodeWorkflowEngine",[698,3455,716],{"class":708},[698,3457,719],{"class":704},[698,3459,722],{"class":708},[698,3461,2801],{"class":725},[698,3463,729],{"class":708},[698,3465,732],{"class":708},[698,3467,3468,3470,3472,3475,3477,3480,3482,3484,3486,3489,3491],{"class":700,"line":794},[698,3469,705],{"class":704},[698,3471,709],{"class":708},[698,3473,3474],{"class":712}," dirname",[698,3476,748],{"class":708},[698,3478,3479],{"class":712}," join",[698,3481,716],{"class":708},[698,3483,719],{"class":704},[698,3485,722],{"class":708},[698,3487,3488],{"class":725},"pathe",[698,3490,729],{"class":708},[698,3492,732],{"class":708},[698,3494,3495,3497,3499,3502,3504,3506,3508,3511,3513],{"class":700,"line":801},[698,3496,705],{"class":704},[698,3498,709],{"class":708},[698,3500,3501],{"class":712}," fileURLToPath",[698,3503,716],{"class":708},[698,3505,719],{"class":704},[698,3507,722],{"class":708},[698,3509,3510],{"class":725},"node:url",[698,3512,729],{"class":708},[698,3514,732],{"class":708},[698,3516,3517,3519,3521,3524,3526,3529,3531,3534,3536,3539,3541,3544,3546,3548,3550,3553,3555],{"class":700,"line":815},[698,3518,705],{"class":704},[698,3520,709],{"class":708},[698,3522,3523],{"class":712}," afterAll",[698,3525,748],{"class":708},[698,3527,3528],{"class":712}," beforeAll",[698,3530,748],{"class":708},[698,3532,3533],{"class":712}," describe",[698,3535,748],{"class":708},[698,3537,3538],{"class":712}," expect",[698,3540,748],{"class":708},[698,3542,3543],{"class":712}," test",[698,3545,716],{"class":708},[698,3547,719],{"class":704},[698,3549,722],{"class":708},[698,3551,3552],{"class":725},"vitest",[698,3554,729],{"class":708},[698,3556,732],{"class":708},[698,3558,3559,3561,3564,3567,3569,3572,3574],{"class":700,"line":833},[698,3560,705],{"class":704},[698,3562,3563],{"class":712}," heximonConfig ",[698,3565,3566],{"class":704},"from",[698,3568,722],{"class":708},[698,3570,3571],{"class":725},"..\u002Fheximon.config",[698,3573,729],{"class":708},[698,3575,732],{"class":708},[698,3577,3578,3580,3582,3584,3586,3589,3591,3594,3596,3598,3600,3603,3605],{"class":700,"line":839},[698,3579,705],{"class":704},[698,3581,709],{"class":708},[698,3583,778],{"class":712},[698,3585,748],{"class":708},[698,3587,3588],{"class":712}," OrderPaymentDeadline",[698,3590,748],{"class":708},[698,3592,3593],{"class":712}," SagaCompensationLog",[698,3595,716],{"class":708},[698,3597,719],{"class":704},[698,3599,722],{"class":708},[698,3601,3602],{"class":725},"@ticketing\u002Fapp",[698,3604,729],{"class":708},[698,3606,732],{"class":708},[698,3608,3609],{"class":700,"line":844},[698,3610,798],{"emptyLinePlaceholder":797},[698,3612,3613,3616,3619,3621,3623,3625,3628,3630,3633,3635,3637,3639,3642,3644,3647,3649,3651,3654,3656,3658],{"class":700,"line":864},[698,3614,3615],{"class":804},"const",[698,3617,3618],{"class":712}," root ",[698,3620,2871],{"class":708},[698,3622,3479],{"class":1066},[698,3624,911],{"class":712},[698,3626,3627],{"class":1066},"dirname",[698,3629,911],{"class":712},[698,3631,3632],{"class":1066},"fileURLToPath",[698,3634,911],{"class":712},[698,3636,705],{"class":704},[698,3638,1031],{"class":708},[698,3640,3641],{"class":712},"meta",[698,3643,1031],{"class":708},[698,3645,3646],{"class":712},"url))",[698,3648,748],{"class":708},[698,3650,722],{"class":708},[698,3652,3653],{"class":725},"..",[698,3655,729],{"class":708},[698,3657,928],{"class":712},[698,3659,732],{"class":708},[698,3661,3662],{"class":700,"line":873},[698,3663,798],{"emptyLinePlaceholder":797},[698,3665,3666,3669,3671,3674,3676,3678,3681,3683,3685,3687,3689],{"class":700,"line":894},[698,3667,3668],{"class":712},"describe",[698,3670,1031],{"class":708},[698,3672,3673],{"class":1066},"sequential",[698,3675,911],{"class":712},[698,3677,729],{"class":708},[698,3679,3680],{"class":725},"flagship monolith — durable execution (workflow replay + saga timeout)",[698,3682,729],{"class":708},[698,3684,748],{"class":708},[698,3686,1083],{"class":708},[698,3688,1086],{"class":804},[698,3690,812],{"class":708},[698,3692,3693,3696,3699,3701,3703],{"class":700,"line":902},[698,3694,3695],{"class":804},"  let",[698,3697,3698],{"class":712}," app",[698,3700,825],{"class":708},[698,3702,3426],{"class":808},[698,3704,732],{"class":708},[698,3706,3707,3709,3712,3714,3716],{"class":700,"line":934},[698,3708,3695],{"class":804},[698,3710,3711],{"class":712}," client",[698,3713,825],{"class":708},[698,3715,3397],{"class":808},[698,3717,732],{"class":708},[698,3719,3720,3722,3725,3727,3729],{"class":700,"line":939},[698,3721,3695],{"class":804},[698,3723,3724],{"class":712}," engine",[698,3726,825],{"class":708},[698,3728,3453],{"class":808},[698,3730,732],{"class":708},[698,3732,3733,3735,3738,3740,3742],{"class":700,"line":953},[698,3734,3695],{"class":804},[698,3736,3737],{"class":712}," fulfillmentLog",[698,3739,825],{"class":708},[698,3741,778],{"class":808},[698,3743,732],{"class":708},[698,3745,3746],{"class":700,"line":972},[698,3747,798],{"emptyLinePlaceholder":797},[698,3749,3750,3753,3755,3758,3760,3762],{"class":700,"line":984},[698,3751,3752],{"class":1066},"  beforeAll",[698,3754,911],{"class":821},[698,3756,3757],{"class":804},"async",[698,3759,1083],{"class":708},[698,3761,1086],{"class":804},[698,3763,812],{"class":708},[698,3765,3766],{"class":700,"line":1017},[698,3767,3769],{"class":3768},"sHwdD","    \u002F\u002F …\n",[698,3771,3772,3775,3777,3779,3781,3783],{"class":700,"line":1044},[698,3773,3774],{"class":712},"    app",[698,3776,1025],{"class":708},[698,3778,1058],{"class":704},[698,3780,3431],{"class":1066},[698,3782,911],{"class":821},[698,3784,1749],{"class":708},[698,3786,3787,3790],{"class":700,"line":1049},[698,3788,3789],{"class":712},"      root",[698,3791,870],{"class":708},[698,3793,3794,3797,3799,3802,3804,3807],{"class":700,"line":1091},[698,3795,3796],{"class":821},"      plugins",[698,3798,825],{"class":708},[698,3800,3801],{"class":712}," heximonConfig",[698,3803,1031],{"class":708},[698,3805,3806],{"class":712},"plugins",[698,3808,870],{"class":708},[698,3810,3811,3814,3816,3820],{"class":700,"line":1125},[698,3812,3813],{"class":821},"      eagerInit",[698,3815,825],{"class":708},[698,3817,3819],{"class":3818},"sfNiH"," true",[698,3821,870],{"class":708},[698,3823,3824,3826,3828],{"class":700,"line":1130},[698,3825,1153],{"class":708},[698,3827,928],{"class":821},[698,3829,732],{"class":708},[698,3831,3832,3835,3837,3839,3841,3844,3846],{"class":700,"line":1150},[698,3833,3834],{"class":712},"    client",[698,3836,1025],{"class":708},[698,3838,3402],{"class":1066},[698,3840,911],{"class":821},[698,3842,3843],{"class":712},"app",[698,3845,928],{"class":821},[698,3847,732],{"class":708},[698,3849,3850,3853,3855,3857,3859,3861,3863,3865,3867,3869],{"class":700,"line":1160},[698,3851,3852],{"class":712},"    engine",[698,3854,1025],{"class":708},[698,3856,1058],{"class":704},[698,3858,3698],{"class":712},[698,3860,1031],{"class":708},[698,3862,2019],{"class":1066},[698,3864,911],{"class":821},[698,3866,540],{"class":712},[698,3868,928],{"class":821},[698,3870,732],{"class":708},[698,3872,3873,3876,3878,3880,3882,3884,3886,3888,3891,3893],{"class":700,"line":1165},[698,3874,3875],{"class":712},"    fulfillmentLog",[698,3877,1025],{"class":708},[698,3879,1058],{"class":704},[698,3881,3698],{"class":712},[698,3883,1031],{"class":708},[698,3885,2019],{"class":1066},[698,3887,911],{"class":821},[698,3889,3890],{"class":712},"FulfillmentLog",[698,3892,928],{"class":821},[698,3894,732],{"class":708},[698,3896,3897],{"class":700,"line":1214},[698,3898,798],{"emptyLinePlaceholder":797},[698,3900,3901],{"class":700,"line":1219},[698,3902,3903],{"class":3768},"    \u002F\u002F Warm both pollers' lazily-resolved collaborators (so a synchronous `arm` registers its commit hook), then\n",[698,3905,3906],{"class":700,"line":1249},[698,3907,3908],{"class":3768},"    \u002F\u002F STOP their background Cron loops — every firing below is driven deterministically via `pollOnce()`.\n",[698,3910,3911,3913,3915,3917,3920,3922],{"class":700,"line":1277},[698,3912,1168],{"class":704},[698,3914,3724],{"class":712},[698,3916,1031],{"class":708},[698,3918,3919],{"class":1066},"ready",[698,3921,1986],{"class":821},[698,3923,732],{"class":708},[698,3925,3926,3928,3930,3933,3935],{"class":700,"line":1286},[698,3927,3852],{"class":712},[698,3929,1031],{"class":708},[698,3931,3932],{"class":1066},"onShutdown",[698,3934,1986],{"class":821},[698,3936,732],{"class":708},[698,3938,3939,3942,3944],{"class":700,"line":1291},[698,3940,3941],{"class":708},"  }",[698,3943,928],{"class":821},[698,3945,732],{"class":708},[698,3947,3948],{"class":700,"line":1321},[698,3949,798],{"emptyLinePlaceholder":797},[698,3951,3952,3955,3957,3959,3961,3963],{"class":700,"line":1349},[698,3953,3954],{"class":1066},"  afterAll",[698,3956,911],{"class":821},[698,3958,3757],{"class":804},[698,3960,1083],{"class":708},[698,3962,1086],{"class":804},[698,3964,812],{"class":708},[698,3966,3967,3969,3971,3974,3977,3979,3982,3985],{"class":700,"line":1358},[698,3968,1168],{"class":704},[698,3970,3698],{"class":712},[698,3972,3973],{"class":821},"[",[698,3975,3976],{"class":712},"Symbol",[698,3978,1031],{"class":708},[698,3980,3981],{"class":712},"asyncDispose",[698,3983,3984],{"class":821},"]()",[698,3986,732],{"class":708},[698,3988,3989,3991,3993],{"class":700,"line":1363},[698,3990,3941],{"class":708},[698,3992,928],{"class":821},[698,3994,732],{"class":708},[698,3996,3997],{"class":700,"line":1380},[698,3998,798],{"emptyLinePlaceholder":797},[698,4000,4001],{"class":700,"line":1386},[698,4002,4003],{"class":3768},"  \u002F** Issue a request against the booted in-process server. *\u002F\n",[698,4005,4006,4009,4012,4014,4016,4019,4021,4023,4025,4028,4030,4032,4034,4036,4038,4040,4043,4045,4047,4050,4052],{"class":700,"line":2721},[698,4007,4008],{"class":804},"  const",[698,4010,4011],{"class":712}," request",[698,4013,1025],{"class":708},[698,4015,2379],{"class":708},[698,4017,4018],{"class":920},"method",[698,4020,825],{"class":708},[698,4022,828],{"class":808},[698,4024,748],{"class":708},[698,4026,4027],{"class":920}," path",[698,4029,825],{"class":708},[698,4031,828],{"class":808},[698,4033,748],{"class":708},[698,4035,2592],{"class":920},[698,4037,2197],{"class":708},[698,4039,2200],{"class":808},[698,4041,4042],{"class":708},"):",[698,4044,990],{"class":808},[698,4046,963],{"class":708},[698,4048,4049],{"class":808},"Response",[698,4051,897],{"class":708},[698,4053,4054],{"class":804}," =>\n",[698,4056,4057,4059,4061,4063],{"class":700,"line":2752},[698,4058,3834],{"class":712},[698,4060,1031],{"class":708},[698,4062,2332],{"class":1066},[698,4064,950],{"class":821},[698,4066,4067,4070,4073,4075,4077,4080,4082,4085,4087,4089],{"class":700,"line":2757},[698,4068,4069],{"class":708},"      new",[698,4071,4072],{"class":1066}," Request",[698,4074,911],{"class":821},[698,4076,1107],{"class":708},[698,4078,4079],{"class":725},"http:\u002F\u002Ftest",[698,4081,1113],{"class":708},[698,4083,4084],{"class":712},"path",[698,4086,1118],{"class":708},[698,4088,748],{"class":708},[698,4090,812],{"class":708},[698,4092,4094,4097],{"class":700,"line":4093},43,[698,4095,4096],{"class":712},"        method",[698,4098,870],{"class":708},[698,4100,4102,4105,4107,4110,4112],{"class":700,"line":4101},44,[698,4103,4104],{"class":708},"        ...",[698,4106,911],{"class":821},[698,4108,4109],{"class":712},"body",[698,4111,2388],{"class":708},[698,4113,4114],{"class":708}," undefined\n",[698,4116,4118,4121],{"class":700,"line":4117},45,[698,4119,4120],{"class":708},"          ?",[698,4122,931],{"class":708},[698,4124,4126,4129,4131,4134,4136,4138,4140,4143,4145,4147,4149,4152,4154,4157,4159,4161,4164,4166,4169,4171,4173,4175,4177,4179],{"class":700,"line":4125},46,[698,4127,4128],{"class":708},"          :",[698,4130,709],{"class":708},[698,4132,4133],{"class":821}," headers",[698,4135,825],{"class":708},[698,4137,709],{"class":708},[698,4139,722],{"class":708},[698,4141,4142],{"class":821},"content-type",[698,4144,729],{"class":708},[698,4146,825],{"class":708},[698,4148,722],{"class":708},[698,4150,4151],{"class":725},"application\u002Fjson",[698,4153,729],{"class":708},[698,4155,4156],{"class":708}," },",[698,4158,2592],{"class":821},[698,4160,825],{"class":708},[698,4162,4163],{"class":712}," JSON",[698,4165,1031],{"class":708},[698,4167,4168],{"class":1066},"stringify",[698,4170,911],{"class":821},[698,4172,4109],{"class":712},[698,4174,1858],{"class":821},[698,4176,1855],{"class":708},[698,4178,928],{"class":821},[698,4180,870],{"class":708},[698,4182,4184,4187,4189],{"class":700,"line":4183},47,[698,4185,4186],{"class":708},"      }",[698,4188,928],{"class":821},[698,4190,870],{"class":708},[698,4192,4194,4197],{"class":700,"line":4193},48,[698,4195,4196],{"class":821},"    )",[698,4198,732],{"class":708},[698,4200,4202],{"class":700,"line":4201},49,[698,4203,798],{"emptyLinePlaceholder":797},[698,4205,4207,4210,4212,4214,4217,4219,4221,4223,4225,4227],{"class":700,"line":4206},50,[698,4208,4209],{"class":1066},"  test",[698,4211,911],{"class":821},[698,4213,729],{"class":708},[698,4215,4216],{"class":725},"a fulfillment workflow suspends at its sleep, then resumes — replaying the memoized step",[698,4218,729],{"class":708},[698,4220,748],{"class":708},[698,4222,944],{"class":804},[698,4224,1083],{"class":708},[698,4226,1086],{"class":804},[698,4228,812],{"class":708},[698,4230,4232],{"class":700,"line":4231},51,[698,4233,4234],{"class":3768},"    \u002F\u002F Start the workflow over HTTP: `reserve-seats` runs (recorded), the run suspends at `sleep(\"settle\")`, and\n",[698,4236,4238],{"class":700,"line":4237},52,[698,4239,4240],{"class":3768},"    \u002F\u002F the create returns 201 with the instance `running`.\n",[698,4242,4244,4246,4249,4251,4253,4255,4257,4259,4262,4264,4266,4268,4270,4272,4274,4276,4278,4280,4282,4285,4287,4289,4291],{"class":700,"line":4243},53,[698,4245,1020],{"class":804},[698,4247,4248],{"class":712}," startResponse",[698,4250,1025],{"class":708},[698,4252,1058],{"class":704},[698,4254,4011],{"class":1066},[698,4256,911],{"class":821},[698,4258,729],{"class":708},[698,4260,4261],{"class":725},"POST",[698,4263,729],{"class":708},[698,4265,748],{"class":708},[698,4267,722],{"class":708},[698,4269,2023],{"class":725},[698,4271,729],{"class":708},[698,4273,748],{"class":708},[698,4275,709],{"class":708},[698,4277,822],{"class":821},[698,4279,825],{"class":708},[698,4281,722],{"class":708},[698,4283,4284],{"class":725},"order-1",[698,4286,729],{"class":708},[698,4288,716],{"class":708},[698,4290,928],{"class":821},[698,4292,732],{"class":708},[698,4294,4296],{"class":700,"line":4295},54,[698,4297,798],{"emptyLinePlaceholder":797},[698,4299,4301,4304,4306,4309,4311,4313,4315,4317,4320,4322,4325,4327],{"class":700,"line":4300},55,[698,4302,4303],{"class":1066},"    expect",[698,4305,911],{"class":821},[698,4307,4308],{"class":712},"startResponse",[698,4310,1031],{"class":708},[698,4312,2363],{"class":712},[698,4314,928],{"class":821},[698,4316,1031],{"class":708},[698,4318,4319],{"class":1066},"toBe",[698,4321,911],{"class":821},[698,4323,4324],{"class":1196},"201",[698,4326,928],{"class":821},[698,4328,732],{"class":708},[698,4330,4332],{"class":700,"line":4331},56,[698,4333,798],{"emptyLinePlaceholder":797},[698,4335,4337,4339,4342,4344,4346,4348,4350,4352,4354,4356,4358,4360,4362,4364,4366,4368,4370,4372,4374],{"class":700,"line":4336},57,[698,4338,1020],{"class":804},[698,4340,4341],{"class":712}," started",[698,4343,1025],{"class":708},[698,4345,2379],{"class":821},[698,4347,2599],{"class":704},[698,4349,4248],{"class":712},[698,4351,1031],{"class":708},[698,4353,2611],{"class":1066},[698,4355,2614],{"class":821},[698,4357,2617],{"class":704},[698,4359,709],{"class":708},[698,4361,2168],{"class":821},[698,4363,825],{"class":708},[698,4365,828],{"class":808},[698,4367,1002],{"class":708},[698,4369,2181],{"class":821},[698,4371,825],{"class":708},[698,4373,828],{"class":808},[698,4375,1377],{"class":708},[698,4377,4379],{"class":700,"line":4378},58,[698,4380,798],{"emptyLinePlaceholder":797},[698,4382,4384,4386,4388,4391,4393,4395,4397,4399,4401,4403,4405,4408,4410,4412],{"class":700,"line":4383},59,[698,4385,4303],{"class":1066},[698,4387,911],{"class":821},[698,4389,4390],{"class":712},"started",[698,4392,1031],{"class":708},[698,4394,2363],{"class":712},[698,4396,928],{"class":821},[698,4398,1031],{"class":708},[698,4400,4319],{"class":1066},[698,4402,911],{"class":821},[698,4404,729],{"class":708},[698,4406,4407],{"class":725},"running",[698,4409,729],{"class":708},[698,4411,928],{"class":821},[698,4413,732],{"class":708},[698,4415,4417,4419,4421,4424,4426,4429,4431,4433,4436,4439,4441,4444,4446,4449],{"class":700,"line":4416},60,[698,4418,4303],{"class":1066},[698,4420,911],{"class":821},[698,4422,4423],{"class":712},"fulfillmentLog",[698,4425,1031],{"class":708},[698,4427,4428],{"class":712},"events",[698,4430,928],{"class":821},[698,4432,1031],{"class":708},[698,4434,4435],{"class":1066},"toEqual",[698,4437,4438],{"class":821},"([",[698,4440,729],{"class":708},[698,4442,4443],{"class":725},"reserve:order-1",[698,4445,729],{"class":708},[698,4447,4448],{"class":821},"])",[698,4450,732],{"class":708},[698,4452,4454],{"class":700,"line":4453},61,[698,4455,798],{"emptyLinePlaceholder":797},[698,4457,4459],{"class":700,"line":4458},62,[698,4460,4461],{"class":3768},"    \u002F\u002F Advance past the (short) sleep deadline, then drive ONE poll tick: the engine claims the now-due wakeup and\n",[698,4463,4465],{"class":700,"line":4464},63,[698,4466,4467],{"class":3768},"    \u002F\u002F re-enters `run()` from the top — `reserve-seats` is a memoization HIT (NOT re-run), then `issue-tickets` and\n",[698,4469,4471],{"class":700,"line":4470},64,[698,4472,4473],{"class":3768},"    \u002F\u002F `send-confirmation` run once each and the instance completes.\n",[698,4475,4477,4479,4481,4483,4485,4487,4490,4492,4494,4497,4499,4501,4503,4506,4508],{"class":700,"line":4476},65,[698,4478,1168],{"class":704},[698,4480,1189],{"class":708},[698,4482,990],{"class":808},[698,4484,911],{"class":821},[698,4486,911],{"class":708},[698,4488,4489],{"class":920},"resolve",[698,4491,928],{"class":708},[698,4493,1086],{"class":804},[698,4495,4496],{"class":1066}," setTimeout",[698,4498,911],{"class":821},[698,4500,4489],{"class":712},[698,4502,748],{"class":708},[698,4504,4505],{"class":1196}," 80",[698,4507,1209],{"class":821},[698,4509,732],{"class":708},[698,4511,4513,4515,4517,4519,4522,4524],{"class":700,"line":4512},66,[698,4514,1168],{"class":704},[698,4516,3724],{"class":712},[698,4518,1031],{"class":708},[698,4520,4521],{"class":1066},"pollOnce",[698,4523,1986],{"class":821},[698,4525,732],{"class":708},[698,4527,4529],{"class":700,"line":4528},67,[698,4530,798],{"emptyLinePlaceholder":797},[698,4532,4534,4536,4538,4540,4542,4544,4546,4548,4550,4552,4554,4556,4558,4560,4562,4565,4567,4569,4571,4574,4576,4578],{"class":700,"line":4533},68,[698,4535,4303],{"class":1066},[698,4537,911],{"class":821},[698,4539,4423],{"class":712},[698,4541,1031],{"class":708},[698,4543,4428],{"class":712},[698,4545,928],{"class":821},[698,4547,1031],{"class":708},[698,4549,4435],{"class":1066},[698,4551,4438],{"class":821},[698,4553,729],{"class":708},[698,4555,4443],{"class":725},[698,4557,729],{"class":708},[698,4559,748],{"class":708},[698,4561,722],{"class":708},[698,4563,4564],{"class":725},"issue:order-1",[698,4566,729],{"class":708},[698,4568,748],{"class":708},[698,4570,722],{"class":708},[698,4572,4573],{"class":725},"confirm:order-1",[698,4575,729],{"class":708},[698,4577,4448],{"class":821},[698,4579,732],{"class":708},[698,4581,4583],{"class":700,"line":4582},69,[698,4584,798],{"emptyLinePlaceholder":797},[698,4586,4588,4590,4593,4595,4597,4599,4601,4603,4605,4607,4609,4612,4614,4616,4618,4621,4623,4625,4627,4629,4631,4633,4635,4637,4639,4641],{"class":700,"line":4587},70,[698,4589,1020],{"class":804},[698,4591,4592],{"class":712}," final",[698,4594,1025],{"class":708},[698,4596,2379],{"class":821},[698,4598,2599],{"class":704},[698,4600,2379],{"class":821},[698,4602,2599],{"class":704},[698,4604,4011],{"class":1066},[698,4606,911],{"class":821},[698,4608,729],{"class":708},[698,4610,4611],{"class":725},"GET",[698,4613,729],{"class":708},[698,4615,748],{"class":708},[698,4617,1136],{"class":708},[698,4619,4620],{"class":725},"\u002Ffulfillment\u002F",[698,4622,1113],{"class":708},[698,4624,4390],{"class":712},[698,4626,1031],{"class":708},[698,4628,2342],{"class":712},[698,4630,1118],{"class":708},[698,4632,1209],{"class":821},[698,4634,1031],{"class":708},[698,4636,2611],{"class":1066},[698,4638,2614],{"class":821},[698,4640,2617],{"class":704},[698,4642,812],{"class":708},[698,4644,4646,4648,4650,4652],{"class":700,"line":4645},71,[698,4647,2477],{"class":821},[698,4649,825],{"class":708},[698,4651,828],{"class":808},[698,4653,732],{"class":708},[698,4655,4657,4660,4662,4664],{"class":700,"line":4656},72,[698,4658,4659],{"class":821},"      output",[698,4661,2197],{"class":708},[698,4663,2200],{"class":808},[698,4665,732],{"class":708},[698,4667,4669],{"class":700,"line":4668},73,[698,4670,2539],{"class":708},[698,4672,4674],{"class":700,"line":4673},74,[698,4675,798],{"emptyLinePlaceholder":797},[698,4677,4679,4681,4683,4686,4688,4690,4692,4694,4696,4698,4700,4703,4705,4707],{"class":700,"line":4678},75,[698,4680,4303],{"class":1066},[698,4682,911],{"class":821},[698,4684,4685],{"class":712},"final",[698,4687,1031],{"class":708},[698,4689,2363],{"class":712},[698,4691,928],{"class":821},[698,4693,1031],{"class":708},[698,4695,4319],{"class":1066},[698,4697,911],{"class":821},[698,4699,729],{"class":708},[698,4701,4702],{"class":725},"complete",[698,4704,729],{"class":708},[698,4706,928],{"class":821},[698,4708,732],{"class":708},[698,4710,4712,4714,4716,4718,4720,4722,4724,4726,4728,4730,4732,4734,4736,4738,4740,4742,4744,4746,4748,4750,4753,4755,4757,4759],{"class":700,"line":4711},76,[698,4713,4303],{"class":1066},[698,4715,911],{"class":821},[698,4717,4685],{"class":712},[698,4719,1031],{"class":708},[698,4721,2501],{"class":712},[698,4723,928],{"class":821},[698,4725,1031],{"class":708},[698,4727,4435],{"class":1066},[698,4729,911],{"class":821},[698,4731,2644],{"class":708},[698,4733,822],{"class":821},[698,4735,825],{"class":708},[698,4737,722],{"class":708},[698,4739,4284],{"class":725},[698,4741,729],{"class":708},[698,4743,748],{"class":708},[698,4745,1005],{"class":821},[698,4747,825],{"class":708},[698,4749,722],{"class":708},[698,4751,4752],{"class":725},"reservation:order-1",[698,4754,729],{"class":708},[698,4756,716],{"class":708},[698,4758,928],{"class":821},[698,4760,732],{"class":708},[698,4762,4764,4766,4768],{"class":700,"line":4763},77,[698,4765,3941],{"class":708},[698,4767,928],{"class":821},[698,4769,732],{"class":708},[698,4771,4773],{"class":700,"line":4772},78,[698,4774,798],{"emptyLinePlaceholder":797},[698,4776,4778],{"class":700,"line":4777},79,[698,4779,4780],{"class":3768},"  \u002F\u002F …\n",[698,4782,4784,4786,4788],{"class":700,"line":4783},80,[698,4785,1855],{"class":708},[698,4787,928],{"class":712},[698,4789,732],{"class":708},[499,4791,4792,4793,4796,4797,4799,4800,4802],{},"The suite also covers a ",[503,4794,4795],{},"GET \u002Ffulfillment\u002F\u003Cunknown-id>"," 404 and the sibling ",[503,4798,3330],{}," payment-deadline\ntimeout flow (elided above) — see the source file for the full suite. The two test seams on\n",[503,4801,540],{}," are:",[555,4804,4805,4813],{},[558,4806,4807,4809,4810,4812],{},[503,4808,3365],{}," — awaits collaborator resolution; call before the first ",[503,4811,3369],{}," arm in a test body.",[558,4814,4815,4817,4818,4820],{},[503,4816,3373],{}," — drives one poll tick: claims all now-due ",[503,4819,584],{}," rows, re-emits each on its\nresume channel, and fires the suspended run's replay. The same drain the engine's internal poller runs each\ntick.",[543,4822,4824],{"id":4823},"two-targets-one-run-body","Two targets, one run body",[499,4826,1391,4827,4829,4830,4833,4834,4836,4837,4840,4841,4844,4845,4847],{},[503,4828,1867],{}," is ",[534,4831,4832],{},"target-split at compile time"," — the compiler selects the host once per build, so\nthere is no runtime branch and no overhead. The ",[503,4835,588],{}," body and the ",[503,4838,4839],{},"WorkflowFactory"," injection are identical\non both targets; only the engine underneath differs. This page covers the ",[503,4842,4843],{},"node"," target, above, in full — the\nin-process ",[503,4846,540],{}," replay engine this page has been building toward.",[4849,4850,4852],"h3",{"id":4851},"on-cloudflare","On Cloudflare",[499,4854,4855,4856,4859,4860,4863,4864,4866,4867,4870],{},"Set ",[503,4857,4858],{},"platform: new CloudflareWorkersStrategy()"," and the same workflow compiles against the ",[534,4861,4862],{},"native"," Cloudflare\nWorkflows engine instead — no local database tables, no replay loop; Cloudflare owns memoization, sleep,\nretries, and hibernation. See ",[617,4865,307],{"href":308}," for the generated entrypoint bridge and the\n",[503,4868,4869],{},"workflow-bindings"," wrangler section.",[4849,4872,4874],{"id":4873},"on-vercel","On Vercel",[499,4876,4877,4878,4880,4881,4883,4884,4887],{},"Vercel Functions run the same ",[503,4879,540],{}," as a plain Node server, with one difference: the function\nfreezes between invocations, so ",[503,4882,3369],{}," can't rely on an in-process poller. See\n",[617,4885,312],{"href":4886},"\u002Fdocs\u002Fdeploy\u002Fvercel#durable-workflows-and-saga-timers"," for the freeze-safe drain cron and the\nopt-in queue-delay wakeup.",[543,4889,1391,4891,4894],{"id":4890},"the-stepdo-callback-contract",[503,4892,4893],{},"step.do"," callback contract",[499,4896,4897,4898,4900],{},"A ",[503,4899,4893],{}," callback runs exactly once and never re-runs on a replay. This means:",[555,4902,4903,4913,4920],{},[558,4904,4905,4906,4909,4910,4912],{},"Its return value must be ",[534,4907,4908],{},"JSON-serializable"," (it is persisted to the ",[503,4911,570],{}," table and\ndeserialized on a replay).",[558,4914,4915,4916,4919],{},"It must not have ",[534,4917,4918],{},"side effects that depend on not having run"," (sending an email, charging a card). The\ncallback runs only on a MISS; the persisted result is returned on every subsequent replay.",[558,4921,4897,4922,4925,4926,4929,4930,4933,4934,4937],{},[503,4923,4924],{},"FatalStepError"," thrown inside (or thrown by a callback that exhausted its ",[503,4927,4928],{},"options.retries"," limit) marks\nthe instance ",[503,4931,4932],{},"errored"," immediately — it is the Node counterpart of Cloudflare ",[503,4935,4936],{},"NonRetryableError"," and is\nnever retried.",[499,4939,4940],{},"Retry policy is per-step:",[688,4942,4944],{"className":690,"code":4943,"language":693,"meta":694,"style":694},"await step.do(\n  \"charge\",\n  { retries: { limit: 3, delay: new TimeSpan(5, \"s\"), backoff: \"exponential\" } },\n  async () => {\n    return this.payments.charge(event.payload.orderId);\n  },\n);\n",[503,4945,4946,4958,4968,5033,5044,5074,5079],{"__ignoreMap":694},[698,4947,4948,4950,4952,4954,4956],{"class":700,"line":701},[698,4949,2599],{"class":704},[698,4951,1061],{"class":712},[698,4953,1031],{"class":708},[698,4955,1067],{"class":1066},[698,4957,950],{"class":712},[698,4959,4960,4962,4964,4966],{"class":700,"line":735},[698,4961,2880],{"class":708},[698,4963,1234],{"class":725},[698,4965,729],{"class":708},[698,4967,870],{"class":708},[698,4969,4970,4972,4975,4977,4979,4982,4984,4987,4989,4992,4994,4996,4998,5000,5003,5005,5007,5010,5012,5014,5016,5019,5021,5023,5026,5028,5030],{"class":700,"line":771},[698,4971,876],{"class":708},[698,4973,4974],{"class":821}," retries",[698,4976,825],{"class":708},[698,4978,709],{"class":708},[698,4980,4981],{"class":821}," limit",[698,4983,825],{"class":708},[698,4985,4986],{"class":1196}," 3",[698,4988,748],{"class":708},[698,4990,4991],{"class":821}," delay",[698,4993,825],{"class":708},[698,4995,1189],{"class":708},[698,4997,713],{"class":1066},[698,4999,911],{"class":712},[698,5001,5002],{"class":1196},"5",[698,5004,748],{"class":708},[698,5006,722],{"class":708},[698,5008,5009],{"class":725},"s",[698,5011,729],{"class":708},[698,5013,928],{"class":712},[698,5015,748],{"class":708},[698,5017,5018],{"class":821}," backoff",[698,5020,825],{"class":708},[698,5022,722],{"class":708},[698,5024,5025],{"class":725},"exponential",[698,5027,729],{"class":708},[698,5029,716],{"class":708},[698,5031,5032],{"class":708}," },\n",[698,5034,5035,5038,5040,5042],{"class":700,"line":794},[698,5036,5037],{"class":804},"  async",[698,5039,1083],{"class":708},[698,5041,1086],{"class":804},[698,5043,812],{"class":708},[698,5045,5046,5048,5050,5053,5055,5057,5059,5062,5064,5066,5068,5070,5072],{"class":700,"line":801},[698,5047,1366],{"class":704},[698,5049,2316],{"class":708},[698,5051,5052],{"class":712},"payments",[698,5054,1031],{"class":708},[698,5056,1234],{"class":1066},[698,5058,911],{"class":821},[698,5060,5061],{"class":712},"event",[698,5063,1031],{"class":708},[698,5065,1034],{"class":712},[698,5067,1031],{"class":708},[698,5069,1039],{"class":712},[698,5071,928],{"class":821},[698,5073,732],{"class":708},[698,5075,5076],{"class":700,"line":815},[698,5077,5078],{"class":708},"  },\n",[698,5080,5081,5083],{"class":700,"line":833},[698,5082,928],{"class":712},[698,5084,732],{"class":708},[543,5086,5088,5091],{"id":5087},"suspendworkflow-is-an-engine-sentinel-do-not-swallow-it",[503,5089,5090],{},"SuspendWorkflow"," is an engine sentinel — do not swallow it",[499,5093,5094,5095,5097,5098,5100,5101,5103,5104,5107],{},"On the Node engine, ",[503,5096,3369],{}," throws a ",[503,5099,5090],{}," sentinel to unwind the call stack (Node cannot\ntruly suspend a running coroutine). The engine catches it at the run boundary and returns cleanly. If a workflow\nauthor wraps ",[503,5102,3369],{}," in a ",[503,5105,5106],{},"try\u002Fcatch"," that swallows every error, the sentinel is absorbed and the sleep is\nsilently lost. Always re-throw anything that is not a domain error:",[688,5109,5111],{"className":690,"code":5110,"language":693,"meta":694,"style":694},"try {\n  await step.sleep(\"settle\", new TimeSpan(2, \"d\"));\n} catch (error) {\n  if (!(error instanceof DomainError)) {\n    throw error; \u002F\u002F never swallow SuspendWorkflow\n  }\n}\n",[503,5112,5113,5120,5163,5175,5201,5214,5218],{"__ignoreMap":694},[698,5114,5115,5118],{"class":700,"line":701},[698,5116,5117],{"class":704},"try",[698,5119,812],{"class":708},[698,5121,5122,5125,5127,5129,5131,5133,5135,5137,5139,5141,5143,5145,5147,5150,5152,5154,5157,5159,5161],{"class":700,"line":735},[698,5123,5124],{"class":704},"  await",[698,5126,1061],{"class":712},[698,5128,1031],{"class":708},[698,5130,1175],{"class":1066},[698,5132,911],{"class":821},[698,5134,729],{"class":708},[698,5136,1182],{"class":725},[698,5138,729],{"class":708},[698,5140,748],{"class":708},[698,5142,1189],{"class":708},[698,5144,713],{"class":1066},[698,5146,911],{"class":821},[698,5148,5149],{"class":1196},"2",[698,5151,748],{"class":708},[698,5153,722],{"class":708},[698,5155,5156],{"class":725},"d",[698,5158,729],{"class":708},[698,5160,1209],{"class":821},[698,5162,732],{"class":708},[698,5164,5165,5167,5170,5173],{"class":700,"line":771},[698,5166,1855],{"class":708},[698,5168,5169],{"class":704}," catch",[698,5171,5172],{"class":712}," (error) ",[698,5174,1749],{"class":708},[698,5176,5177,5180,5182,5185,5187,5190,5193,5196,5199],{"class":700,"line":794},[698,5178,5179],{"class":704},"  if",[698,5181,2379],{"class":821},[698,5183,5184],{"class":708},"!",[698,5186,911],{"class":821},[698,5188,5189],{"class":712},"error",[698,5191,5192],{"class":708}," instanceof",[698,5194,5195],{"class":808}," DomainError",[698,5197,5198],{"class":821},")) ",[698,5200,1749],{"class":708},[698,5202,5203,5206,5209,5211],{"class":700,"line":801},[698,5204,5205],{"class":704},"    throw",[698,5207,5208],{"class":712}," error",[698,5210,1002],{"class":708},[698,5212,5213],{"class":3768}," \u002F\u002F never swallow SuspendWorkflow\n",[698,5215,5216],{"class":700,"line":815},[698,5217,1383],{"class":708},[698,5219,5220],{"class":700,"line":833},[698,5221,836],{"class":708},[543,5223,5225],{"id":5224},"when-to-use-a-workflow","When to use a workflow",[499,5227,5228,5229,5233],{},"See ",[617,5230,5232],{"href":5231},"\u002Fdocs\u002Farchitecture\u002Foverview#choreography-saga-or-workflow","Choreography, saga, or workflow"," for the\nfull decision table against choreography and sagas.",[499,5235,5236],{},"A workflow is the right choice when:",[555,5238,5239,5246,5262],{},[558,5240,5241,5242,5245],{},"You need to ",[534,5243,5244],{},"sleep for minutes, hours, or days"," between steps without holding a connection or a request\nthread.",[558,5247,5248,5249,2379,5252,1411,5255,1411,5258,5261],{},"You want ",[534,5250,5251],{},"per-step retry policy",[503,5253,5254],{},"limit",[503,5256,5257],{},"delay",[503,5259,5260],{},"backoff",") declared at the call site rather than in\nerror handlers.",[558,5263,5264,5265,5268,5269,627,5272,5275],{},"The flow is ",[534,5266,5267],{},"linear"," (charge → sleep → ship, not a branching FSM). For complex state machines with\ncompensations, a saga and its process-state aggregate give you the explicit ",[503,5270,5271],{},"cancel()",[503,5273,5274],{},"awaitPayment()","\ntransitions.",[499,5277,5278,5279,1411,5281,1411,5283,5285,5286,5288],{},"A workflow adds three database tables (",[503,5280,570],{},[503,5282,3005],{},[503,5284,584],{},") and a\nprocess-local polling timer. For flows where every step completes in the same request and you only need\nat-least-once delivery, the ",[617,5287,151],{"href":152}," tier is simpler.",[543,5290,5292],{"id":5291},"see-also","See also",[555,5294,5295,5305,5310,5318],{},[558,5296,5297,5299,5300,5302,5303,1031],{},[617,5298,248],{"href":249}," — durable one-shot deadlines and process-state aggregates; shares the ",[503,5301,584],{}," table with ",[503,5304,3369],{},[558,5306,5307,5309],{},[617,5308,151],{"href":152}," — the shared dispatch substrate the workflow resume wakeup rides.",[558,5311,5312,5317],{},[617,5313,5316],{"href":5314,"rel":5315},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fflagship\u002Fapps\u002Fvercel",[621],"The flagship Vercel app"," — a durable order-fulfillment workflow proving the suspend+resume replay on the Node engine and on Vercel Functions (queue-delay sleep).",[558,5319,5320,5325],{},[617,5321,5324],{"href":5322,"rel":5323},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fgap\u002Fsaga-orchestration",[621],"Saga orchestration"," — the saga sibling; when to use a saga instead.",[5327,5328,5329],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":694,"searchDepth":735,"depth":735,"links":5331},[5332,5333,5334,5335,5336,5337,5338,5339,5343,5345,5347,5348],{"id":545,"depth":735,"text":546},{"id":655,"depth":735,"text":656},{"id":1421,"depth":735,"text":1422},{"id":1511,"depth":735,"text":1512},{"id":2008,"depth":735,"text":2009},{"id":2762,"depth":735,"text":2763},{"id":3347,"depth":735,"text":3348},{"id":4823,"depth":735,"text":4824,"children":5340},[5341,5342],{"id":4851,"depth":771,"text":4852},{"id":4873,"depth":771,"text":4874},{"id":4890,"depth":735,"text":5344},"The step.do callback contract",{"id":5087,"depth":735,"text":5346},"SuspendWorkflow is an engine sentinel — do not swallow it",{"id":5224,"depth":735,"text":5225},{"id":5291,"depth":735,"text":5292},"Workflow, WorkflowFactory, WorkflowStep, NodeWorkflowEngine — a linear imperative procedure that memoizes each step and survives restarts, with step.do durable checkpoints and step.sleep durable suspend\u002Fresume.","md",null,{},{"icon":256},{"title":253,"description":5349},"Wd7tI-LvgZ5cAU3W33myshLAjIaivfRYzQOK3wAHzsw",[5357,5359],{"title":248,"path":249,"stem":250,"description":5358,"icon":251,"children":-1},"SagaTimer, TimeoutHandler, DurableTimer, DurableTimerStore, NodeDurableTimer, DrizzleDurableTimerStore, durableTimerColumns, SagaPlugin — durable one-shot deadlines that commit atomically with saga state.",{"title":142,"path":264,"stem":265,"description":5360,"icon":259,"children":-1},"Choosing between EventStream server-sent events and a WebSocketHandler socket, the opt-in typed layer over WebSocketContract and ServerSentEvents classes, and when Durable Objects earn their keep for cross-isolate broadcast.",1783300761903]