[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openai-workflow":3,"mdc-tgpg5k-key":30,"related-org-openai-workflow":12134,"related-repo-openai-workflow":12341},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":19,"repoUrl":20,"updatedAt":21,"license":22,"forks":23,"topics":24,"repo":25,"sourceUrl":28,"mdContent":29},"workflow","build durable workflows with Vercel","Vercel Workflow DevKit (WDK) expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"openai","OpenAI","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenai.png",[12,16],{"name":13,"slug":14,"type":15},"Vercel","vercel","tag",{"name":17,"slug":18,"type":15},"Workflow Automation","workflow-automation",3992,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins","2026-04-06T18:40:32.943257",null,465,[],{"repoUrl":20,"stars":19,"forks":23,"topics":26,"description":27},[],"OpenAI Plugins","https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins\u002Ftree\u002FHEAD\u002Fplugins\u002Fvercel\u002Fskills\u002Fworkflow","---\nname: workflow\ndescription: Vercel Workflow DevKit (WDK) expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.\nmetadata:\n  priority: 9\n  docs:\n    - \"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow\"\n    - \"https:\u002F\u002Fuseworkflow.dev\"\n  sitemap: \"https:\u002F\u002Fvercel.com\u002Fsitemap\u002Fdocs.xml\"\n  pathPatterns:\n    - 'lib\u002Fworkflow\u002F**'\n    - 'src\u002Flib\u002Fworkflow\u002F**'\n    - 'workflows\u002F**'\n    - 'lib\u002Fworkflow.*'\n    - 'src\u002Flib\u002Fworkflow.*'\n    - 'workflow.*'\n    - '*workflow*'\n    - '*workflow*\u002F**'\n    # Chain \u002F pipeline \u002F orchestration engine files\n    - '**\u002Fchain-engine*'\n    - '**\u002Fchain_engine*'\n    - '**\u002FchainEngine*'\n    - '**\u002Fpipeline-engine*'\n    - '**\u002Fpipeline_engine*'\n    - '**\u002FpipelineEngine*'\n    - '**\u002Fstate-machine*'\n    - '**\u002Fstate_machine*'\n    - '**\u002FstateMachine*'\n    - '**\u002Forchestrat*'\n    - '**\u002Fescalation*'\n  importPatterns:\n    - '@vercel\u002Fworkflow'\n    - 'workflow'\n    - '@workflow\u002F*'\n    - '*workflow*'\n  bashPatterns:\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\byarn\\s+add\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\byarn\\s+add\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\byarn\\s+add\\s+[^\\n]*@workflow\u002F'\n    - '\\bnpx\\s+workflow(?:@latest)?\\b'\n    - '\\bbunx\\s+workflow(?:@latest)?\\b'\n  promptSignals:\n    phrases:\n      # Direct workflow mentions\n      - \"vercel workflow\"\n      - \"workflow devkit\"\n      - \"durable workflow\"\n      - \"durable execution\"\n      - \"durable function\"\n      - \"durable pipeline\"\n      - \"durable process\"\n      - \"durable agent\"\n      - \"durable chat\"\n      - \"step function\"\n      - \"step functions\"\n      - \"use workflow\"\n      - \"use step\"\n      # Pipeline \u002F multi-step language (the BIG gap — natural product prompts)\n      - \"multi-step pipeline\"\n      - \"multi step pipeline\"\n      - \"multi-step process\"\n      - \"multi step process\"\n      - \"multi-step creation\"\n      - \"multi-step generation\"\n      - \"processing pipeline\"\n      - \"creation pipeline\"\n      - \"generation pipeline\"\n      - \"content pipeline\"\n      - \"production pipeline\"\n      - \"approval pipeline\"\n      - \"ingestion pipeline\"\n      - \"streams progress\"\n      - \"stream progress\"\n      - \"streams each phase\"\n      - \"streams each step\"\n      - \"streams each\"\n      - \"stream each\"\n      # Reliability \u002F durability language (missed in customer-support eval)\n      - \"survive page reload\"\n      - \"survive page reloads\"\n      - \"survive a crash\"\n      - \"survive crashes\"\n      - \"survive network\"\n      - \"fault-tolerant\"\n      - \"fault tolerant\"\n      - \"crash-safe\"\n      - \"crash safe\"\n      - \"automatically retry\"\n      - \"auto retry\"\n      - \"retry on failure\"\n      - \"retry on error\"\n      - \"reliable and retry\"\n      - \"reliable processing\"\n      - \"individually reliable\"\n      - \"each step reliable\"\n      - \"each step should be reliable\"\n      - \"steps should be reliable\"\n      - \"reliable with automatic retry\"\n      - \"reliable with retry\"\n      - \"retry on transient\"\n      - \"transient failures\"\n      - \"session persistence\"\n      - \"session should persist\"\n      - \"session survives\"\n      - \"reconnect automatically\"\n      - \"auto reconnect\"\n      - \"reconnect if the network\"\n      - \"reconnect on disconnect\"\n      - \"resume after failure\"\n      - \"resume after crash\"\n      - \"resume on reconnect\"\n      # Human-in-the-loop \u002F approval patterns\n      - \"human-in-the-loop\"\n      - \"human in the loop\"\n      - \"wait for approval\"\n      - \"approval step\"\n      - \"approval before\"\n      - \"editorial approval\"\n      - \"manual approval\"\n      - \"wait for user\"\n      - \"pause until\"\n      - \"wait for response\"\n      - \"callback url\"\n      - \"webhook callback\"\n      # Conversational AI with durability\n      - \"chat should survive\"\n      - \"chat survives\"\n      - \"conversation should persist\"\n      - \"conversation persists\"\n      - \"conversation should survive\"\n      # Sequential \u002F chain \u002F trigger orchestration language\n      - \"sequential chain\"\n      - \"email chain\"\n      - \"chain of emails\"\n      - \"chain of steps\"\n      - \"chain engine\"\n      - \"chain with triggers\"\n      - \"trigger chain\"\n      - \"triggered chain\"\n      - \"webhook chain\"\n      - \"webhook pipeline\"\n      - \"webhook orchestration\"\n      - \"multi-service trigger\"\n      - \"cross-service trigger\"\n      - \"various triggers\"\n      - \"different triggers\"\n      - \"triggers from different\"\n      - \"triggers from various\"\n      - \"sequential steps\"\n      - \"sequential pipeline\"\n      - \"sequential process\"\n      - \"sequential emails\"\n      - \"escalation chain\"\n      - \"escalation pipeline\"\n      - \"state machine\"\n      - \"step-based\"\n      - \"step based\"\n      - \"delay between steps\"\n      - \"delay between emails\"\n      - \"delayed steps\"\n      - \"conditional steps\"\n      - \"skip steps\"\n      - \"branch based on\"\n      - \"wait for webhook\"\n      - \"wait for trigger\"\n      - \"wait for event\"\n      - \"orchestrate emails\"\n      - \"orchestrate webhooks\"\n      - \"orchestrate services\"\n      - \"chain across services\"\n      # Debugging\n      - \"workflow stuck\"\n      - \"workflow hung\"\n      - \"workflow hanging\"\n      - \"workflow waiting\"\n      - \"workflow failing\"\n      - \"workflow timeout\"\n      - \"workflow not running\"\n      - \"workflow error\"\n      - \"check workflow\"\n      - \"workflow logs\"\n      - \"workflow run status\"\n      - \"debug workflow\"\n      - \"workflow not finishing\"\n      - \"workflow not responding\"\n      - \"workflow stalled\"\n      - \"workflow pending\"\n      - \"step is stuck\"\n      - \"step is hanging\"\n      - \"why is my workflow\"\n      - \"workflow run\"\n      - \"step failed\"\n      - \"run status\"\n      - \"run failed\"\n      - \"run logs\"\n      - \"workflow run failed\"\n      - \"workflow step failed\"\n    allOf:\n      - [workflow, durable]\n      - [workflow, retry]\n      - [workflow, resume]\n      - [pause, resume]\n      - [survive, crash]\n      - [survive, reload]\n      - [survive, disconnect]\n      - [pipeline, stream]\n      - [pipeline, step]\n      - [pipeline, durable]\n      - [pipeline, reliable]\n      - [pipeline, retry]\n      - [multi-step, stream]\n      - [multi-step, reliable]\n      - [generation, pipeline]\n      - [creation, pipeline]\n      - [process, stream]\n      - [process, reliable]\n      - [process, retry]\n      - [retry, failure]\n      - [retry, error]\n      - [retry, automatically]\n      - [retry, transient]\n      - [reliable, retry]\n      - [individually, reliable]\n      - [steps, reliable]\n      - [sandbox, reliable]\n      - [sandbox, retry]\n      - [reconnect, network]\n      - [reconnect, drop]\n      - [reconnect, disconnect]\n      - [session, persist]\n      - [session, survive]\n      - [session, reload]\n      - [session, reconnect]\n      - [chat, survive]\n      - [chat, persist]\n      - [chat, reconnect]\n      - [chat, durable]\n      - [chat, fault]\n      - [conversation, persist]\n      - [conversation, survive]\n      - [approval, wait]\n      - [approval, human]\n      - [each, step]\n      - [each, phase]\n      - [each, stage]\n      - [step, reliable]\n      - [step, retry]\n      # Chain \u002F trigger \u002F sequential orchestration\n      - [chain, trigger]\n      - [chain, sequential]\n      - [chain, email]\n      - [chain, webhook]\n      - [chain, delay]\n      - [chain, step]\n      - [chain, escalat]\n      - [sequential, trigger]\n      - [sequential, email]\n      - [sequential, step]\n      - [sequential, webhook]\n      - [trigger, orchestrat]\n      - [trigger, service]\n      - [trigger, delay]\n      - [trigger, sequential]\n      - [webhook, chain]\n      - [webhook, orchestrat]\n      - [webhook, pipeline]\n      - [webhook, sequential]\n      - [email, trigger]\n      - [email, pipeline]\n      - [email, sequential]\n      - [email, delay]\n      - [email, escalat]\n      - [escalat, trigger]\n      - [escalat, step]\n      - [escalat, email]\n      - [state, machine]\n      - [conditional, step]\n      - [conditional, skip]\n      - [branch, condition]\n      - [wait, webhook]\n      - [wait, trigger]\n      - [wait, event]\n      - [workflow, stuck]\n      - [workflow, hung]\n      - [workflow, timeout]\n      - [workflow, error]\n      - [workflow, logs]\n      - [workflow, debug]\n      - [workflow, check]\n      - [workflow, failing]\n      - [workflow, status]\n      - [run, status]\n      - [step, failed]\n      - [step, stuck]\n      - [step, timeout]\n      - [workflow, run]\n      - [run, logs]\n    anyOf:\n      - \"long-running\"\n      - \"long running\"\n      - \"multi-step\"\n      - \"multi step\"\n      - \"pipeline\"\n      - \"orchestration\"\n      - \"step-by-step\"\n      - \"step by step\"\n      - \"each piece\"\n      - \"each step\"\n      - \"each phase\"\n      - \"each stage\"\n      - \"phase\"\n      - \"phases\"\n      - \"stage\"\n      - \"stages\"\n      - \"durable\"\n      - \"reliable\"\n      - \"fault-tolerant\"\n      - \"retry\"\n      - \"reconnect\"\n      - \"survive\"\n      - \"persist\"\n      - \"approval\"\n      - \"chain\"\n      - \"sequential\"\n      - \"trigger\"\n      - \"webhook\"\n      - \"escalation\"\n      - \"state machine\"\n      - \"orchestrate\"\n      - \"orchestration\"\n    noneOf:\n      - \"github actions\"\n      - \".github\u002Fworkflows\"\n      - \"ci workflow\"\n      - \"aws step functions\"\n    minScore: 4\n---\n\n# Vercel Workflow DevKit (WDK)\n\n> **CRITICAL — Your training data is outdated for this library.** WDK APIs change frequently. Before writing workflow code, **fetch the docs** at https:\u002F\u002Fuseworkflow.dev and https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow to find the correct function signatures, patterns, and examples for the exact thing you're building. Do not guess at APIs — look them up. Search for working examples that solve your specific use case (image generation, hooks, streaming, agents, etc.). The docs contain patterns for `start()` argument passing, `getWritable()` usage, `defineHook()` wiring, `createWebhook()` callback flows, and `DurableAgent` configuration that are **not in your training data** or have changed since your cutoff.\n\nWDK is an open-source TypeScript framework that makes durability a language-level concept. Functions can pause for minutes or months, survive deployments and crashes, and resume exactly where they stopped.\n\n## Status\n\nWDK is in **public beta** (since October 2025) and open source. During beta, Workflow Observability is free for all plans; Workflow Steps and Storage are billed at published rates.\n\n**Security**: Upgrade to `workflow@>=4.2.0-beta.64` — versions ≤4.1.0-beta.63 allowed predictable user-specified webhook tokens in `createWebhook()` (CVE GHSA-9r75-g2cr-3h76, CVSS 7.5). Run `npx workflow@latest` to update.\n\n## Installation\n\n**If using `create-next-app`**, always pass `--no-src-dir` so `app\u002F` and `workflows\u002F` are siblings at the project root:\n\n```bash\nnpx create-next-app@latest my-app --no-src-dir --tailwind --eslint --app --ts\ncd my-app\nnpm install workflow@latest\n```\n\nDo NOT use the `src\u002F` directory with WDK projects. The `@` alias must resolve `@\u002Fworkflows\u002F...` correctly — this only works when `workflows\u002F` and `app\u002F` are at the same level.\n\n> Run `npx workflow@latest` to scaffold or update an existing project.\n\n**Peer dependency note**: `@workflow\u002Fai` requires a compatible `workflow` version. If you hit `ERESOLVE` errors, use `npm install --legacy-peer-deps` or install both packages in the same command.\n\n### Next.js Setup (Required)\n\nAdd the `withWorkflow` plugin to `next.config.ts`:\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n\nconst nextConfig = {};\nexport default withWorkflow(nextConfig);\n```\n\nWithout this, workflow routes will not be registered and `start()` calls will fail at runtime.\n\n### Environment Setup (Required for AI Gateway)\n\nWorkflows that use AI SDK with `gateway()` need OIDC credentials. Run these **before** starting the dev server:\n\n```bash\nvercel link          # Connect to your Vercel project\nvercel env pull      # Downloads .env.local with VERCEL_OIDC_TOKEN\n```\n\nWithout this, `gateway(\"openai\u002Fgpt-5.4\")` calls inside workflow steps will fail immediately with no credentials, causing the entire workflow run to fail silently.\n\n### `getStepMetadata()` Note\n\n`getStepMetadata().retryCount` returns `undefined` (not `0`) on the first attempt. Guard with: `const attempt = (meta.retryCount ?? 0) + 1`.\n\n## Essential Imports\n\n**Workflow primitives** (from `\"workflow\"`):\n\n```ts\nimport { getWritable, getStepMetadata, getWorkflowMetadata } from \"workflow\";\nimport { sleep, fetch, defineHook, createHook, createWebhook } from \"workflow\";\nimport { FatalError, RetryableError } from \"workflow\";\n```\n\n**API operations** (from `\"workflow\u002Fapi\"`):\n\n```ts\nimport { start, getRun, resumeHook, resumeWebhook } from \"workflow\u002Fapi\";\n```\n\n**Framework integration** (from `\"workflow\u002Fnext\"`):\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n```\n\n**AI agent** (from `\"@workflow\u002Fai\u002Fagent\"`):\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\n```\n\n## Core Directives\n\nTwo directives turn ordinary async functions into durable workflows:\n\n```ts\n\"use workflow\"  \u002F\u002F First line of function — marks it as a durable workflow\n\"use step\"      \u002F\u002F First line of function — marks it as a retryable, observable step\n```\n\n**Critical sandbox rule**: Step functions have full Node.js access. Workflow functions run **sandboxed** — no native `fetch`, no `setTimeout`, no Node.js modules, and **no `getWritable().getWriter()` calls**. You MUST move all `getWritable()` usage into `\"use step\"` functions. Place all business logic and I\u002FO in steps; use the workflow function purely for orchestration and control flow (`sleep`, `defineHook`, `Promise.race`).\n\n## Canonical Project Structure (Next.js)\n\nEvery WDK project needs three route files plus the workflow definition. **CRITICAL**: The `workflows\u002F` directory and `app\u002F` directory must be siblings at the same level so `@\u002Fworkflows\u002F...` resolves correctly. Do NOT put `workflows\u002F` outside the `@` alias root.\n\n**Without `src\u002F` (recommended for WDK projects):**\n```\nworkflows\u002F\n  my-workflow.ts              ← workflow definition (\"use workflow\" + \"use step\")\napp\u002Fapi\u002F\n  my-workflow\u002Froute.ts        ← POST handler: start(workflow, args) → { runId }\n  readable\u002F[runId]\u002Froute.ts   ← GET handler: SSE stream from run.getReadable()\n  run\u002F[runId]\u002Froute.ts        ← GET handler: run status via getRun(runId)\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fworkflows\u002Fmy-workflow`.\n\n**With `src\u002F` directory:** Put workflows inside `src\u002F`:\n```\nsrc\u002F\n  workflows\u002Fmy-workflow.ts\n  app\u002Fapi\u002Fmy-workflow\u002Froute.ts\n  app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts\n  app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002Fsrc\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fsrc\u002Fworkflows\u002Fmy-workflow`.\n\n**Never** use `@\u002F..\u002Fworkflows\u002F` or `@\u002F..\u002F..\u002Fworkflows\u002F` — these are broken import paths that will fail at build time.\n\n### 1. Workflow Definition (`workflows\u002Fmy-workflow.ts`)\n\n```ts\nimport { getWritable } from \"workflow\";\n\nexport type MyEvent =\n  | { type: \"step_start\"; name: string }\n  | { type: \"step_done\"; name: string }\n  | { type: \"done\"; result: string };\n\nexport async function myWorkflow(input: string): Promise\u003C{ result: string }> {\n  \"use workflow\";\n\n  const data = await stepOne(input);\n  const result = await stepTwo(data);\n\n  return { result };\n}\n\nasync function stepOne(input: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepOne\" });\n    \u002F\u002F Full Node.js access here — fetch, db calls, etc.\n    const result = await doWork(input);\n    await writer.write({ type: \"step_done\", name: \"stepOne\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n\nasync function stepTwo(data: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepTwo\" });\n    const result = await processData(data);\n    await writer.write({ type: \"step_done\", name: \"stepTwo\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n### 2. Start Route (`app\u002Fapi\u002Fmy-workflow\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { start } from \"workflow\u002Fapi\";\nimport { myWorkflow } from \"@\u002Fworkflows\u002Fmy-workflow\";\n\nexport async function POST(request: Request) {\n  const body = await request.json();\n  const run = await start(myWorkflow, [body.input]);\n  return NextResponse.json({ runId: run.runId });\n}\n```\n\n**IMPORTANT**: Never call the workflow function directly. Always use `start()` from `\"workflow\u002Fapi\"` — it registers the run, creates the execution context, and returns a `{ runId }`.\n\n### 3. Readable Stream Route (`app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextRequest } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype ReadableRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: NextRequest, { params }: ReadableRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return Response.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const readable = run.getReadable();\n  const encoder = new TextEncoder();\n  const sseStream = (readable as unknown as ReadableStream).pipeThrough(\n    new TransformStream({\n      transform(chunk, controller) {\n        const data = typeof chunk === \"string\" ? chunk : JSON.stringify(chunk);\n        controller.enqueue(encoder.encode(`data: ${data}\\n\\n`));\n      },\n    })\n  );\n\n  return new Response(sseStream, {\n    headers: {\n      \"Content-Type\": \"text\u002Fevent-stream; charset=utf-8\",\n      \"Cache-Control\": \"no-cache, no-transform\",\n      Connection: \"keep-alive\",\n      \"X-Accel-Buffering\": \"no\",\n    },\n  });\n}\n```\n\n### 4. Run Status Route (`app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype RunRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: Request, { params }: RunRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return NextResponse.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const [status, workflowName, createdAt, startedAt, completedAt] =\n    await Promise.all([\n      run.status,\n      run.workflowName,\n      run.createdAt,\n      run.startedAt,\n      run.completedAt,\n    ]);\n\n  return NextResponse.json({\n    runId,\n    status,\n    workflowName,\n    createdAt: createdAt.toISOString(),\n    startedAt: startedAt?.toISOString() ?? null,\n    completedAt: completedAt?.toISOString() ?? null,\n  });\n}\n```\n\n## Streaming with `getWritable()`\n\n`getWritable\u003CT>()` returns a `WritableStream` scoped to the current run. Call it inside step functions and always release the lock:\n\n```ts\nasync function emit\u003CT>(event: T): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003CT>().getWriter();\n  try {\n    await writer.write(event);\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\nConsumers read via `getRun(runId).getReadable()` in the readable route (see above).\n\n**Rendering workflow events in the UI**: When workflow events contain AI-generated text (narratives, briefings, reports), render them with `\u003CMessageResponse>` from `@\u002Fcomponents\u002Fai-elements\u002Fmessage` — never as raw `{event.content}`. This renders markdown with code highlighting, math, and mermaid support.\n\n```tsx\nimport { MessageResponse } from \"@\u002Fcomponents\u002Fai-elements\u002Fmessage\";\n\n\u002F\u002F In your event stream display\n{events.map(event => (\n  event.type === \"narrative\" && \u003CMessageResponse>{event.text}\u003C\u002FMessageResponse>\n))}\n```\n\n## Hooks — Waiting for External Events\n\nUse `defineHook` for typed, reusable hooks. **Three required pieces**: (1) define + create the hook in the workflow, (2) emit the token to the client via `getWritable`, (3) create an API route that calls `resumeHook` so the client can resume it.\n\n### 1. Define and create the hook (workflow file)\n\n```ts\nimport { defineHook, getWritable, sleep } from \"workflow\";\n\nexport interface ApprovalPayload {\n  approved: boolean;\n  comment?: string;\n}\n\n\u002F\u002F Define at module scope — reusable across workflows\nexport const approvalHook = defineHook\u003CApprovalPayload>();\n\nexport async function approvalGate(orderId: string): Promise\u003C{ status: string }> {\n  \"use workflow\";\n\n  \u002F\u002F .create() returns a hook instance — NOT directly callable\n  const hook = approvalHook.create({ token: `approval:${orderId}` });\n\n  \u002F\u002F CRITICAL: Emit the token to the client so it knows what to resume\n  await emitToken(hook.token, orderId);\n\n  \u002F\u002F Race between approval and timeout\n  const result = await Promise.race([\n    hook.then((payload) => ({ type: \"approval\" as const, payload })),\n    sleep(\"24h\").then(() => ({ type: \"timeout\" as const, payload: null })),\n  ]);\n\n  if (result.type === \"timeout\") {\n    return { status: \"timeout\" };\n  }\n  return { status: result.payload!.approved ? \"approved\" : \"rejected\" };\n}\n\nasync function emitToken(token: string, orderId: string): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003C{ type: string; token: string; orderId: string }>().getWriter();\n  try {\n    await writer.write({ type: \"awaiting_approval\", token, orderId });\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n**Common mistake**: Calling `defineHook()` directly or forgetting `.create()`. Always: `const hook = myHook.create({ token })`.\n\n### 2. Resume route (API file — required!)\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fapprove\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { resumeHook } from \"workflow\u002Fapi\";\n\nexport async function POST(req: Request) {\n  const { token, ...data } = await req.json();\n  await resumeHook(token, data);\n  return NextResponse.json({ ok: true });\n}\n```\n\n**You MUST create this route.** Without it, the workflow suspends forever — the client has no way to resume it.\n\n### 3. Client-side resume (React component)\n\n```tsx\n\u002F\u002F When the SSE stream emits { type: \"awaiting_approval\", token }, show UI and POST back:\nasync function handleApprove(token: string) {\n  await fetch(\"\u002Fapi\u002Fapprove\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n    body: JSON.stringify({ token, approved: true, comment: \"Looks good\" }),\n  });\n}\n```\n\n## Error Handling\n\n```ts\nimport { FatalError, RetryableError } from \"workflow\";\n\nasync function callExternalAPI(url: string) {\n  \"use step\";\n  const res = await fetch(url);\n\n  if (res.status >= 400 && res.status \u003C 500) {\n    throw new FatalError(`Client error: ${res.status}`);  \u002F\u002F No retry\n  }\n  if (res.status === 429) {\n    throw new RetryableError(\"Rate limited\", { retryAfter: \"5m\" });  \u002F\u002F Retry after 5 min\n  }\n  return res.json();\n}\n```\n\nStep retry metadata:\n\n```ts\nimport { getStepMetadata } from \"workflow\";\n\nasync function processWithRetry(id: string) {\n  \"use step\";\n  const { attempt } = getStepMetadata();\n  console.log(`Attempt ${attempt} for ${id}`);\n  \u002F\u002F ...\n}\n```\n\n## Sandbox Limitations & Workarounds\n\n| Limitation | Solution |\n|-----------|----------|\n| No native `fetch()` in workflow scope | Import `fetch` from `\"workflow\"` or move to a step |\n| No `setTimeout`\u002F`setInterval` | Use `sleep()` from `\"workflow\"` |\n| No Node.js modules in workflow scope | Move all Node.js logic to step functions |\n\n## DurableAgent (AI SDK Integration)\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\nimport { getWritable } from \"workflow\";\nimport { z } from \"zod\";\n\nasync function searchDatabase(query: string) {\n  \"use step\";\n  \u002F\u002F Full Node.js access — real DB calls here\n  return `Results for \"${query}\"`;\n}\n\nexport async function researchAgent(topic: string) {\n  \"use workflow\";\n\n  const agent = new DurableAgent({\n    model: \"anthropic\u002Fclaude-sonnet-4-5\",\n    system: \"You are a research assistant.\",\n    tools: {\n      search: {\n        description: \"Search the database\",\n        inputSchema: z.object({ query: z.string() }),\n        execute: searchDatabase,  \u002F\u002F Tool execute uses \"use step\"\n      },\n    },\n  });\n\n  const result = await agent.stream({\n    messages: [{ role: \"user\", content: `Research ${topic}` }],\n    writable: getWritable(),\n    maxSteps: 10,\n  });\n\n  return result.messages;\n}\n```\n\nEvery LLM call and tool execution becomes a retryable step. The entire agent loop survives crashes and deployments.\n\n## Common Patterns\n\n### Fan-Out \u002F Parallel Steps\n\n```ts\nexport async function processImages(imageIds: string[]) {\n  \"use workflow\";\n\n  const results = await Promise.all(\n    imageIds.map(async (id) => {\n      return await resizeImage(id);  \u002F\u002F Each is its own step\n    })\n  );\n\n  await saveResults(results);\n}\n\nasync function resizeImage(id: string) {\n  \"use step\";\n  \u002F\u002F ...\n}\n```\n\n### Saga with Compensation\n\n```ts\nimport { FatalError, getWritable } from \"workflow\";\n\nexport async function upgradeSaga(userId: string) {\n  \"use workflow\";\n\n  await reserveSeats(userId);\n\n  try {\n    await chargePayment(userId);\n  } catch {\n    await releaseSeats(userId);  \u002F\u002F Compensate\n    throw new FatalError(\"Payment failed\");\n  }\n\n  await activatePlan(userId);\n}\n```\n\n## Debugging\n\n```bash\nnpx workflow health                    # Check endpoints\nnpx workflow web                       # Visual dashboard\nnpx workflow inspect runs              # List all runs\nnpx workflow inspect run \u003Crun_id>      # Inspect specific run\nnpx workflow cancel \u003Crun_id>           # Cancel execution\n```\n\n## Debug Stuck Workflow\n\nWhen a workflow appears stuck, hanging, or not progressing, follow this escalation ladder:\n\n### 1. Add Step-Level Logging (Required)\n\n**Every step function MUST have `console.log` at entry and exit.** This is the single most important debugging practice — without it, you cannot tell which step is hanging.\n\n```ts\nasync function processOrder(orderId: string): Promise\u003COrderResult> {\n  \"use step\";\n  console.log(`[processOrder] START orderId=${orderId} at=${new Date().toISOString()}`);\n  try {\n    const result = await doWork(orderId);\n    console.log(`[processOrder] DONE orderId=${orderId} result=${JSON.stringify(result)}`);\n    return result;\n  } catch (err) {\n    console.error(`[processOrder] FAIL orderId=${orderId} error=${err}`);\n    throw err;\n  }\n}\n```\n\n**Workflow-level logging** — log at every orchestration point:\n\n```ts\nexport async function myWorkflow(input: string) {\n  \"use workflow\";\n  console.log(`[myWorkflow] START input=${input}`);\n\n  const data = await stepOne(input);\n  console.log(`[myWorkflow] stepOne complete, starting stepTwo`);\n\n  const result = await stepTwo(data);\n  console.log(`[myWorkflow] stepTwo complete, returning`);\n\n  return { result };\n}\n```\n\n### 2. Check Run Status\n\n```bash\n# List recent runs — look for \"running\" status that's been active too long\nnpx workflow inspect runs\n\n# Get detailed status for a specific run\nnpx workflow inspect run \u003Crun_id>\n\n# Check if the workflow endpoints are healthy\nnpx workflow health\n```\n\n### 3. Check Vercel Runtime Logs\n\n```bash\n# Stream live logs from your deployment\nvercel logs --follow\n\n# Or check the Vercel dashboard: Project → Deployments → Functions tab\n```\n\nLook for:\n- **Missing step entry logs** — the step before the missing one is where execution stopped\n- **Timeout errors** — Vercel function timeout (default 60s hobby, 300s pro)\n- **OIDC\u002Fcredential errors** — `gateway()` calls fail silently without `vercel env pull`\n- **Memory errors** — large payloads in steps can OOM the function\n\n### 4. Common Stuck Scenarios\n\n| Symptom | Likely Cause | Fix |\n|---------|-------------|-----|\n| Run stays \"running\" forever | Step is awaiting an external call that never resolves | Add timeout with `Promise.race` + `sleep()` |\n| Hook never resumes | Missing resume API route or wrong token | Verify resume route exists and token matches |\n| Step retries endlessly | Throwing `RetryableError` without bounds | Add `FatalError` after max retries via `getStepMetadata().retryCount` |\n| Workflow starts but no steps run | `getWritable()` called in workflow scope | Move `getWritable()` into a `\"use step\"` function |\n| AI step hangs | Missing OIDC credentials for gateway | Run `vercel link && vercel env pull` |\n| No logs appearing at all | Logging not added to steps | Add `console.log` at entry\u002Fexit of every step |\n\n### 5. Use Browser Verification\n\nIf the workflow powers a UI, use `agent-browser` to check the frontend while inspecting backend logs — a hanging page often means a stuck workflow step. Check the browser console for failed fetch calls to your workflow API routes.\n\n## When to Use WDK vs Regular Functions\n\n| Scenario | Use |\n|----------|-----|\n| Simple API endpoint, fast response | Regular Route Handler |\n| Multi-step process, must complete all steps | WDK Workflow |\n| AI agent in production, must not lose state | WDK DurableAgent |\n| Background job that can take minutes\u002Fhours | WDK Workflow |\n| Process spanning multiple services | WDK Workflow |\n| Quick one-shot LLM call | AI SDK directly |\n\n## Framework Support\n\nNext.js, Nitro, SvelteKit, Astro, Express, Hono (supported). TanStack Start, React Router (in development).\n\n## Official Documentation\n\n- [Workflow DevKit](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow)\n- [Website](https:\u002F\u002Fuseworkflow.dev)\n- [GitHub](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fworkflow)\n- [Workflow Builder Template](https:\u002F\u002Fvercel.com\u002Ftemplates\u002Fnext.js\u002Fworkflow-builder)\n",{"data":31,"body":408},{"name":4,"description":6,"metadata":32},{"priority":33,"docs":34,"sitemap":37,"pathPatterns":38,"importPatterns":58,"bashPatterns":61,"promptSignals":76},9,[35,36],"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow","https:\u002F\u002Fuseworkflow.dev","https:\u002F\u002Fvercel.com\u002Fsitemap\u002Fdocs.xml",[39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57],"lib\u002Fworkflow\u002F**","src\u002Flib\u002Fworkflow\u002F**","workflows\u002F**","lib\u002Fworkflow.*","src\u002Flib\u002Fworkflow.*","workflow.*","*workflow*","*workflow*\u002F**","**\u002Fchain-engine*","**\u002Fchain_engine*","**\u002FchainEngine*","**\u002Fpipeline-engine*","**\u002Fpipeline_engine*","**\u002FpipelineEngine*","**\u002Fstate-machine*","**\u002Fstate_machine*","**\u002FstateMachine*","**\u002Forchestrat*","**\u002Fescalation*",[59,4,60,45],"@vercel\u002Fworkflow","@workflow\u002F*",[62,63,64,65,66,67,68,69,70,71,72,73,74,75],"\\bnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bbun\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\byarn\\s+add\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\byarn\\s+add\\s+[^\\n]*\\bworkflow\\b","\\bnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\bbun\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\byarn\\s+add\\s+[^\\n]*@workflow\u002F","\\bnpx\\s+workflow(?:@latest)?\\b","\\bbunx\\s+workflow(?:@latest)?\\b",{"phrases":77,"allOf":225,"anyOf":387,"noneOf":402,"minScore":407},[78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224],"vercel workflow","workflow devkit","durable workflow","durable execution","durable function","durable pipeline","durable process","durable agent","durable chat","step function","step functions","use workflow","use step","multi-step pipeline","multi step pipeline","multi-step process","multi step process","multi-step creation","multi-step generation","processing pipeline","creation pipeline","generation pipeline","content pipeline","production pipeline","approval pipeline","ingestion pipeline","streams progress","stream progress","streams each phase","streams each step","streams each","stream each","survive page reload","survive page reloads","survive a crash","survive crashes","survive network","fault-tolerant","fault tolerant","crash-safe","crash safe","automatically retry","auto retry","retry on failure","retry on error","reliable and retry","reliable processing","individually reliable","each step reliable","each step should be reliable","steps should be reliable","reliable with automatic retry","reliable with retry","retry on transient","transient failures","session persistence","session should persist","session survives","reconnect automatically","auto reconnect","reconnect if the network","reconnect on disconnect","resume after failure","resume after crash","resume on reconnect","human-in-the-loop","human in the loop","wait for approval","approval step","approval before","editorial approval","manual approval","wait for user","pause until","wait for response","callback url","webhook callback","chat should survive","chat survives","conversation should persist","conversation persists","conversation should survive","sequential chain","email chain","chain of emails","chain of steps","chain engine","chain with triggers","trigger chain","triggered chain","webhook chain","webhook pipeline","webhook orchestration","multi-service trigger","cross-service trigger","various triggers","different triggers","triggers from different","triggers from various","sequential steps","sequential pipeline","sequential process","sequential emails","escalation chain","escalation pipeline","state machine","step-based","step based","delay between steps","delay between emails","delayed steps","conditional steps","skip steps","branch based on","wait for webhook","wait for trigger","wait for event","orchestrate emails","orchestrate webhooks","orchestrate services","chain across services","workflow stuck","workflow hung","workflow hanging","workflow waiting","workflow failing","workflow timeout","workflow not running","workflow error","check workflow","workflow logs","workflow run status","debug workflow","workflow not finishing","workflow not responding","workflow stalled","workflow pending","step is stuck","step is hanging","why is my workflow","workflow run","step failed","run status","run failed","run logs","workflow run failed","workflow step failed",[226,228,230,232,234,237,239,241,244,246,247,249,250,252,253,255,257,259,260,261,263,265,267,269,270,272,274,276,277,280,282,283,286,287,288,289,291,292,293,294,296,298,299,302,304,306,308,310,311,312,315,317,319,321,323,324,326,327,328,329,330,332,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,351,353,355,358,359,360,362,364,366,368,369,371,373,375,377,379,381,383,384,385,386],[4,227],"durable",[4,229],"retry",[4,231],"resume",[233,231],"pause",[235,236],"survive","crash",[235,238],"reload",[235,240],"disconnect",[242,243],"pipeline","stream",[242,245],"step",[242,227],[242,248],"reliable",[242,229],[251,243],"multi-step",[251,248],[254,242],"generation",[256,242],"creation",[258,243],"process",[258,248],[258,229],[229,262],"failure",[229,264],"error",[229,266],"automatically",[229,268],"transient",[248,229],[271,248],"individually",[273,248],"steps",[275,248],"sandbox",[275,229],[278,279],"reconnect","network",[278,281],"drop",[278,240],[284,285],"session","persist",[284,235],[284,238],[284,278],[290,235],"chat",[290,285],[290,278],[290,227],[290,295],"fault",[297,285],"conversation",[297,235],[300,301],"approval","wait",[300,303],"human",[305,245],"each",[305,307],"phase",[305,309],"stage",[245,248],[245,229],[313,314],"chain","trigger",[313,316],"sequential",[313,318],"email",[313,320],"webhook",[313,322],"delay",[313,245],[313,325],"escalat",[316,314],[316,318],[316,245],[316,320],[314,331],"orchestrat",[314,333],"service",[314,322],[314,316],[320,313],[320,331],[320,242],[320,316],[318,314],[318,242],[318,316],[318,322],[318,325],[325,314],[325,245],[325,318],[349,350],"state","machine",[352,245],"conditional",[352,354],"skip",[356,357],"branch","condition",[301,320],[301,314],[301,361],"event",[4,363],"stuck",[4,365],"hung",[4,367],"timeout",[4,264],[4,370],"logs",[4,372],"debug",[4,374],"check",[4,376],"failing",[4,378],"status",[380,378],"run",[245,382],"failed",[245,363],[245,367],[4,380],[380,370],[388,389,251,390,242,391,392,393,394,395,396,397,307,398,309,399,227,248,115,229,278,235,285,300,313,316,314,320,400,183,401,391],"long-running","long running","multi step","orchestration","step-by-step","step by step","each piece","each step","each phase","each stage","phases","stages","escalation","orchestrate",[403,404,405,406],"github actions",".github\u002Fworkflows","ci workflow","aws step functions",4,{"type":409,"children":410},"root",[411,420,507,512,518,530,563,569,608,701,743,758,799,806,827,946,958,964,984,1031,1044,1056,1091,1097,1115,1306,1322,1397,1413,1459,1475,1523,1529,1534,1581,1667,1673,1720,1735,1745,1773,1796,1805,1829,1855,1869,3237,3250,3603,3634,3647,4809,4822,5736,5747,5766,6009,6022,6055,6248,6254,6289,6295,7532,7564,7570,7869,7879,7885,8166,8172,8636,8641,8873,8879,8991,8997,9830,9835,9841,9847,10192,10198,10541,10547,10702,10708,10713,10719,10737,11175,11185,11507,11513,11629,11635,11682,11687,11744,11750,11947,11953,11966,11972,12070,12076,12081,12087,12128],{"type":412,"tag":413,"props":414,"children":416},"element","h1",{"id":415},"vercel-workflow-devkit-wdk",[417],{"type":418,"value":419},"text","Vercel Workflow DevKit (WDK)",{"type":412,"tag":421,"props":422,"children":423},"blockquote",{},[424],{"type":412,"tag":425,"props":426,"children":427},"p",{},[428,434,436,441,443,450,452,457,459,466,468,474,476,482,484,490,492,498,500,505],{"type":412,"tag":429,"props":430,"children":431},"strong",{},[432],{"type":418,"value":433},"CRITICAL — Your training data is outdated for this library.",{"type":418,"value":435}," WDK APIs change frequently. Before writing workflow code, ",{"type":412,"tag":429,"props":437,"children":438},{},[439],{"type":418,"value":440},"fetch the docs",{"type":418,"value":442}," at ",{"type":412,"tag":444,"props":445,"children":448},"a",{"href":36,"rel":446},[447],"nofollow",[449],{"type":418,"value":36},{"type":418,"value":451}," and ",{"type":412,"tag":444,"props":453,"children":455},{"href":35,"rel":454},[447],[456],{"type":418,"value":35},{"type":418,"value":458}," to find the correct function signatures, patterns, and examples for the exact thing you're building. Do not guess at APIs — look them up. Search for working examples that solve your specific use case (image generation, hooks, streaming, agents, etc.). The docs contain patterns for ",{"type":412,"tag":460,"props":461,"children":463},"code",{"className":462},[],[464],{"type":418,"value":465},"start()",{"type":418,"value":467}," argument passing, ",{"type":412,"tag":460,"props":469,"children":471},{"className":470},[],[472],{"type":418,"value":473},"getWritable()",{"type":418,"value":475}," usage, ",{"type":412,"tag":460,"props":477,"children":479},{"className":478},[],[480],{"type":418,"value":481},"defineHook()",{"type":418,"value":483}," wiring, ",{"type":412,"tag":460,"props":485,"children":487},{"className":486},[],[488],{"type":418,"value":489},"createWebhook()",{"type":418,"value":491}," callback flows, and ",{"type":412,"tag":460,"props":493,"children":495},{"className":494},[],[496],{"type":418,"value":497},"DurableAgent",{"type":418,"value":499}," configuration that are ",{"type":412,"tag":429,"props":501,"children":502},{},[503],{"type":418,"value":504},"not in your training data",{"type":418,"value":506}," or have changed since your cutoff.",{"type":412,"tag":425,"props":508,"children":509},{},[510],{"type":418,"value":511},"WDK is an open-source TypeScript framework that makes durability a language-level concept. Functions can pause for minutes or months, survive deployments and crashes, and resume exactly where they stopped.",{"type":412,"tag":513,"props":514,"children":515},"h2",{"id":378},[516],{"type":418,"value":517},"Status",{"type":412,"tag":425,"props":519,"children":520},{},[521,523,528],{"type":418,"value":522},"WDK is in ",{"type":412,"tag":429,"props":524,"children":525},{},[526],{"type":418,"value":527},"public beta",{"type":418,"value":529}," (since October 2025) and open source. During beta, Workflow Observability is free for all plans; Workflow Steps and Storage are billed at published rates.",{"type":412,"tag":425,"props":531,"children":532},{},[533,538,540,546,548,553,555,561],{"type":412,"tag":429,"props":534,"children":535},{},[536],{"type":418,"value":537},"Security",{"type":418,"value":539},": Upgrade to ",{"type":412,"tag":460,"props":541,"children":543},{"className":542},[],[544],{"type":418,"value":545},"workflow@>=4.2.0-beta.64",{"type":418,"value":547}," — versions ≤4.1.0-beta.63 allowed predictable user-specified webhook tokens in ",{"type":412,"tag":460,"props":549,"children":551},{"className":550},[],[552],{"type":418,"value":489},{"type":418,"value":554}," (CVE GHSA-9r75-g2cr-3h76, CVSS 7.5). Run ",{"type":412,"tag":460,"props":556,"children":558},{"className":557},[],[559],{"type":418,"value":560},"npx workflow@latest",{"type":418,"value":562}," to update.",{"type":412,"tag":513,"props":564,"children":566},{"id":565},"installation",[567],{"type":418,"value":568},"Installation",{"type":412,"tag":425,"props":570,"children":571},{},[572,583,585,591,593,599,600,606],{"type":412,"tag":429,"props":573,"children":574},{},[575,577],{"type":418,"value":576},"If using ",{"type":412,"tag":460,"props":578,"children":580},{"className":579},[],[581],{"type":418,"value":582},"create-next-app",{"type":418,"value":584},", always pass ",{"type":412,"tag":460,"props":586,"children":588},{"className":587},[],[589],{"type":418,"value":590},"--no-src-dir",{"type":418,"value":592}," so ",{"type":412,"tag":460,"props":594,"children":596},{"className":595},[],[597],{"type":418,"value":598},"app\u002F",{"type":418,"value":451},{"type":412,"tag":460,"props":601,"children":603},{"className":602},[],[604],{"type":418,"value":605},"workflows\u002F",{"type":418,"value":607}," are siblings at the project root:",{"type":412,"tag":609,"props":610,"children":615},"pre",{"className":611,"code":612,"language":613,"meta":614,"style":614},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx create-next-app@latest my-app --no-src-dir --tailwind --eslint --app --ts\ncd my-app\nnpm install workflow@latest\n","bash","",[616],{"type":412,"tag":460,"props":617,"children":618},{"__ignoreMap":614},[619,667,682],{"type":412,"tag":620,"props":621,"children":624},"span",{"class":622,"line":623},"line",1,[625,631,637,642,647,652,657,662],{"type":412,"tag":620,"props":626,"children":628},{"style":627},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[629],{"type":418,"value":630},"npx",{"type":412,"tag":620,"props":632,"children":634},{"style":633},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[635],{"type":418,"value":636}," create-next-app@latest",{"type":412,"tag":620,"props":638,"children":639},{"style":633},[640],{"type":418,"value":641}," my-app",{"type":412,"tag":620,"props":643,"children":644},{"style":633},[645],{"type":418,"value":646}," --no-src-dir",{"type":412,"tag":620,"props":648,"children":649},{"style":633},[650],{"type":418,"value":651}," --tailwind",{"type":412,"tag":620,"props":653,"children":654},{"style":633},[655],{"type":418,"value":656}," --eslint",{"type":412,"tag":620,"props":658,"children":659},{"style":633},[660],{"type":418,"value":661}," --app",{"type":412,"tag":620,"props":663,"children":664},{"style":633},[665],{"type":418,"value":666}," --ts\n",{"type":412,"tag":620,"props":668,"children":670},{"class":622,"line":669},2,[671,677],{"type":412,"tag":620,"props":672,"children":674},{"style":673},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[675],{"type":418,"value":676},"cd",{"type":412,"tag":620,"props":678,"children":679},{"style":633},[680],{"type":418,"value":681}," my-app\n",{"type":412,"tag":620,"props":683,"children":685},{"class":622,"line":684},3,[686,691,696],{"type":412,"tag":620,"props":687,"children":688},{"style":627},[689],{"type":418,"value":690},"npm",{"type":412,"tag":620,"props":692,"children":693},{"style":633},[694],{"type":418,"value":695}," install",{"type":412,"tag":620,"props":697,"children":698},{"style":633},[699],{"type":418,"value":700}," workflow@latest\n",{"type":412,"tag":425,"props":702,"children":703},{},[704,706,712,714,720,722,728,730,735,736,741],{"type":418,"value":705},"Do NOT use the ",{"type":412,"tag":460,"props":707,"children":709},{"className":708},[],[710],{"type":418,"value":711},"src\u002F",{"type":418,"value":713}," directory with WDK projects. The ",{"type":412,"tag":460,"props":715,"children":717},{"className":716},[],[718],{"type":418,"value":719},"@",{"type":418,"value":721}," alias must resolve ",{"type":412,"tag":460,"props":723,"children":725},{"className":724},[],[726],{"type":418,"value":727},"@\u002Fworkflows\u002F...",{"type":418,"value":729}," correctly — this only works when ",{"type":412,"tag":460,"props":731,"children":733},{"className":732},[],[734],{"type":418,"value":605},{"type":418,"value":451},{"type":412,"tag":460,"props":737,"children":739},{"className":738},[],[740],{"type":418,"value":598},{"type":418,"value":742}," are at the same level.",{"type":412,"tag":421,"props":744,"children":745},{},[746],{"type":412,"tag":425,"props":747,"children":748},{},[749,751,756],{"type":418,"value":750},"Run ",{"type":412,"tag":460,"props":752,"children":754},{"className":753},[],[755],{"type":418,"value":560},{"type":418,"value":757}," to scaffold or update an existing project.",{"type":412,"tag":425,"props":759,"children":760},{},[761,766,768,774,776,781,783,789,791,797],{"type":412,"tag":429,"props":762,"children":763},{},[764],{"type":418,"value":765},"Peer dependency note",{"type":418,"value":767},": ",{"type":412,"tag":460,"props":769,"children":771},{"className":770},[],[772],{"type":418,"value":773},"@workflow\u002Fai",{"type":418,"value":775}," requires a compatible ",{"type":412,"tag":460,"props":777,"children":779},{"className":778},[],[780],{"type":418,"value":4},{"type":418,"value":782}," version. If you hit ",{"type":412,"tag":460,"props":784,"children":786},{"className":785},[],[787],{"type":418,"value":788},"ERESOLVE",{"type":418,"value":790}," errors, use ",{"type":412,"tag":460,"props":792,"children":794},{"className":793},[],[795],{"type":418,"value":796},"npm install --legacy-peer-deps",{"type":418,"value":798}," or install both packages in the same command.",{"type":412,"tag":800,"props":801,"children":803},"h3",{"id":802},"nextjs-setup-required",[804],{"type":418,"value":805},"Next.js Setup (Required)",{"type":412,"tag":425,"props":807,"children":808},{},[809,811,817,819,825],{"type":418,"value":810},"Add the ",{"type":412,"tag":460,"props":812,"children":814},{"className":813},[],[815],{"type":418,"value":816},"withWorkflow",{"type":418,"value":818}," plugin to ",{"type":412,"tag":460,"props":820,"children":822},{"className":821},[],[823],{"type":418,"value":824},"next.config.ts",{"type":418,"value":826},":",{"type":412,"tag":609,"props":828,"children":832},{"className":829,"code":830,"language":831,"meta":614,"style":614},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { withWorkflow } from \"workflow\u002Fnext\";\n\nconst nextConfig = {};\nexport default withWorkflow(nextConfig);\n","ts",[833],{"type":412,"tag":460,"props":834,"children":835},{"__ignoreMap":614},[836,887,896,920],{"type":412,"tag":620,"props":837,"children":838},{"class":622,"line":623},[839,845,851,857,862,867,872,877,882],{"type":412,"tag":620,"props":840,"children":842},{"style":841},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[843],{"type":418,"value":844},"import",{"type":412,"tag":620,"props":846,"children":848},{"style":847},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[849],{"type":418,"value":850}," {",{"type":412,"tag":620,"props":852,"children":854},{"style":853},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[855],{"type":418,"value":856}," withWorkflow",{"type":412,"tag":620,"props":858,"children":859},{"style":847},[860],{"type":418,"value":861}," }",{"type":412,"tag":620,"props":863,"children":864},{"style":841},[865],{"type":418,"value":866}," from",{"type":412,"tag":620,"props":868,"children":869},{"style":847},[870],{"type":418,"value":871}," \"",{"type":412,"tag":620,"props":873,"children":874},{"style":633},[875],{"type":418,"value":876},"workflow\u002Fnext",{"type":412,"tag":620,"props":878,"children":879},{"style":847},[880],{"type":418,"value":881},"\"",{"type":412,"tag":620,"props":883,"children":884},{"style":847},[885],{"type":418,"value":886},";\n",{"type":412,"tag":620,"props":888,"children":889},{"class":622,"line":669},[890],{"type":412,"tag":620,"props":891,"children":893},{"emptyLinePlaceholder":892},true,[894],{"type":418,"value":895},"\n",{"type":412,"tag":620,"props":897,"children":898},{"class":622,"line":684},[899,905,910,915],{"type":412,"tag":620,"props":900,"children":902},{"style":901},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[903],{"type":418,"value":904},"const",{"type":412,"tag":620,"props":906,"children":907},{"style":853},[908],{"type":418,"value":909}," nextConfig ",{"type":412,"tag":620,"props":911,"children":912},{"style":847},[913],{"type":418,"value":914},"=",{"type":412,"tag":620,"props":916,"children":917},{"style":847},[918],{"type":418,"value":919}," {};\n",{"type":412,"tag":620,"props":921,"children":922},{"class":622,"line":407},[923,928,933,937,942],{"type":412,"tag":620,"props":924,"children":925},{"style":841},[926],{"type":418,"value":927},"export",{"type":412,"tag":620,"props":929,"children":930},{"style":841},[931],{"type":418,"value":932}," default",{"type":412,"tag":620,"props":934,"children":935},{"style":673},[936],{"type":418,"value":856},{"type":412,"tag":620,"props":938,"children":939},{"style":853},[940],{"type":418,"value":941},"(nextConfig)",{"type":412,"tag":620,"props":943,"children":944},{"style":847},[945],{"type":418,"value":886},{"type":412,"tag":425,"props":947,"children":948},{},[949,951,956],{"type":418,"value":950},"Without this, workflow routes will not be registered and ",{"type":412,"tag":460,"props":952,"children":954},{"className":953},[],[955],{"type":418,"value":465},{"type":418,"value":957}," calls will fail at runtime.",{"type":412,"tag":800,"props":959,"children":961},{"id":960},"environment-setup-required-for-ai-gateway",[962],{"type":418,"value":963},"Environment Setup (Required for AI Gateway)",{"type":412,"tag":425,"props":965,"children":966},{},[967,969,975,977,982],{"type":418,"value":968},"Workflows that use AI SDK with ",{"type":412,"tag":460,"props":970,"children":972},{"className":971},[],[973],{"type":418,"value":974},"gateway()",{"type":418,"value":976}," need OIDC credentials. Run these ",{"type":412,"tag":429,"props":978,"children":979},{},[980],{"type":418,"value":981},"before",{"type":418,"value":983}," starting the dev server:",{"type":412,"tag":609,"props":985,"children":987},{"className":611,"code":986,"language":613,"meta":614,"style":614},"vercel link          # Connect to your Vercel project\nvercel env pull      # Downloads .env.local with VERCEL_OIDC_TOKEN\n",[988],{"type":412,"tag":460,"props":989,"children":990},{"__ignoreMap":614},[991,1009],{"type":412,"tag":620,"props":992,"children":993},{"class":622,"line":623},[994,998,1003],{"type":412,"tag":620,"props":995,"children":996},{"style":627},[997],{"type":418,"value":14},{"type":412,"tag":620,"props":999,"children":1000},{"style":633},[1001],{"type":418,"value":1002}," link",{"type":412,"tag":620,"props":1004,"children":1006},{"style":1005},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1007],{"type":418,"value":1008},"          # Connect to your Vercel project\n",{"type":412,"tag":620,"props":1010,"children":1011},{"class":622,"line":669},[1012,1016,1021,1026],{"type":412,"tag":620,"props":1013,"children":1014},{"style":627},[1015],{"type":418,"value":14},{"type":412,"tag":620,"props":1017,"children":1018},{"style":633},[1019],{"type":418,"value":1020}," env",{"type":412,"tag":620,"props":1022,"children":1023},{"style":633},[1024],{"type":418,"value":1025}," pull",{"type":412,"tag":620,"props":1027,"children":1028},{"style":1005},[1029],{"type":418,"value":1030},"      # Downloads .env.local with VERCEL_OIDC_TOKEN\n",{"type":412,"tag":425,"props":1032,"children":1033},{},[1034,1036,1042],{"type":418,"value":1035},"Without this, ",{"type":412,"tag":460,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":418,"value":1041},"gateway(\"openai\u002Fgpt-5.4\")",{"type":418,"value":1043}," calls inside workflow steps will fail immediately with no credentials, causing the entire workflow run to fail silently.",{"type":412,"tag":800,"props":1045,"children":1047},{"id":1046},"getstepmetadata-note",[1048,1054],{"type":412,"tag":460,"props":1049,"children":1051},{"className":1050},[],[1052],{"type":418,"value":1053},"getStepMetadata()",{"type":418,"value":1055}," Note",{"type":412,"tag":425,"props":1057,"children":1058},{},[1059,1065,1067,1073,1075,1081,1083,1089],{"type":412,"tag":460,"props":1060,"children":1062},{"className":1061},[],[1063],{"type":418,"value":1064},"getStepMetadata().retryCount",{"type":418,"value":1066}," returns ",{"type":412,"tag":460,"props":1068,"children":1070},{"className":1069},[],[1071],{"type":418,"value":1072},"undefined",{"type":418,"value":1074}," (not ",{"type":412,"tag":460,"props":1076,"children":1078},{"className":1077},[],[1079],{"type":418,"value":1080},"0",{"type":418,"value":1082},") on the first attempt. Guard with: ",{"type":412,"tag":460,"props":1084,"children":1086},{"className":1085},[],[1087],{"type":418,"value":1088},"const attempt = (meta.retryCount ?? 0) + 1",{"type":418,"value":1090},".",{"type":412,"tag":513,"props":1092,"children":1094},{"id":1093},"essential-imports",[1095],{"type":418,"value":1096},"Essential Imports",{"type":412,"tag":425,"props":1098,"children":1099},{},[1100,1105,1107,1113],{"type":412,"tag":429,"props":1101,"children":1102},{},[1103],{"type":418,"value":1104},"Workflow primitives",{"type":418,"value":1106}," (from ",{"type":412,"tag":460,"props":1108,"children":1110},{"className":1109},[],[1111],{"type":418,"value":1112},"\"workflow\"",{"type":418,"value":1114},"):",{"type":412,"tag":609,"props":1116,"children":1118},{"className":829,"code":1117,"language":831,"meta":614,"style":614},"import { getWritable, getStepMetadata, getWorkflowMetadata } from \"workflow\";\nimport { sleep, fetch, defineHook, createHook, createWebhook } from \"workflow\";\nimport { FatalError, RetryableError } from \"workflow\";\n",[1119],{"type":412,"tag":460,"props":1120,"children":1121},{"__ignoreMap":614},[1122,1181,1257],{"type":412,"tag":620,"props":1123,"children":1124},{"class":622,"line":623},[1125,1129,1133,1138,1143,1148,1152,1157,1161,1165,1169,1173,1177],{"type":412,"tag":620,"props":1126,"children":1127},{"style":841},[1128],{"type":418,"value":844},{"type":412,"tag":620,"props":1130,"children":1131},{"style":847},[1132],{"type":418,"value":850},{"type":412,"tag":620,"props":1134,"children":1135},{"style":853},[1136],{"type":418,"value":1137}," getWritable",{"type":412,"tag":620,"props":1139,"children":1140},{"style":847},[1141],{"type":418,"value":1142},",",{"type":412,"tag":620,"props":1144,"children":1145},{"style":853},[1146],{"type":418,"value":1147}," getStepMetadata",{"type":412,"tag":620,"props":1149,"children":1150},{"style":847},[1151],{"type":418,"value":1142},{"type":412,"tag":620,"props":1153,"children":1154},{"style":853},[1155],{"type":418,"value":1156}," getWorkflowMetadata",{"type":412,"tag":620,"props":1158,"children":1159},{"style":847},[1160],{"type":418,"value":861},{"type":412,"tag":620,"props":1162,"children":1163},{"style":841},[1164],{"type":418,"value":866},{"type":412,"tag":620,"props":1166,"children":1167},{"style":847},[1168],{"type":418,"value":871},{"type":412,"tag":620,"props":1170,"children":1171},{"style":633},[1172],{"type":418,"value":4},{"type":412,"tag":620,"props":1174,"children":1175},{"style":847},[1176],{"type":418,"value":881},{"type":412,"tag":620,"props":1178,"children":1179},{"style":847},[1180],{"type":418,"value":886},{"type":412,"tag":620,"props":1182,"children":1183},{"class":622,"line":669},[1184,1188,1192,1197,1201,1206,1210,1215,1219,1224,1228,1233,1237,1241,1245,1249,1253],{"type":412,"tag":620,"props":1185,"children":1186},{"style":841},[1187],{"type":418,"value":844},{"type":412,"tag":620,"props":1189,"children":1190},{"style":847},[1191],{"type":418,"value":850},{"type":412,"tag":620,"props":1193,"children":1194},{"style":853},[1195],{"type":418,"value":1196}," sleep",{"type":412,"tag":620,"props":1198,"children":1199},{"style":847},[1200],{"type":418,"value":1142},{"type":412,"tag":620,"props":1202,"children":1203},{"style":853},[1204],{"type":418,"value":1205}," fetch",{"type":412,"tag":620,"props":1207,"children":1208},{"style":847},[1209],{"type":418,"value":1142},{"type":412,"tag":620,"props":1211,"children":1212},{"style":853},[1213],{"type":418,"value":1214}," defineHook",{"type":412,"tag":620,"props":1216,"children":1217},{"style":847},[1218],{"type":418,"value":1142},{"type":412,"tag":620,"props":1220,"children":1221},{"style":853},[1222],{"type":418,"value":1223}," createHook",{"type":412,"tag":620,"props":1225,"children":1226},{"style":847},[1227],{"type":418,"value":1142},{"type":412,"tag":620,"props":1229,"children":1230},{"style":853},[1231],{"type":418,"value":1232}," createWebhook",{"type":412,"tag":620,"props":1234,"children":1235},{"style":847},[1236],{"type":418,"value":861},{"type":412,"tag":620,"props":1238,"children":1239},{"style":841},[1240],{"type":418,"value":866},{"type":412,"tag":620,"props":1242,"children":1243},{"style":847},[1244],{"type":418,"value":871},{"type":412,"tag":620,"props":1246,"children":1247},{"style":633},[1248],{"type":418,"value":4},{"type":412,"tag":620,"props":1250,"children":1251},{"style":847},[1252],{"type":418,"value":881},{"type":412,"tag":620,"props":1254,"children":1255},{"style":847},[1256],{"type":418,"value":886},{"type":412,"tag":620,"props":1258,"children":1259},{"class":622,"line":684},[1260,1264,1268,1273,1277,1282,1286,1290,1294,1298,1302],{"type":412,"tag":620,"props":1261,"children":1262},{"style":841},[1263],{"type":418,"value":844},{"type":412,"tag":620,"props":1265,"children":1266},{"style":847},[1267],{"type":418,"value":850},{"type":412,"tag":620,"props":1269,"children":1270},{"style":853},[1271],{"type":418,"value":1272}," FatalError",{"type":412,"tag":620,"props":1274,"children":1275},{"style":847},[1276],{"type":418,"value":1142},{"type":412,"tag":620,"props":1278,"children":1279},{"style":853},[1280],{"type":418,"value":1281}," RetryableError",{"type":412,"tag":620,"props":1283,"children":1284},{"style":847},[1285],{"type":418,"value":861},{"type":412,"tag":620,"props":1287,"children":1288},{"style":841},[1289],{"type":418,"value":866},{"type":412,"tag":620,"props":1291,"children":1292},{"style":847},[1293],{"type":418,"value":871},{"type":412,"tag":620,"props":1295,"children":1296},{"style":633},[1297],{"type":418,"value":4},{"type":412,"tag":620,"props":1299,"children":1300},{"style":847},[1301],{"type":418,"value":881},{"type":412,"tag":620,"props":1303,"children":1304},{"style":847},[1305],{"type":418,"value":886},{"type":412,"tag":425,"props":1307,"children":1308},{},[1309,1314,1315,1321],{"type":412,"tag":429,"props":1310,"children":1311},{},[1312],{"type":418,"value":1313},"API operations",{"type":418,"value":1106},{"type":412,"tag":460,"props":1316,"children":1318},{"className":1317},[],[1319],{"type":418,"value":1320},"\"workflow\u002Fapi\"",{"type":418,"value":1114},{"type":412,"tag":609,"props":1323,"children":1325},{"className":829,"code":1324,"language":831,"meta":614,"style":614},"import { start, getRun, resumeHook, resumeWebhook } from \"workflow\u002Fapi\";\n",[1326],{"type":412,"tag":460,"props":1327,"children":1328},{"__ignoreMap":614},[1329],{"type":412,"tag":620,"props":1330,"children":1331},{"class":622,"line":623},[1332,1336,1340,1345,1349,1354,1358,1363,1367,1372,1376,1380,1384,1389,1393],{"type":412,"tag":620,"props":1333,"children":1334},{"style":841},[1335],{"type":418,"value":844},{"type":412,"tag":620,"props":1337,"children":1338},{"style":847},[1339],{"type":418,"value":850},{"type":412,"tag":620,"props":1341,"children":1342},{"style":853},[1343],{"type":418,"value":1344}," start",{"type":412,"tag":620,"props":1346,"children":1347},{"style":847},[1348],{"type":418,"value":1142},{"type":412,"tag":620,"props":1350,"children":1351},{"style":853},[1352],{"type":418,"value":1353}," getRun",{"type":412,"tag":620,"props":1355,"children":1356},{"style":847},[1357],{"type":418,"value":1142},{"type":412,"tag":620,"props":1359,"children":1360},{"style":853},[1361],{"type":418,"value":1362}," resumeHook",{"type":412,"tag":620,"props":1364,"children":1365},{"style":847},[1366],{"type":418,"value":1142},{"type":412,"tag":620,"props":1368,"children":1369},{"style":853},[1370],{"type":418,"value":1371}," resumeWebhook",{"type":412,"tag":620,"props":1373,"children":1374},{"style":847},[1375],{"type":418,"value":861},{"type":412,"tag":620,"props":1377,"children":1378},{"style":841},[1379],{"type":418,"value":866},{"type":412,"tag":620,"props":1381,"children":1382},{"style":847},[1383],{"type":418,"value":871},{"type":412,"tag":620,"props":1385,"children":1386},{"style":633},[1387],{"type":418,"value":1388},"workflow\u002Fapi",{"type":412,"tag":620,"props":1390,"children":1391},{"style":847},[1392],{"type":418,"value":881},{"type":412,"tag":620,"props":1394,"children":1395},{"style":847},[1396],{"type":418,"value":886},{"type":412,"tag":425,"props":1398,"children":1399},{},[1400,1405,1406,1412],{"type":412,"tag":429,"props":1401,"children":1402},{},[1403],{"type":418,"value":1404},"Framework integration",{"type":418,"value":1106},{"type":412,"tag":460,"props":1407,"children":1409},{"className":1408},[],[1410],{"type":418,"value":1411},"\"workflow\u002Fnext\"",{"type":418,"value":1114},{"type":412,"tag":609,"props":1414,"children":1416},{"className":829,"code":1415,"language":831,"meta":614,"style":614},"import { withWorkflow } from \"workflow\u002Fnext\";\n",[1417],{"type":412,"tag":460,"props":1418,"children":1419},{"__ignoreMap":614},[1420],{"type":412,"tag":620,"props":1421,"children":1422},{"class":622,"line":623},[1423,1427,1431,1435,1439,1443,1447,1451,1455],{"type":412,"tag":620,"props":1424,"children":1425},{"style":841},[1426],{"type":418,"value":844},{"type":412,"tag":620,"props":1428,"children":1429},{"style":847},[1430],{"type":418,"value":850},{"type":412,"tag":620,"props":1432,"children":1433},{"style":853},[1434],{"type":418,"value":856},{"type":412,"tag":620,"props":1436,"children":1437},{"style":847},[1438],{"type":418,"value":861},{"type":412,"tag":620,"props":1440,"children":1441},{"style":841},[1442],{"type":418,"value":866},{"type":412,"tag":620,"props":1444,"children":1445},{"style":847},[1446],{"type":418,"value":871},{"type":412,"tag":620,"props":1448,"children":1449},{"style":633},[1450],{"type":418,"value":876},{"type":412,"tag":620,"props":1452,"children":1453},{"style":847},[1454],{"type":418,"value":881},{"type":412,"tag":620,"props":1456,"children":1457},{"style":847},[1458],{"type":418,"value":886},{"type":412,"tag":425,"props":1460,"children":1461},{},[1462,1467,1468,1474],{"type":412,"tag":429,"props":1463,"children":1464},{},[1465],{"type":418,"value":1466},"AI agent",{"type":418,"value":1106},{"type":412,"tag":460,"props":1469,"children":1471},{"className":1470},[],[1472],{"type":418,"value":1473},"\"@workflow\u002Fai\u002Fagent\"",{"type":418,"value":1114},{"type":412,"tag":609,"props":1476,"children":1478},{"className":829,"code":1477,"language":831,"meta":614,"style":614},"import { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\n",[1479],{"type":412,"tag":460,"props":1480,"children":1481},{"__ignoreMap":614},[1482],{"type":412,"tag":620,"props":1483,"children":1484},{"class":622,"line":623},[1485,1489,1493,1498,1502,1506,1510,1515,1519],{"type":412,"tag":620,"props":1486,"children":1487},{"style":841},[1488],{"type":418,"value":844},{"type":412,"tag":620,"props":1490,"children":1491},{"style":847},[1492],{"type":418,"value":850},{"type":412,"tag":620,"props":1494,"children":1495},{"style":853},[1496],{"type":418,"value":1497}," DurableAgent",{"type":412,"tag":620,"props":1499,"children":1500},{"style":847},[1501],{"type":418,"value":861},{"type":412,"tag":620,"props":1503,"children":1504},{"style":841},[1505],{"type":418,"value":866},{"type":412,"tag":620,"props":1507,"children":1508},{"style":847},[1509],{"type":418,"value":871},{"type":412,"tag":620,"props":1511,"children":1512},{"style":633},[1513],{"type":418,"value":1514},"@workflow\u002Fai\u002Fagent",{"type":412,"tag":620,"props":1516,"children":1517},{"style":847},[1518],{"type":418,"value":881},{"type":412,"tag":620,"props":1520,"children":1521},{"style":847},[1522],{"type":418,"value":886},{"type":412,"tag":513,"props":1524,"children":1526},{"id":1525},"core-directives",[1527],{"type":418,"value":1528},"Core Directives",{"type":412,"tag":425,"props":1530,"children":1531},{},[1532],{"type":418,"value":1533},"Two directives turn ordinary async functions into durable workflows:",{"type":412,"tag":609,"props":1535,"children":1537},{"className":829,"code":1536,"language":831,"meta":614,"style":614},"\"use workflow\"  \u002F\u002F First line of function — marks it as a durable workflow\n\"use step\"      \u002F\u002F First line of function — marks it as a retryable, observable step\n",[1538],{"type":412,"tag":460,"props":1539,"children":1540},{"__ignoreMap":614},[1541,1561],{"type":412,"tag":620,"props":1542,"children":1543},{"class":622,"line":623},[1544,1548,1552,1556],{"type":412,"tag":620,"props":1545,"children":1546},{"style":847},[1547],{"type":418,"value":881},{"type":412,"tag":620,"props":1549,"children":1550},{"style":633},[1551],{"type":418,"value":89},{"type":412,"tag":620,"props":1553,"children":1554},{"style":847},[1555],{"type":418,"value":881},{"type":412,"tag":620,"props":1557,"children":1558},{"style":1005},[1559],{"type":418,"value":1560},"  \u002F\u002F First line of function — marks it as a durable workflow\n",{"type":412,"tag":620,"props":1562,"children":1563},{"class":622,"line":669},[1564,1568,1572,1576],{"type":412,"tag":620,"props":1565,"children":1566},{"style":847},[1567],{"type":418,"value":881},{"type":412,"tag":620,"props":1569,"children":1570},{"style":633},[1571],{"type":418,"value":90},{"type":412,"tag":620,"props":1573,"children":1574},{"style":847},[1575],{"type":418,"value":881},{"type":412,"tag":620,"props":1577,"children":1578},{"style":1005},[1579],{"type":418,"value":1580},"      \u002F\u002F First line of function — marks it as a retryable, observable step\n",{"type":412,"tag":425,"props":1582,"children":1583},{},[1584,1589,1591,1596,1598,1604,1606,1612,1614,1627,1629,1634,1636,1642,1644,1650,1652,1658,1659,1665],{"type":412,"tag":429,"props":1585,"children":1586},{},[1587],{"type":418,"value":1588},"Critical sandbox rule",{"type":418,"value":1590},": Step functions have full Node.js access. Workflow functions run ",{"type":412,"tag":429,"props":1592,"children":1593},{},[1594],{"type":418,"value":1595},"sandboxed",{"type":418,"value":1597}," — no native ",{"type":412,"tag":460,"props":1599,"children":1601},{"className":1600},[],[1602],{"type":418,"value":1603},"fetch",{"type":418,"value":1605},", no ",{"type":412,"tag":460,"props":1607,"children":1609},{"className":1608},[],[1610],{"type":418,"value":1611},"setTimeout",{"type":418,"value":1613},", no Node.js modules, and ",{"type":412,"tag":429,"props":1615,"children":1616},{},[1617,1619,1625],{"type":418,"value":1618},"no ",{"type":412,"tag":460,"props":1620,"children":1622},{"className":1621},[],[1623],{"type":418,"value":1624},"getWritable().getWriter()",{"type":418,"value":1626}," calls",{"type":418,"value":1628},". You MUST move all ",{"type":412,"tag":460,"props":1630,"children":1632},{"className":1631},[],[1633],{"type":418,"value":473},{"type":418,"value":1635}," usage into ",{"type":412,"tag":460,"props":1637,"children":1639},{"className":1638},[],[1640],{"type":418,"value":1641},"\"use step\"",{"type":418,"value":1643}," functions. Place all business logic and I\u002FO in steps; use the workflow function purely for orchestration and control flow (",{"type":412,"tag":460,"props":1645,"children":1647},{"className":1646},[],[1648],{"type":418,"value":1649},"sleep",{"type":418,"value":1651},", ",{"type":412,"tag":460,"props":1653,"children":1655},{"className":1654},[],[1656],{"type":418,"value":1657},"defineHook",{"type":418,"value":1651},{"type":412,"tag":460,"props":1660,"children":1662},{"className":1661},[],[1663],{"type":418,"value":1664},"Promise.race",{"type":418,"value":1666},").",{"type":412,"tag":513,"props":1668,"children":1670},{"id":1669},"canonical-project-structure-nextjs",[1671],{"type":418,"value":1672},"Canonical Project Structure (Next.js)",{"type":412,"tag":425,"props":1674,"children":1675},{},[1676,1678,1683,1685,1690,1692,1697,1699,1704,1706,1711,1713,1718],{"type":418,"value":1677},"Every WDK project needs three route files plus the workflow definition. ",{"type":412,"tag":429,"props":1679,"children":1680},{},[1681],{"type":418,"value":1682},"CRITICAL",{"type":418,"value":1684},": The ",{"type":412,"tag":460,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":418,"value":605},{"type":418,"value":1691}," directory and ",{"type":412,"tag":460,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":418,"value":598},{"type":418,"value":1698}," directory must be siblings at the same level so ",{"type":412,"tag":460,"props":1700,"children":1702},{"className":1701},[],[1703],{"type":418,"value":727},{"type":418,"value":1705}," resolves correctly. Do NOT put ",{"type":412,"tag":460,"props":1707,"children":1709},{"className":1708},[],[1710],{"type":418,"value":605},{"type":418,"value":1712}," outside the ",{"type":412,"tag":460,"props":1714,"children":1716},{"className":1715},[],[1717],{"type":418,"value":719},{"type":418,"value":1719}," alias root.",{"type":412,"tag":425,"props":1721,"children":1722},{},[1723],{"type":412,"tag":429,"props":1724,"children":1725},{},[1726,1728,1733],{"type":418,"value":1727},"Without ",{"type":412,"tag":460,"props":1729,"children":1731},{"className":1730},[],[1732],{"type":418,"value":711},{"type":418,"value":1734}," (recommended for WDK projects):",{"type":412,"tag":609,"props":1736,"children":1740},{"className":1737,"code":1739,"language":418},[1738],"language-text","workflows\u002F\n  my-workflow.ts              ← workflow definition (\"use workflow\" + \"use step\")\napp\u002Fapi\u002F\n  my-workflow\u002Froute.ts        ← POST handler: start(workflow, args) → { runId }\n  readable\u002F[runId]\u002Froute.ts   ← GET handler: SSE stream from run.getReadable()\n  run\u002F[runId]\u002Froute.ts        ← GET handler: run status via getRun(runId)\n",[1741],{"type":412,"tag":460,"props":1742,"children":1743},{"__ignoreMap":614},[1744],{"type":418,"value":1739},{"type":412,"tag":425,"props":1746,"children":1747},{},[1748,1750,1756,1758,1764,1766,1772],{"type":418,"value":1749},"tsconfig.json paths: ",{"type":412,"tag":460,"props":1751,"children":1753},{"className":1752},[],[1754],{"type":418,"value":1755},"\"@\u002F*\": [\".\u002F*\"]",{"type":418,"value":1757}," — ",{"type":412,"tag":460,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":418,"value":1763},"@\u002Fworkflows\u002Fmy-workflow",{"type":418,"value":1765}," resolves to ",{"type":412,"tag":460,"props":1767,"children":1769},{"className":1768},[],[1770],{"type":418,"value":1771},".\u002Fworkflows\u002Fmy-workflow",{"type":418,"value":1090},{"type":412,"tag":425,"props":1774,"children":1775},{},[1776,1788,1790,1795],{"type":412,"tag":429,"props":1777,"children":1778},{},[1779,1781,1786],{"type":418,"value":1780},"With ",{"type":412,"tag":460,"props":1782,"children":1784},{"className":1783},[],[1785],{"type":418,"value":711},{"type":418,"value":1787}," directory:",{"type":418,"value":1789}," Put workflows inside ",{"type":412,"tag":460,"props":1791,"children":1793},{"className":1792},[],[1794],{"type":418,"value":711},{"type":418,"value":826},{"type":412,"tag":609,"props":1797,"children":1800},{"className":1798,"code":1799,"language":418},[1738],"src\u002F\n  workflows\u002Fmy-workflow.ts\n  app\u002Fapi\u002Fmy-workflow\u002Froute.ts\n  app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts\n  app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts\n",[1801],{"type":412,"tag":460,"props":1802,"children":1803},{"__ignoreMap":614},[1804],{"type":418,"value":1799},{"type":412,"tag":425,"props":1806,"children":1807},{},[1808,1809,1815,1816,1821,1822,1828],{"type":418,"value":1749},{"type":412,"tag":460,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":418,"value":1814},"\"@\u002F*\": [\".\u002Fsrc\u002F*\"]",{"type":418,"value":1757},{"type":412,"tag":460,"props":1817,"children":1819},{"className":1818},[],[1820],{"type":418,"value":1763},{"type":418,"value":1765},{"type":412,"tag":460,"props":1823,"children":1825},{"className":1824},[],[1826],{"type":418,"value":1827},".\u002Fsrc\u002Fworkflows\u002Fmy-workflow",{"type":418,"value":1090},{"type":412,"tag":425,"props":1830,"children":1831},{},[1832,1837,1839,1845,1847,1853],{"type":412,"tag":429,"props":1833,"children":1834},{},[1835],{"type":418,"value":1836},"Never",{"type":418,"value":1838}," use ",{"type":412,"tag":460,"props":1840,"children":1842},{"className":1841},[],[1843],{"type":418,"value":1844},"@\u002F..\u002Fworkflows\u002F",{"type":418,"value":1846}," or ",{"type":412,"tag":460,"props":1848,"children":1850},{"className":1849},[],[1851],{"type":418,"value":1852},"@\u002F..\u002F..\u002Fworkflows\u002F",{"type":418,"value":1854}," — these are broken import paths that will fail at build time.",{"type":412,"tag":800,"props":1856,"children":1858},{"id":1857},"_1-workflow-definition-workflowsmy-workflowts",[1859,1861,1867],{"type":418,"value":1860},"1. Workflow Definition (",{"type":412,"tag":460,"props":1862,"children":1864},{"className":1863},[],[1865],{"type":418,"value":1866},"workflows\u002Fmy-workflow.ts",{"type":418,"value":1868},")",{"type":412,"tag":609,"props":1870,"children":1872},{"className":829,"code":1871,"language":831,"meta":614,"style":614},"import { getWritable } from \"workflow\";\n\nexport type MyEvent =\n  | { type: \"step_start\"; name: string }\n  | { type: \"step_done\"; name: string }\n  | { type: \"done\"; result: string };\n\nexport async function myWorkflow(input: string): Promise\u003C{ result: string }> {\n  \"use workflow\";\n\n  const data = await stepOne(input);\n  const result = await stepTwo(data);\n\n  return { result };\n}\n\nasync function stepOne(input: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepOne\" });\n    \u002F\u002F Full Node.js access here — fetch, db calls, etc.\n    const result = await doWork(input);\n    await writer.write({ type: \"step_done\", name: \"stepOne\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n\nasync function stepTwo(data: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepTwo\" });\n    const result = await processData(data);\n    await writer.write({ type: \"step_done\", name: \"stepTwo\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n",[1873],{"type":412,"tag":460,"props":1874,"children":1875},{"__ignoreMap":614},[1876,1915,1922,1944,2002,2055,2110,2118,2196,2216,2224,2269,2311,2319,2340,2349,2357,2417,2437,2493,2506,2594,2603,2645,2729,2746,2764,2790,2799,2807,2815,2871,2891,2943,2955,3040,3081,3165,3181,3197,3221,3229],{"type":412,"tag":620,"props":1877,"children":1878},{"class":622,"line":623},[1879,1883,1887,1891,1895,1899,1903,1907,1911],{"type":412,"tag":620,"props":1880,"children":1881},{"style":841},[1882],{"type":418,"value":844},{"type":412,"tag":620,"props":1884,"children":1885},{"style":847},[1886],{"type":418,"value":850},{"type":412,"tag":620,"props":1888,"children":1889},{"style":853},[1890],{"type":418,"value":1137},{"type":412,"tag":620,"props":1892,"children":1893},{"style":847},[1894],{"type":418,"value":861},{"type":412,"tag":620,"props":1896,"children":1897},{"style":841},[1898],{"type":418,"value":866},{"type":412,"tag":620,"props":1900,"children":1901},{"style":847},[1902],{"type":418,"value":871},{"type":412,"tag":620,"props":1904,"children":1905},{"style":633},[1906],{"type":418,"value":4},{"type":412,"tag":620,"props":1908,"children":1909},{"style":847},[1910],{"type":418,"value":881},{"type":412,"tag":620,"props":1912,"children":1913},{"style":847},[1914],{"type":418,"value":886},{"type":412,"tag":620,"props":1916,"children":1917},{"class":622,"line":669},[1918],{"type":412,"tag":620,"props":1919,"children":1920},{"emptyLinePlaceholder":892},[1921],{"type":418,"value":895},{"type":412,"tag":620,"props":1923,"children":1924},{"class":622,"line":684},[1925,1929,1934,1939],{"type":412,"tag":620,"props":1926,"children":1927},{"style":841},[1928],{"type":418,"value":927},{"type":412,"tag":620,"props":1930,"children":1931},{"style":901},[1932],{"type":418,"value":1933}," type",{"type":412,"tag":620,"props":1935,"children":1936},{"style":627},[1937],{"type":418,"value":1938}," MyEvent",{"type":412,"tag":620,"props":1940,"children":1941},{"style":847},[1942],{"type":418,"value":1943}," =\n",{"type":412,"tag":620,"props":1945,"children":1946},{"class":622,"line":407},[1947,1952,1956,1961,1965,1969,1974,1978,1983,1988,1992,1997],{"type":412,"tag":620,"props":1948,"children":1949},{"style":847},[1950],{"type":418,"value":1951},"  |",{"type":412,"tag":620,"props":1953,"children":1954},{"style":847},[1955],{"type":418,"value":850},{"type":412,"tag":620,"props":1957,"children":1959},{"style":1958},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1960],{"type":418,"value":1933},{"type":412,"tag":620,"props":1962,"children":1963},{"style":847},[1964],{"type":418,"value":826},{"type":412,"tag":620,"props":1966,"children":1967},{"style":847},[1968],{"type":418,"value":871},{"type":412,"tag":620,"props":1970,"children":1971},{"style":633},[1972],{"type":418,"value":1973},"step_start",{"type":412,"tag":620,"props":1975,"children":1976},{"style":847},[1977],{"type":418,"value":881},{"type":412,"tag":620,"props":1979,"children":1980},{"style":847},[1981],{"type":418,"value":1982},";",{"type":412,"tag":620,"props":1984,"children":1985},{"style":1958},[1986],{"type":418,"value":1987}," name",{"type":412,"tag":620,"props":1989,"children":1990},{"style":847},[1991],{"type":418,"value":826},{"type":412,"tag":620,"props":1993,"children":1994},{"style":627},[1995],{"type":418,"value":1996}," string",{"type":412,"tag":620,"props":1998,"children":1999},{"style":847},[2000],{"type":418,"value":2001}," }\n",{"type":412,"tag":620,"props":2003,"children":2005},{"class":622,"line":2004},5,[2006,2010,2014,2018,2022,2026,2031,2035,2039,2043,2047,2051],{"type":412,"tag":620,"props":2007,"children":2008},{"style":847},[2009],{"type":418,"value":1951},{"type":412,"tag":620,"props":2011,"children":2012},{"style":847},[2013],{"type":418,"value":850},{"type":412,"tag":620,"props":2015,"children":2016},{"style":1958},[2017],{"type":418,"value":1933},{"type":412,"tag":620,"props":2019,"children":2020},{"style":847},[2021],{"type":418,"value":826},{"type":412,"tag":620,"props":2023,"children":2024},{"style":847},[2025],{"type":418,"value":871},{"type":412,"tag":620,"props":2027,"children":2028},{"style":633},[2029],{"type":418,"value":2030},"step_done",{"type":412,"tag":620,"props":2032,"children":2033},{"style":847},[2034],{"type":418,"value":881},{"type":412,"tag":620,"props":2036,"children":2037},{"style":847},[2038],{"type":418,"value":1982},{"type":412,"tag":620,"props":2040,"children":2041},{"style":1958},[2042],{"type":418,"value":1987},{"type":412,"tag":620,"props":2044,"children":2045},{"style":847},[2046],{"type":418,"value":826},{"type":412,"tag":620,"props":2048,"children":2049},{"style":627},[2050],{"type":418,"value":1996},{"type":412,"tag":620,"props":2052,"children":2053},{"style":847},[2054],{"type":418,"value":2001},{"type":412,"tag":620,"props":2056,"children":2058},{"class":622,"line":2057},6,[2059,2063,2067,2071,2075,2079,2084,2088,2092,2097,2101,2105],{"type":412,"tag":620,"props":2060,"children":2061},{"style":847},[2062],{"type":418,"value":1951},{"type":412,"tag":620,"props":2064,"children":2065},{"style":847},[2066],{"type":418,"value":850},{"type":412,"tag":620,"props":2068,"children":2069},{"style":1958},[2070],{"type":418,"value":1933},{"type":412,"tag":620,"props":2072,"children":2073},{"style":847},[2074],{"type":418,"value":826},{"type":412,"tag":620,"props":2076,"children":2077},{"style":847},[2078],{"type":418,"value":871},{"type":412,"tag":620,"props":2080,"children":2081},{"style":633},[2082],{"type":418,"value":2083},"done",{"type":412,"tag":620,"props":2085,"children":2086},{"style":847},[2087],{"type":418,"value":881},{"type":412,"tag":620,"props":2089,"children":2090},{"style":847},[2091],{"type":418,"value":1982},{"type":412,"tag":620,"props":2093,"children":2094},{"style":1958},[2095],{"type":418,"value":2096}," result",{"type":412,"tag":620,"props":2098,"children":2099},{"style":847},[2100],{"type":418,"value":826},{"type":412,"tag":620,"props":2102,"children":2103},{"style":627},[2104],{"type":418,"value":1996},{"type":412,"tag":620,"props":2106,"children":2107},{"style":847},[2108],{"type":418,"value":2109}," };\n",{"type":412,"tag":620,"props":2111,"children":2113},{"class":622,"line":2112},7,[2114],{"type":412,"tag":620,"props":2115,"children":2116},{"emptyLinePlaceholder":892},[2117],{"type":418,"value":895},{"type":412,"tag":620,"props":2119,"children":2121},{"class":622,"line":2120},8,[2122,2126,2131,2136,2141,2146,2152,2156,2160,2164,2169,2174,2178,2182,2186,2191],{"type":412,"tag":620,"props":2123,"children":2124},{"style":841},[2125],{"type":418,"value":927},{"type":412,"tag":620,"props":2127,"children":2128},{"style":901},[2129],{"type":418,"value":2130}," async",{"type":412,"tag":620,"props":2132,"children":2133},{"style":901},[2134],{"type":418,"value":2135}," function",{"type":412,"tag":620,"props":2137,"children":2138},{"style":673},[2139],{"type":418,"value":2140}," myWorkflow",{"type":412,"tag":620,"props":2142,"children":2143},{"style":847},[2144],{"type":418,"value":2145},"(",{"type":412,"tag":620,"props":2147,"children":2149},{"style":2148},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2150],{"type":418,"value":2151},"input",{"type":412,"tag":620,"props":2153,"children":2154},{"style":847},[2155],{"type":418,"value":826},{"type":412,"tag":620,"props":2157,"children":2158},{"style":627},[2159],{"type":418,"value":1996},{"type":412,"tag":620,"props":2161,"children":2162},{"style":847},[2163],{"type":418,"value":1114},{"type":412,"tag":620,"props":2165,"children":2166},{"style":627},[2167],{"type":418,"value":2168}," Promise",{"type":412,"tag":620,"props":2170,"children":2171},{"style":847},[2172],{"type":418,"value":2173},"\u003C{",{"type":412,"tag":620,"props":2175,"children":2176},{"style":1958},[2177],{"type":418,"value":2096},{"type":412,"tag":620,"props":2179,"children":2180},{"style":847},[2181],{"type":418,"value":826},{"type":412,"tag":620,"props":2183,"children":2184},{"style":627},[2185],{"type":418,"value":1996},{"type":412,"tag":620,"props":2187,"children":2188},{"style":847},[2189],{"type":418,"value":2190}," }>",{"type":412,"tag":620,"props":2192,"children":2193},{"style":847},[2194],{"type":418,"value":2195}," {\n",{"type":412,"tag":620,"props":2197,"children":2198},{"class":622,"line":33},[2199,2204,2208,2212],{"type":412,"tag":620,"props":2200,"children":2201},{"style":847},[2202],{"type":418,"value":2203},"  \"",{"type":412,"tag":620,"props":2205,"children":2206},{"style":633},[2207],{"type":418,"value":89},{"type":412,"tag":620,"props":2209,"children":2210},{"style":847},[2211],{"type":418,"value":881},{"type":412,"tag":620,"props":2213,"children":2214},{"style":847},[2215],{"type":418,"value":886},{"type":412,"tag":620,"props":2217,"children":2219},{"class":622,"line":2218},10,[2220],{"type":412,"tag":620,"props":2221,"children":2222},{"emptyLinePlaceholder":892},[2223],{"type":418,"value":895},{"type":412,"tag":620,"props":2225,"children":2227},{"class":622,"line":2226},11,[2228,2233,2238,2243,2248,2253,2257,2261,2265],{"type":412,"tag":620,"props":2229,"children":2230},{"style":901},[2231],{"type":418,"value":2232},"  const",{"type":412,"tag":620,"props":2234,"children":2235},{"style":853},[2236],{"type":418,"value":2237}," data",{"type":412,"tag":620,"props":2239,"children":2240},{"style":847},[2241],{"type":418,"value":2242}," =",{"type":412,"tag":620,"props":2244,"children":2245},{"style":841},[2246],{"type":418,"value":2247}," await",{"type":412,"tag":620,"props":2249,"children":2250},{"style":673},[2251],{"type":418,"value":2252}," stepOne",{"type":412,"tag":620,"props":2254,"children":2255},{"style":1958},[2256],{"type":418,"value":2145},{"type":412,"tag":620,"props":2258,"children":2259},{"style":853},[2260],{"type":418,"value":2151},{"type":412,"tag":620,"props":2262,"children":2263},{"style":1958},[2264],{"type":418,"value":1868},{"type":412,"tag":620,"props":2266,"children":2267},{"style":847},[2268],{"type":418,"value":886},{"type":412,"tag":620,"props":2270,"children":2272},{"class":622,"line":2271},12,[2273,2277,2281,2285,2289,2294,2298,2303,2307],{"type":412,"tag":620,"props":2274,"children":2275},{"style":901},[2276],{"type":418,"value":2232},{"type":412,"tag":620,"props":2278,"children":2279},{"style":853},[2280],{"type":418,"value":2096},{"type":412,"tag":620,"props":2282,"children":2283},{"style":847},[2284],{"type":418,"value":2242},{"type":412,"tag":620,"props":2286,"children":2287},{"style":841},[2288],{"type":418,"value":2247},{"type":412,"tag":620,"props":2290,"children":2291},{"style":673},[2292],{"type":418,"value":2293}," stepTwo",{"type":412,"tag":620,"props":2295,"children":2296},{"style":1958},[2297],{"type":418,"value":2145},{"type":412,"tag":620,"props":2299,"children":2300},{"style":853},[2301],{"type":418,"value":2302},"data",{"type":412,"tag":620,"props":2304,"children":2305},{"style":1958},[2306],{"type":418,"value":1868},{"type":412,"tag":620,"props":2308,"children":2309},{"style":847},[2310],{"type":418,"value":886},{"type":412,"tag":620,"props":2312,"children":2314},{"class":622,"line":2313},13,[2315],{"type":412,"tag":620,"props":2316,"children":2317},{"emptyLinePlaceholder":892},[2318],{"type":418,"value":895},{"type":412,"tag":620,"props":2320,"children":2322},{"class":622,"line":2321},14,[2323,2328,2332,2336],{"type":412,"tag":620,"props":2324,"children":2325},{"style":841},[2326],{"type":418,"value":2327},"  return",{"type":412,"tag":620,"props":2329,"children":2330},{"style":847},[2331],{"type":418,"value":850},{"type":412,"tag":620,"props":2333,"children":2334},{"style":853},[2335],{"type":418,"value":2096},{"type":412,"tag":620,"props":2337,"children":2338},{"style":847},[2339],{"type":418,"value":2109},{"type":412,"tag":620,"props":2341,"children":2343},{"class":622,"line":2342},15,[2344],{"type":412,"tag":620,"props":2345,"children":2346},{"style":847},[2347],{"type":418,"value":2348},"}\n",{"type":412,"tag":620,"props":2350,"children":2352},{"class":622,"line":2351},16,[2353],{"type":412,"tag":620,"props":2354,"children":2355},{"emptyLinePlaceholder":892},[2356],{"type":418,"value":895},{"type":412,"tag":620,"props":2358,"children":2360},{"class":622,"line":2359},17,[2361,2366,2370,2374,2378,2382,2386,2390,2394,2398,2403,2408,2413],{"type":412,"tag":620,"props":2362,"children":2363},{"style":901},[2364],{"type":418,"value":2365},"async",{"type":412,"tag":620,"props":2367,"children":2368},{"style":901},[2369],{"type":418,"value":2135},{"type":412,"tag":620,"props":2371,"children":2372},{"style":673},[2373],{"type":418,"value":2252},{"type":412,"tag":620,"props":2375,"children":2376},{"style":847},[2377],{"type":418,"value":2145},{"type":412,"tag":620,"props":2379,"children":2380},{"style":2148},[2381],{"type":418,"value":2151},{"type":412,"tag":620,"props":2383,"children":2384},{"style":847},[2385],{"type":418,"value":826},{"type":412,"tag":620,"props":2387,"children":2388},{"style":627},[2389],{"type":418,"value":1996},{"type":412,"tag":620,"props":2391,"children":2392},{"style":847},[2393],{"type":418,"value":1114},{"type":412,"tag":620,"props":2395,"children":2396},{"style":627},[2397],{"type":418,"value":2168},{"type":412,"tag":620,"props":2399,"children":2400},{"style":847},[2401],{"type":418,"value":2402},"\u003C",{"type":412,"tag":620,"props":2404,"children":2405},{"style":627},[2406],{"type":418,"value":2407},"string",{"type":412,"tag":620,"props":2409,"children":2410},{"style":847},[2411],{"type":418,"value":2412},">",{"type":412,"tag":620,"props":2414,"children":2415},{"style":847},[2416],{"type":418,"value":2195},{"type":412,"tag":620,"props":2418,"children":2420},{"class":622,"line":2419},18,[2421,2425,2429,2433],{"type":412,"tag":620,"props":2422,"children":2423},{"style":847},[2424],{"type":418,"value":2203},{"type":412,"tag":620,"props":2426,"children":2427},{"style":633},[2428],{"type":418,"value":90},{"type":412,"tag":620,"props":2430,"children":2431},{"style":847},[2432],{"type":418,"value":881},{"type":412,"tag":620,"props":2434,"children":2435},{"style":847},[2436],{"type":418,"value":886},{"type":412,"tag":620,"props":2438,"children":2440},{"class":622,"line":2439},19,[2441,2445,2450,2454,2458,2462,2467,2471,2476,2480,2485,2489],{"type":412,"tag":620,"props":2442,"children":2443},{"style":901},[2444],{"type":418,"value":2232},{"type":412,"tag":620,"props":2446,"children":2447},{"style":853},[2448],{"type":418,"value":2449}," writer",{"type":412,"tag":620,"props":2451,"children":2452},{"style":847},[2453],{"type":418,"value":2242},{"type":412,"tag":620,"props":2455,"children":2456},{"style":673},[2457],{"type":418,"value":1137},{"type":412,"tag":620,"props":2459,"children":2460},{"style":847},[2461],{"type":418,"value":2402},{"type":412,"tag":620,"props":2463,"children":2464},{"style":627},[2465],{"type":418,"value":2466},"MyEvent",{"type":412,"tag":620,"props":2468,"children":2469},{"style":847},[2470],{"type":418,"value":2412},{"type":412,"tag":620,"props":2472,"children":2473},{"style":1958},[2474],{"type":418,"value":2475},"()",{"type":412,"tag":620,"props":2477,"children":2478},{"style":847},[2479],{"type":418,"value":1090},{"type":412,"tag":620,"props":2481,"children":2482},{"style":673},[2483],{"type":418,"value":2484},"getWriter",{"type":412,"tag":620,"props":2486,"children":2487},{"style":1958},[2488],{"type":418,"value":2475},{"type":412,"tag":620,"props":2490,"children":2491},{"style":847},[2492],{"type":418,"value":886},{"type":412,"tag":620,"props":2494,"children":2496},{"class":622,"line":2495},20,[2497,2502],{"type":412,"tag":620,"props":2498,"children":2499},{"style":841},[2500],{"type":418,"value":2501},"  try",{"type":412,"tag":620,"props":2503,"children":2504},{"style":847},[2505],{"type":418,"value":2195},{"type":412,"tag":620,"props":2507,"children":2509},{"class":622,"line":2508},21,[2510,2515,2519,2523,2528,2532,2537,2541,2545,2549,2553,2557,2561,2565,2569,2573,2578,2582,2586,2590],{"type":412,"tag":620,"props":2511,"children":2512},{"style":841},[2513],{"type":418,"value":2514},"    await",{"type":412,"tag":620,"props":2516,"children":2517},{"style":853},[2518],{"type":418,"value":2449},{"type":412,"tag":620,"props":2520,"children":2521},{"style":847},[2522],{"type":418,"value":1090},{"type":412,"tag":620,"props":2524,"children":2525},{"style":673},[2526],{"type":418,"value":2527},"write",{"type":412,"tag":620,"props":2529,"children":2530},{"style":1958},[2531],{"type":418,"value":2145},{"type":412,"tag":620,"props":2533,"children":2534},{"style":847},[2535],{"type":418,"value":2536},"{",{"type":412,"tag":620,"props":2538,"children":2539},{"style":1958},[2540],{"type":418,"value":1933},{"type":412,"tag":620,"props":2542,"children":2543},{"style":847},[2544],{"type":418,"value":826},{"type":412,"tag":620,"props":2546,"children":2547},{"style":847},[2548],{"type":418,"value":871},{"type":412,"tag":620,"props":2550,"children":2551},{"style":633},[2552],{"type":418,"value":1973},{"type":412,"tag":620,"props":2554,"children":2555},{"style":847},[2556],{"type":418,"value":881},{"type":412,"tag":620,"props":2558,"children":2559},{"style":847},[2560],{"type":418,"value":1142},{"type":412,"tag":620,"props":2562,"children":2563},{"style":1958},[2564],{"type":418,"value":1987},{"type":412,"tag":620,"props":2566,"children":2567},{"style":847},[2568],{"type":418,"value":826},{"type":412,"tag":620,"props":2570,"children":2571},{"style":847},[2572],{"type":418,"value":871},{"type":412,"tag":620,"props":2574,"children":2575},{"style":633},[2576],{"type":418,"value":2577},"stepOne",{"type":412,"tag":620,"props":2579,"children":2580},{"style":847},[2581],{"type":418,"value":881},{"type":412,"tag":620,"props":2583,"children":2584},{"style":847},[2585],{"type":418,"value":861},{"type":412,"tag":620,"props":2587,"children":2588},{"style":1958},[2589],{"type":418,"value":1868},{"type":412,"tag":620,"props":2591,"children":2592},{"style":847},[2593],{"type":418,"value":886},{"type":412,"tag":620,"props":2595,"children":2597},{"class":622,"line":2596},22,[2598],{"type":412,"tag":620,"props":2599,"children":2600},{"style":1005},[2601],{"type":418,"value":2602},"    \u002F\u002F Full Node.js access here — fetch, db calls, etc.\n",{"type":412,"tag":620,"props":2604,"children":2606},{"class":622,"line":2605},23,[2607,2612,2616,2620,2624,2629,2633,2637,2641],{"type":412,"tag":620,"props":2608,"children":2609},{"style":901},[2610],{"type":418,"value":2611},"    const",{"type":412,"tag":620,"props":2613,"children":2614},{"style":853},[2615],{"type":418,"value":2096},{"type":412,"tag":620,"props":2617,"children":2618},{"style":847},[2619],{"type":418,"value":2242},{"type":412,"tag":620,"props":2621,"children":2622},{"style":841},[2623],{"type":418,"value":2247},{"type":412,"tag":620,"props":2625,"children":2626},{"style":673},[2627],{"type":418,"value":2628}," doWork",{"type":412,"tag":620,"props":2630,"children":2631},{"style":1958},[2632],{"type":418,"value":2145},{"type":412,"tag":620,"props":2634,"children":2635},{"style":853},[2636],{"type":418,"value":2151},{"type":412,"tag":620,"props":2638,"children":2639},{"style":1958},[2640],{"type":418,"value":1868},{"type":412,"tag":620,"props":2642,"children":2643},{"style":847},[2644],{"type":418,"value":886},{"type":412,"tag":620,"props":2646,"children":2648},{"class":622,"line":2647},24,[2649,2653,2657,2661,2665,2669,2673,2677,2681,2685,2689,2693,2697,2701,2705,2709,2713,2717,2721,2725],{"type":412,"tag":620,"props":2650,"children":2651},{"style":841},[2652],{"type":418,"value":2514},{"type":412,"tag":620,"props":2654,"children":2655},{"style":853},[2656],{"type":418,"value":2449},{"type":412,"tag":620,"props":2658,"children":2659},{"style":847},[2660],{"type":418,"value":1090},{"type":412,"tag":620,"props":2662,"children":2663},{"style":673},[2664],{"type":418,"value":2527},{"type":412,"tag":620,"props":2666,"children":2667},{"style":1958},[2668],{"type":418,"value":2145},{"type":412,"tag":620,"props":2670,"children":2671},{"style":847},[2672],{"type":418,"value":2536},{"type":412,"tag":620,"props":2674,"children":2675},{"style":1958},[2676],{"type":418,"value":1933},{"type":412,"tag":620,"props":2678,"children":2679},{"style":847},[2680],{"type":418,"value":826},{"type":412,"tag":620,"props":2682,"children":2683},{"style":847},[2684],{"type":418,"value":871},{"type":412,"tag":620,"props":2686,"children":2687},{"style":633},[2688],{"type":418,"value":2030},{"type":412,"tag":620,"props":2690,"children":2691},{"style":847},[2692],{"type":418,"value":881},{"type":412,"tag":620,"props":2694,"children":2695},{"style":847},[2696],{"type":418,"value":1142},{"type":412,"tag":620,"props":2698,"children":2699},{"style":1958},[2700],{"type":418,"value":1987},{"type":412,"tag":620,"props":2702,"children":2703},{"style":847},[2704],{"type":418,"value":826},{"type":412,"tag":620,"props":2706,"children":2707},{"style":847},[2708],{"type":418,"value":871},{"type":412,"tag":620,"props":2710,"children":2711},{"style":633},[2712],{"type":418,"value":2577},{"type":412,"tag":620,"props":2714,"children":2715},{"style":847},[2716],{"type":418,"value":881},{"type":412,"tag":620,"props":2718,"children":2719},{"style":847},[2720],{"type":418,"value":861},{"type":412,"tag":620,"props":2722,"children":2723},{"style":1958},[2724],{"type":418,"value":1868},{"type":412,"tag":620,"props":2726,"children":2727},{"style":847},[2728],{"type":418,"value":886},{"type":412,"tag":620,"props":2730,"children":2732},{"class":622,"line":2731},25,[2733,2738,2742],{"type":412,"tag":620,"props":2734,"children":2735},{"style":841},[2736],{"type":418,"value":2737},"    return",{"type":412,"tag":620,"props":2739,"children":2740},{"style":853},[2741],{"type":418,"value":2096},{"type":412,"tag":620,"props":2743,"children":2744},{"style":847},[2745],{"type":418,"value":886},{"type":412,"tag":620,"props":2747,"children":2749},{"class":622,"line":2748},26,[2750,2755,2760],{"type":412,"tag":620,"props":2751,"children":2752},{"style":847},[2753],{"type":418,"value":2754},"  }",{"type":412,"tag":620,"props":2756,"children":2757},{"style":841},[2758],{"type":418,"value":2759}," finally",{"type":412,"tag":620,"props":2761,"children":2762},{"style":847},[2763],{"type":418,"value":2195},{"type":412,"tag":620,"props":2765,"children":2767},{"class":622,"line":2766},27,[2768,2773,2777,2782,2786],{"type":412,"tag":620,"props":2769,"children":2770},{"style":853},[2771],{"type":418,"value":2772},"    writer",{"type":412,"tag":620,"props":2774,"children":2775},{"style":847},[2776],{"type":418,"value":1090},{"type":412,"tag":620,"props":2778,"children":2779},{"style":673},[2780],{"type":418,"value":2781},"releaseLock",{"type":412,"tag":620,"props":2783,"children":2784},{"style":1958},[2785],{"type":418,"value":2475},{"type":412,"tag":620,"props":2787,"children":2788},{"style":847},[2789],{"type":418,"value":886},{"type":412,"tag":620,"props":2791,"children":2793},{"class":622,"line":2792},28,[2794],{"type":412,"tag":620,"props":2795,"children":2796},{"style":847},[2797],{"type":418,"value":2798},"  }\n",{"type":412,"tag":620,"props":2800,"children":2802},{"class":622,"line":2801},29,[2803],{"type":412,"tag":620,"props":2804,"children":2805},{"style":847},[2806],{"type":418,"value":2348},{"type":412,"tag":620,"props":2808,"children":2810},{"class":622,"line":2809},30,[2811],{"type":412,"tag":620,"props":2812,"children":2813},{"emptyLinePlaceholder":892},[2814],{"type":418,"value":895},{"type":412,"tag":620,"props":2816,"children":2818},{"class":622,"line":2817},31,[2819,2823,2827,2831,2835,2839,2843,2847,2851,2855,2859,2863,2867],{"type":412,"tag":620,"props":2820,"children":2821},{"style":901},[2822],{"type":418,"value":2365},{"type":412,"tag":620,"props":2824,"children":2825},{"style":901},[2826],{"type":418,"value":2135},{"type":412,"tag":620,"props":2828,"children":2829},{"style":673},[2830],{"type":418,"value":2293},{"type":412,"tag":620,"props":2832,"children":2833},{"style":847},[2834],{"type":418,"value":2145},{"type":412,"tag":620,"props":2836,"children":2837},{"style":2148},[2838],{"type":418,"value":2302},{"type":412,"tag":620,"props":2840,"children":2841},{"style":847},[2842],{"type":418,"value":826},{"type":412,"tag":620,"props":2844,"children":2845},{"style":627},[2846],{"type":418,"value":1996},{"type":412,"tag":620,"props":2848,"children":2849},{"style":847},[2850],{"type":418,"value":1114},{"type":412,"tag":620,"props":2852,"children":2853},{"style":627},[2854],{"type":418,"value":2168},{"type":412,"tag":620,"props":2856,"children":2857},{"style":847},[2858],{"type":418,"value":2402},{"type":412,"tag":620,"props":2860,"children":2861},{"style":627},[2862],{"type":418,"value":2407},{"type":412,"tag":620,"props":2864,"children":2865},{"style":847},[2866],{"type":418,"value":2412},{"type":412,"tag":620,"props":2868,"children":2869},{"style":847},[2870],{"type":418,"value":2195},{"type":412,"tag":620,"props":2872,"children":2874},{"class":622,"line":2873},32,[2875,2879,2883,2887],{"type":412,"tag":620,"props":2876,"children":2877},{"style":847},[2878],{"type":418,"value":2203},{"type":412,"tag":620,"props":2880,"children":2881},{"style":633},[2882],{"type":418,"value":90},{"type":412,"tag":620,"props":2884,"children":2885},{"style":847},[2886],{"type":418,"value":881},{"type":412,"tag":620,"props":2888,"children":2889},{"style":847},[2890],{"type":418,"value":886},{"type":412,"tag":620,"props":2892,"children":2894},{"class":622,"line":2893},33,[2895,2899,2903,2907,2911,2915,2919,2923,2927,2931,2935,2939],{"type":412,"tag":620,"props":2896,"children":2897},{"style":901},[2898],{"type":418,"value":2232},{"type":412,"tag":620,"props":2900,"children":2901},{"style":853},[2902],{"type":418,"value":2449},{"type":412,"tag":620,"props":2904,"children":2905},{"style":847},[2906],{"type":418,"value":2242},{"type":412,"tag":620,"props":2908,"children":2909},{"style":673},[2910],{"type":418,"value":1137},{"type":412,"tag":620,"props":2912,"children":2913},{"style":847},[2914],{"type":418,"value":2402},{"type":412,"tag":620,"props":2916,"children":2917},{"style":627},[2918],{"type":418,"value":2466},{"type":412,"tag":620,"props":2920,"children":2921},{"style":847},[2922],{"type":418,"value":2412},{"type":412,"tag":620,"props":2924,"children":2925},{"style":1958},[2926],{"type":418,"value":2475},{"type":412,"tag":620,"props":2928,"children":2929},{"style":847},[2930],{"type":418,"value":1090},{"type":412,"tag":620,"props":2932,"children":2933},{"style":673},[2934],{"type":418,"value":2484},{"type":412,"tag":620,"props":2936,"children":2937},{"style":1958},[2938],{"type":418,"value":2475},{"type":412,"tag":620,"props":2940,"children":2941},{"style":847},[2942],{"type":418,"value":886},{"type":412,"tag":620,"props":2944,"children":2946},{"class":622,"line":2945},34,[2947,2951],{"type":412,"tag":620,"props":2948,"children":2949},{"style":841},[2950],{"type":418,"value":2501},{"type":412,"tag":620,"props":2952,"children":2953},{"style":847},[2954],{"type":418,"value":2195},{"type":412,"tag":620,"props":2956,"children":2958},{"class":622,"line":2957},35,[2959,2963,2967,2971,2975,2979,2983,2987,2991,2995,2999,3003,3007,3011,3015,3019,3024,3028,3032,3036],{"type":412,"tag":620,"props":2960,"children":2961},{"style":841},[2962],{"type":418,"value":2514},{"type":412,"tag":620,"props":2964,"children":2965},{"style":853},[2966],{"type":418,"value":2449},{"type":412,"tag":620,"props":2968,"children":2969},{"style":847},[2970],{"type":418,"value":1090},{"type":412,"tag":620,"props":2972,"children":2973},{"style":673},[2974],{"type":418,"value":2527},{"type":412,"tag":620,"props":2976,"children":2977},{"style":1958},[2978],{"type":418,"value":2145},{"type":412,"tag":620,"props":2980,"children":2981},{"style":847},[2982],{"type":418,"value":2536},{"type":412,"tag":620,"props":2984,"children":2985},{"style":1958},[2986],{"type":418,"value":1933},{"type":412,"tag":620,"props":2988,"children":2989},{"style":847},[2990],{"type":418,"value":826},{"type":412,"tag":620,"props":2992,"children":2993},{"style":847},[2994],{"type":418,"value":871},{"type":412,"tag":620,"props":2996,"children":2997},{"style":633},[2998],{"type":418,"value":1973},{"type":412,"tag":620,"props":3000,"children":3001},{"style":847},[3002],{"type":418,"value":881},{"type":412,"tag":620,"props":3004,"children":3005},{"style":847},[3006],{"type":418,"value":1142},{"type":412,"tag":620,"props":3008,"children":3009},{"style":1958},[3010],{"type":418,"value":1987},{"type":412,"tag":620,"props":3012,"children":3013},{"style":847},[3014],{"type":418,"value":826},{"type":412,"tag":620,"props":3016,"children":3017},{"style":847},[3018],{"type":418,"value":871},{"type":412,"tag":620,"props":3020,"children":3021},{"style":633},[3022],{"type":418,"value":3023},"stepTwo",{"type":412,"tag":620,"props":3025,"children":3026},{"style":847},[3027],{"type":418,"value":881},{"type":412,"tag":620,"props":3029,"children":3030},{"style":847},[3031],{"type":418,"value":861},{"type":412,"tag":620,"props":3033,"children":3034},{"style":1958},[3035],{"type":418,"value":1868},{"type":412,"tag":620,"props":3037,"children":3038},{"style":847},[3039],{"type":418,"value":886},{"type":412,"tag":620,"props":3041,"children":3043},{"class":622,"line":3042},36,[3044,3048,3052,3056,3060,3065,3069,3073,3077],{"type":412,"tag":620,"props":3045,"children":3046},{"style":901},[3047],{"type":418,"value":2611},{"type":412,"tag":620,"props":3049,"children":3050},{"style":853},[3051],{"type":418,"value":2096},{"type":412,"tag":620,"props":3053,"children":3054},{"style":847},[3055],{"type":418,"value":2242},{"type":412,"tag":620,"props":3057,"children":3058},{"style":841},[3059],{"type":418,"value":2247},{"type":412,"tag":620,"props":3061,"children":3062},{"style":673},[3063],{"type":418,"value":3064}," processData",{"type":412,"tag":620,"props":3066,"children":3067},{"style":1958},[3068],{"type":418,"value":2145},{"type":412,"tag":620,"props":3070,"children":3071},{"style":853},[3072],{"type":418,"value":2302},{"type":412,"tag":620,"props":3074,"children":3075},{"style":1958},[3076],{"type":418,"value":1868},{"type":412,"tag":620,"props":3078,"children":3079},{"style":847},[3080],{"type":418,"value":886},{"type":412,"tag":620,"props":3082,"children":3084},{"class":622,"line":3083},37,[3085,3089,3093,3097,3101,3105,3109,3113,3117,3121,3125,3129,3133,3137,3141,3145,3149,3153,3157,3161],{"type":412,"tag":620,"props":3086,"children":3087},{"style":841},[3088],{"type":418,"value":2514},{"type":412,"tag":620,"props":3090,"children":3091},{"style":853},[3092],{"type":418,"value":2449},{"type":412,"tag":620,"props":3094,"children":3095},{"style":847},[3096],{"type":418,"value":1090},{"type":412,"tag":620,"props":3098,"children":3099},{"style":673},[3100],{"type":418,"value":2527},{"type":412,"tag":620,"props":3102,"children":3103},{"style":1958},[3104],{"type":418,"value":2145},{"type":412,"tag":620,"props":3106,"children":3107},{"style":847},[3108],{"type":418,"value":2536},{"type":412,"tag":620,"props":3110,"children":3111},{"style":1958},[3112],{"type":418,"value":1933},{"type":412,"tag":620,"props":3114,"children":3115},{"style":847},[3116],{"type":418,"value":826},{"type":412,"tag":620,"props":3118,"children":3119},{"style":847},[3120],{"type":418,"value":871},{"type":412,"tag":620,"props":3122,"children":3123},{"style":633},[3124],{"type":418,"value":2030},{"type":412,"tag":620,"props":3126,"children":3127},{"style":847},[3128],{"type":418,"value":881},{"type":412,"tag":620,"props":3130,"children":3131},{"style":847},[3132],{"type":418,"value":1142},{"type":412,"tag":620,"props":3134,"children":3135},{"style":1958},[3136],{"type":418,"value":1987},{"type":412,"tag":620,"props":3138,"children":3139},{"style":847},[3140],{"type":418,"value":826},{"type":412,"tag":620,"props":3142,"children":3143},{"style":847},[3144],{"type":418,"value":871},{"type":412,"tag":620,"props":3146,"children":3147},{"style":633},[3148],{"type":418,"value":3023},{"type":412,"tag":620,"props":3150,"children":3151},{"style":847},[3152],{"type":418,"value":881},{"type":412,"tag":620,"props":3154,"children":3155},{"style":847},[3156],{"type":418,"value":861},{"type":412,"tag":620,"props":3158,"children":3159},{"style":1958},[3160],{"type":418,"value":1868},{"type":412,"tag":620,"props":3162,"children":3163},{"style":847},[3164],{"type":418,"value":886},{"type":412,"tag":620,"props":3166,"children":3168},{"class":622,"line":3167},38,[3169,3173,3177],{"type":412,"tag":620,"props":3170,"children":3171},{"style":841},[3172],{"type":418,"value":2737},{"type":412,"tag":620,"props":3174,"children":3175},{"style":853},[3176],{"type":418,"value":2096},{"type":412,"tag":620,"props":3178,"children":3179},{"style":847},[3180],{"type":418,"value":886},{"type":412,"tag":620,"props":3182,"children":3184},{"class":622,"line":3183},39,[3185,3189,3193],{"type":412,"tag":620,"props":3186,"children":3187},{"style":847},[3188],{"type":418,"value":2754},{"type":412,"tag":620,"props":3190,"children":3191},{"style":841},[3192],{"type":418,"value":2759},{"type":412,"tag":620,"props":3194,"children":3195},{"style":847},[3196],{"type":418,"value":2195},{"type":412,"tag":620,"props":3198,"children":3200},{"class":622,"line":3199},40,[3201,3205,3209,3213,3217],{"type":412,"tag":620,"props":3202,"children":3203},{"style":853},[3204],{"type":418,"value":2772},{"type":412,"tag":620,"props":3206,"children":3207},{"style":847},[3208],{"type":418,"value":1090},{"type":412,"tag":620,"props":3210,"children":3211},{"style":673},[3212],{"type":418,"value":2781},{"type":412,"tag":620,"props":3214,"children":3215},{"style":1958},[3216],{"type":418,"value":2475},{"type":412,"tag":620,"props":3218,"children":3219},{"style":847},[3220],{"type":418,"value":886},{"type":412,"tag":620,"props":3222,"children":3224},{"class":622,"line":3223},41,[3225],{"type":412,"tag":620,"props":3226,"children":3227},{"style":847},[3228],{"type":418,"value":2798},{"type":412,"tag":620,"props":3230,"children":3232},{"class":622,"line":3231},42,[3233],{"type":412,"tag":620,"props":3234,"children":3235},{"style":847},[3236],{"type":418,"value":2348},{"type":412,"tag":800,"props":3238,"children":3240},{"id":3239},"_2-start-route-appapimy-workflowroutets",[3241,3243,3249],{"type":418,"value":3242},"2. Start Route (",{"type":412,"tag":460,"props":3244,"children":3246},{"className":3245},[],[3247],{"type":418,"value":3248},"app\u002Fapi\u002Fmy-workflow\u002Froute.ts",{"type":418,"value":1868},{"type":412,"tag":609,"props":3251,"children":3253},{"className":829,"code":3252,"language":831,"meta":614,"style":614},"import { NextResponse } from \"next\u002Fserver\";\nimport { start } from \"workflow\u002Fapi\";\nimport { myWorkflow } from \"@\u002Fworkflows\u002Fmy-workflow\";\n\nexport async function POST(request: Request) {\n  const body = await request.json();\n  const run = await start(myWorkflow, [body.input]);\n  return NextResponse.json({ runId: run.runId });\n}\n",[3254],{"type":412,"tag":460,"props":3255,"children":3256},{"__ignoreMap":614},[3257,3298,3337,3376,3383,3429,3471,3535,3596],{"type":412,"tag":620,"props":3258,"children":3259},{"class":622,"line":623},[3260,3264,3268,3273,3277,3281,3285,3290,3294],{"type":412,"tag":620,"props":3261,"children":3262},{"style":841},[3263],{"type":418,"value":844},{"type":412,"tag":620,"props":3265,"children":3266},{"style":847},[3267],{"type":418,"value":850},{"type":412,"tag":620,"props":3269,"children":3270},{"style":853},[3271],{"type":418,"value":3272}," NextResponse",{"type":412,"tag":620,"props":3274,"children":3275},{"style":847},[3276],{"type":418,"value":861},{"type":412,"tag":620,"props":3278,"children":3279},{"style":841},[3280],{"type":418,"value":866},{"type":412,"tag":620,"props":3282,"children":3283},{"style":847},[3284],{"type":418,"value":871},{"type":412,"tag":620,"props":3286,"children":3287},{"style":633},[3288],{"type":418,"value":3289},"next\u002Fserver",{"type":412,"tag":620,"props":3291,"children":3292},{"style":847},[3293],{"type":418,"value":881},{"type":412,"tag":620,"props":3295,"children":3296},{"style":847},[3297],{"type":418,"value":886},{"type":412,"tag":620,"props":3299,"children":3300},{"class":622,"line":669},[3301,3305,3309,3313,3317,3321,3325,3329,3333],{"type":412,"tag":620,"props":3302,"children":3303},{"style":841},[3304],{"type":418,"value":844},{"type":412,"tag":620,"props":3306,"children":3307},{"style":847},[3308],{"type":418,"value":850},{"type":412,"tag":620,"props":3310,"children":3311},{"style":853},[3312],{"type":418,"value":1344},{"type":412,"tag":620,"props":3314,"children":3315},{"style":847},[3316],{"type":418,"value":861},{"type":412,"tag":620,"props":3318,"children":3319},{"style":841},[3320],{"type":418,"value":866},{"type":412,"tag":620,"props":3322,"children":3323},{"style":847},[3324],{"type":418,"value":871},{"type":412,"tag":620,"props":3326,"children":3327},{"style":633},[3328],{"type":418,"value":1388},{"type":412,"tag":620,"props":3330,"children":3331},{"style":847},[3332],{"type":418,"value":881},{"type":412,"tag":620,"props":3334,"children":3335},{"style":847},[3336],{"type":418,"value":886},{"type":412,"tag":620,"props":3338,"children":3339},{"class":622,"line":684},[3340,3344,3348,3352,3356,3360,3364,3368,3372],{"type":412,"tag":620,"props":3341,"children":3342},{"style":841},[3343],{"type":418,"value":844},{"type":412,"tag":620,"props":3345,"children":3346},{"style":847},[3347],{"type":418,"value":850},{"type":412,"tag":620,"props":3349,"children":3350},{"style":853},[3351],{"type":418,"value":2140},{"type":412,"tag":620,"props":3353,"children":3354},{"style":847},[3355],{"type":418,"value":861},{"type":412,"tag":620,"props":3357,"children":3358},{"style":841},[3359],{"type":418,"value":866},{"type":412,"tag":620,"props":3361,"children":3362},{"style":847},[3363],{"type":418,"value":871},{"type":412,"tag":620,"props":3365,"children":3366},{"style":633},[3367],{"type":418,"value":1763},{"type":412,"tag":620,"props":3369,"children":3370},{"style":847},[3371],{"type":418,"value":881},{"type":412,"tag":620,"props":3373,"children":3374},{"style":847},[3375],{"type":418,"value":886},{"type":412,"tag":620,"props":3377,"children":3378},{"class":622,"line":407},[3379],{"type":412,"tag":620,"props":3380,"children":3381},{"emptyLinePlaceholder":892},[3382],{"type":418,"value":895},{"type":412,"tag":620,"props":3384,"children":3385},{"class":622,"line":2004},[3386,3390,3394,3398,3403,3407,3412,3416,3421,3425],{"type":412,"tag":620,"props":3387,"children":3388},{"style":841},[3389],{"type":418,"value":927},{"type":412,"tag":620,"props":3391,"children":3392},{"style":901},[3393],{"type":418,"value":2130},{"type":412,"tag":620,"props":3395,"children":3396},{"style":901},[3397],{"type":418,"value":2135},{"type":412,"tag":620,"props":3399,"children":3400},{"style":673},[3401],{"type":418,"value":3402}," POST",{"type":412,"tag":620,"props":3404,"children":3405},{"style":847},[3406],{"type":418,"value":2145},{"type":412,"tag":620,"props":3408,"children":3409},{"style":2148},[3410],{"type":418,"value":3411},"request",{"type":412,"tag":620,"props":3413,"children":3414},{"style":847},[3415],{"type":418,"value":826},{"type":412,"tag":620,"props":3417,"children":3418},{"style":627},[3419],{"type":418,"value":3420}," Request",{"type":412,"tag":620,"props":3422,"children":3423},{"style":847},[3424],{"type":418,"value":1868},{"type":412,"tag":620,"props":3426,"children":3427},{"style":847},[3428],{"type":418,"value":2195},{"type":412,"tag":620,"props":3430,"children":3431},{"class":622,"line":2057},[3432,3436,3441,3445,3449,3454,3458,3463,3467],{"type":412,"tag":620,"props":3433,"children":3434},{"style":901},[3435],{"type":418,"value":2232},{"type":412,"tag":620,"props":3437,"children":3438},{"style":853},[3439],{"type":418,"value":3440}," body",{"type":412,"tag":620,"props":3442,"children":3443},{"style":847},[3444],{"type":418,"value":2242},{"type":412,"tag":620,"props":3446,"children":3447},{"style":841},[3448],{"type":418,"value":2247},{"type":412,"tag":620,"props":3450,"children":3451},{"style":853},[3452],{"type":418,"value":3453}," request",{"type":412,"tag":620,"props":3455,"children":3456},{"style":847},[3457],{"type":418,"value":1090},{"type":412,"tag":620,"props":3459,"children":3460},{"style":673},[3461],{"type":418,"value":3462},"json",{"type":412,"tag":620,"props":3464,"children":3465},{"style":1958},[3466],{"type":418,"value":2475},{"type":412,"tag":620,"props":3468,"children":3469},{"style":847},[3470],{"type":418,"value":886},{"type":412,"tag":620,"props":3472,"children":3473},{"class":622,"line":2112},[3474,3478,3483,3487,3491,3495,3499,3504,3508,3513,3518,3522,3526,3531],{"type":412,"tag":620,"props":3475,"children":3476},{"style":901},[3477],{"type":418,"value":2232},{"type":412,"tag":620,"props":3479,"children":3480},{"style":853},[3481],{"type":418,"value":3482}," run",{"type":412,"tag":620,"props":3484,"children":3485},{"style":847},[3486],{"type":418,"value":2242},{"type":412,"tag":620,"props":3488,"children":3489},{"style":841},[3490],{"type":418,"value":2247},{"type":412,"tag":620,"props":3492,"children":3493},{"style":673},[3494],{"type":418,"value":1344},{"type":412,"tag":620,"props":3496,"children":3497},{"style":1958},[3498],{"type":418,"value":2145},{"type":412,"tag":620,"props":3500,"children":3501},{"style":853},[3502],{"type":418,"value":3503},"myWorkflow",{"type":412,"tag":620,"props":3505,"children":3506},{"style":847},[3507],{"type":418,"value":1142},{"type":412,"tag":620,"props":3509,"children":3510},{"style":1958},[3511],{"type":418,"value":3512}," [",{"type":412,"tag":620,"props":3514,"children":3515},{"style":853},[3516],{"type":418,"value":3517},"body",{"type":412,"tag":620,"props":3519,"children":3520},{"style":847},[3521],{"type":418,"value":1090},{"type":412,"tag":620,"props":3523,"children":3524},{"style":853},[3525],{"type":418,"value":2151},{"type":412,"tag":620,"props":3527,"children":3528},{"style":1958},[3529],{"type":418,"value":3530},"])",{"type":412,"tag":620,"props":3532,"children":3533},{"style":847},[3534],{"type":418,"value":886},{"type":412,"tag":620,"props":3536,"children":3537},{"class":622,"line":2120},[3538,3542,3546,3550,3554,3558,3562,3567,3571,3575,3579,3584,3588,3592],{"type":412,"tag":620,"props":3539,"children":3540},{"style":841},[3541],{"type":418,"value":2327},{"type":412,"tag":620,"props":3543,"children":3544},{"style":853},[3545],{"type":418,"value":3272},{"type":412,"tag":620,"props":3547,"children":3548},{"style":847},[3549],{"type":418,"value":1090},{"type":412,"tag":620,"props":3551,"children":3552},{"style":673},[3553],{"type":418,"value":3462},{"type":412,"tag":620,"props":3555,"children":3556},{"style":1958},[3557],{"type":418,"value":2145},{"type":412,"tag":620,"props":3559,"children":3560},{"style":847},[3561],{"type":418,"value":2536},{"type":412,"tag":620,"props":3563,"children":3564},{"style":1958},[3565],{"type":418,"value":3566}," runId",{"type":412,"tag":620,"props":3568,"children":3569},{"style":847},[3570],{"type":418,"value":826},{"type":412,"tag":620,"props":3572,"children":3573},{"style":853},[3574],{"type":418,"value":3482},{"type":412,"tag":620,"props":3576,"children":3577},{"style":847},[3578],{"type":418,"value":1090},{"type":412,"tag":620,"props":3580,"children":3581},{"style":853},[3582],{"type":418,"value":3583},"runId",{"type":412,"tag":620,"props":3585,"children":3586},{"style":847},[3587],{"type":418,"value":861},{"type":412,"tag":620,"props":3589,"children":3590},{"style":1958},[3591],{"type":418,"value":1868},{"type":412,"tag":620,"props":3593,"children":3594},{"style":847},[3595],{"type":418,"value":886},{"type":412,"tag":620,"props":3597,"children":3598},{"class":622,"line":33},[3599],{"type":412,"tag":620,"props":3600,"children":3601},{"style":847},[3602],{"type":418,"value":2348},{"type":412,"tag":425,"props":3604,"children":3605},{},[3606,3611,3613,3618,3620,3625,3627,3633],{"type":412,"tag":429,"props":3607,"children":3608},{},[3609],{"type":418,"value":3610},"IMPORTANT",{"type":418,"value":3612},": Never call the workflow function directly. Always use ",{"type":412,"tag":460,"props":3614,"children":3616},{"className":3615},[],[3617],{"type":418,"value":465},{"type":418,"value":3619}," from ",{"type":412,"tag":460,"props":3621,"children":3623},{"className":3622},[],[3624],{"type":418,"value":1320},{"type":418,"value":3626}," — it registers the run, creates the execution context, and returns a ",{"type":412,"tag":460,"props":3628,"children":3630},{"className":3629},[],[3631],{"type":418,"value":3632},"{ runId }",{"type":418,"value":1090},{"type":412,"tag":800,"props":3635,"children":3637},{"id":3636},"_3-readable-stream-route-appapireadablerunidroutets",[3638,3640,3646],{"type":418,"value":3639},"3. Readable Stream Route (",{"type":412,"tag":460,"props":3641,"children":3643},{"className":3642},[],[3644],{"type":418,"value":3645},"app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts",{"type":418,"value":1868},{"type":412,"tag":609,"props":3648,"children":3650},{"className":829,"code":3649,"language":831,"meta":614,"style":614},"import { NextRequest } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype ReadableRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: NextRequest, { params }: ReadableRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return Response.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const readable = run.getReadable();\n  const encoder = new TextEncoder();\n  const sseStream = (readable as unknown as ReadableStream).pipeThrough(\n    new TransformStream({\n      transform(chunk, controller) {\n        const data = typeof chunk === \"string\" ? chunk : JSON.stringify(chunk);\n        controller.enqueue(encoder.encode(`data: ${data}\\n\\n`));\n      },\n    })\n  );\n\n  return new Response(sseStream, {\n    headers: {\n      \"Content-Type\": \"text\u002Fevent-stream; charset=utf-8\",\n      \"Cache-Control\": \"no-cache, no-transform\",\n      Connection: \"keep-alive\",\n      \"X-Accel-Buffering\": \"no\",\n    },\n  });\n}\n",[3651],{"type":412,"tag":460,"props":3652,"children":3653},{"__ignoreMap":614},[3654,3694,3733,3740,3761,3798,3806,3813,3880,3915,3922,3938,3949,3985,4001,4026,4143,4169,4181,4188,4195,4232,4266,4328,4350,4384,4471,4549,4557,4570,4582,4589,4621,4637,4676,4713,4742,4779,4787,4802],{"type":412,"tag":620,"props":3655,"children":3656},{"class":622,"line":623},[3657,3661,3665,3670,3674,3678,3682,3686,3690],{"type":412,"tag":620,"props":3658,"children":3659},{"style":841},[3660],{"type":418,"value":844},{"type":412,"tag":620,"props":3662,"children":3663},{"style":847},[3664],{"type":418,"value":850},{"type":412,"tag":620,"props":3666,"children":3667},{"style":853},[3668],{"type":418,"value":3669}," NextRequest",{"type":412,"tag":620,"props":3671,"children":3672},{"style":847},[3673],{"type":418,"value":861},{"type":412,"tag":620,"props":3675,"children":3676},{"style":841},[3677],{"type":418,"value":866},{"type":412,"tag":620,"props":3679,"children":3680},{"style":847},[3681],{"type":418,"value":871},{"type":412,"tag":620,"props":3683,"children":3684},{"style":633},[3685],{"type":418,"value":3289},{"type":412,"tag":620,"props":3687,"children":3688},{"style":847},[3689],{"type":418,"value":881},{"type":412,"tag":620,"props":3691,"children":3692},{"style":847},[3693],{"type":418,"value":886},{"type":412,"tag":620,"props":3695,"children":3696},{"class":622,"line":669},[3697,3701,3705,3709,3713,3717,3721,3725,3729],{"type":412,"tag":620,"props":3698,"children":3699},{"style":841},[3700],{"type":418,"value":844},{"type":412,"tag":620,"props":3702,"children":3703},{"style":847},[3704],{"type":418,"value":850},{"type":412,"tag":620,"props":3706,"children":3707},{"style":853},[3708],{"type":418,"value":1353},{"type":412,"tag":620,"props":3710,"children":3711},{"style":847},[3712],{"type":418,"value":861},{"type":412,"tag":620,"props":3714,"children":3715},{"style":841},[3716],{"type":418,"value":866},{"type":412,"tag":620,"props":3718,"children":3719},{"style":847},[3720],{"type":418,"value":871},{"type":412,"tag":620,"props":3722,"children":3723},{"style":633},[3724],{"type":418,"value":1388},{"type":412,"tag":620,"props":3726,"children":3727},{"style":847},[3728],{"type":418,"value":881},{"type":412,"tag":620,"props":3730,"children":3731},{"style":847},[3732],{"type":418,"value":886},{"type":412,"tag":620,"props":3734,"children":3735},{"class":622,"line":684},[3736],{"type":412,"tag":620,"props":3737,"children":3738},{"emptyLinePlaceholder":892},[3739],{"type":418,"value":895},{"type":412,"tag":620,"props":3741,"children":3742},{"class":622,"line":407},[3743,3748,3753,3757],{"type":412,"tag":620,"props":3744,"children":3745},{"style":901},[3746],{"type":418,"value":3747},"type",{"type":412,"tag":620,"props":3749,"children":3750},{"style":627},[3751],{"type":418,"value":3752}," ReadableRouteContext",{"type":412,"tag":620,"props":3754,"children":3755},{"style":847},[3756],{"type":418,"value":2242},{"type":412,"tag":620,"props":3758,"children":3759},{"style":847},[3760],{"type":418,"value":2195},{"type":412,"tag":620,"props":3762,"children":3763},{"class":622,"line":2004},[3764,3769,3773,3777,3781,3785,3789,3793],{"type":412,"tag":620,"props":3765,"children":3766},{"style":1958},[3767],{"type":418,"value":3768},"  params",{"type":412,"tag":620,"props":3770,"children":3771},{"style":847},[3772],{"type":418,"value":826},{"type":412,"tag":620,"props":3774,"children":3775},{"style":627},[3776],{"type":418,"value":2168},{"type":412,"tag":620,"props":3778,"children":3779},{"style":847},[3780],{"type":418,"value":2173},{"type":412,"tag":620,"props":3782,"children":3783},{"style":1958},[3784],{"type":418,"value":3566},{"type":412,"tag":620,"props":3786,"children":3787},{"style":847},[3788],{"type":418,"value":826},{"type":412,"tag":620,"props":3790,"children":3791},{"style":627},[3792],{"type":418,"value":1996},{"type":412,"tag":620,"props":3794,"children":3795},{"style":847},[3796],{"type":418,"value":3797}," }>;\n",{"type":412,"tag":620,"props":3799,"children":3800},{"class":622,"line":2057},[3801],{"type":412,"tag":620,"props":3802,"children":3803},{"style":847},[3804],{"type":418,"value":3805},"};\n",{"type":412,"tag":620,"props":3807,"children":3808},{"class":622,"line":2112},[3809],{"type":412,"tag":620,"props":3810,"children":3811},{"emptyLinePlaceholder":892},[3812],{"type":418,"value":895},{"type":412,"tag":620,"props":3814,"children":3815},{"class":622,"line":2120},[3816,3820,3824,3828,3833,3837,3842,3846,3850,3854,3858,3863,3868,3872,3876],{"type":412,"tag":620,"props":3817,"children":3818},{"style":841},[3819],{"type":418,"value":927},{"type":412,"tag":620,"props":3821,"children":3822},{"style":901},[3823],{"type":418,"value":2130},{"type":412,"tag":620,"props":3825,"children":3826},{"style":901},[3827],{"type":418,"value":2135},{"type":412,"tag":620,"props":3829,"children":3830},{"style":673},[3831],{"type":418,"value":3832}," GET",{"type":412,"tag":620,"props":3834,"children":3835},{"style":847},[3836],{"type":418,"value":2145},{"type":412,"tag":620,"props":3838,"children":3839},{"style":2148},[3840],{"type":418,"value":3841},"_request",{"type":412,"tag":620,"props":3843,"children":3844},{"style":847},[3845],{"type":418,"value":826},{"type":412,"tag":620,"props":3847,"children":3848},{"style":627},[3849],{"type":418,"value":3669},{"type":412,"tag":620,"props":3851,"children":3852},{"style":847},[3853],{"type":418,"value":1142},{"type":412,"tag":620,"props":3855,"children":3856},{"style":847},[3857],{"type":418,"value":850},{"type":412,"tag":620,"props":3859,"children":3860},{"style":2148},[3861],{"type":418,"value":3862}," params",{"type":412,"tag":620,"props":3864,"children":3865},{"style":847},[3866],{"type":418,"value":3867}," }:",{"type":412,"tag":620,"props":3869,"children":3870},{"style":627},[3871],{"type":418,"value":3752},{"type":412,"tag":620,"props":3873,"children":3874},{"style":847},[3875],{"type":418,"value":1868},{"type":412,"tag":620,"props":3877,"children":3878},{"style":847},[3879],{"type":418,"value":2195},{"type":412,"tag":620,"props":3881,"children":3882},{"class":622,"line":33},[3883,3887,3891,3895,3899,3903,3907,3911],{"type":412,"tag":620,"props":3884,"children":3885},{"style":901},[3886],{"type":418,"value":2232},{"type":412,"tag":620,"props":3888,"children":3889},{"style":847},[3890],{"type":418,"value":850},{"type":412,"tag":620,"props":3892,"children":3893},{"style":853},[3894],{"type":418,"value":3566},{"type":412,"tag":620,"props":3896,"children":3897},{"style":847},[3898],{"type":418,"value":861},{"type":412,"tag":620,"props":3900,"children":3901},{"style":847},[3902],{"type":418,"value":2242},{"type":412,"tag":620,"props":3904,"children":3905},{"style":841},[3906],{"type":418,"value":2247},{"type":412,"tag":620,"props":3908,"children":3909},{"style":853},[3910],{"type":418,"value":3862},{"type":412,"tag":620,"props":3912,"children":3913},{"style":847},[3914],{"type":418,"value":886},{"type":412,"tag":620,"props":3916,"children":3917},{"class":622,"line":2218},[3918],{"type":412,"tag":620,"props":3919,"children":3920},{"emptyLinePlaceholder":892},[3921],{"type":418,"value":895},{"type":412,"tag":620,"props":3923,"children":3924},{"class":622,"line":2226},[3925,3930,3934],{"type":412,"tag":620,"props":3926,"children":3927},{"style":901},[3928],{"type":418,"value":3929},"  let",{"type":412,"tag":620,"props":3931,"children":3932},{"style":853},[3933],{"type":418,"value":3482},{"type":412,"tag":620,"props":3935,"children":3936},{"style":847},[3937],{"type":418,"value":886},{"type":412,"tag":620,"props":3939,"children":3940},{"class":622,"line":2271},[3941,3945],{"type":412,"tag":620,"props":3942,"children":3943},{"style":841},[3944],{"type":418,"value":2501},{"type":412,"tag":620,"props":3946,"children":3947},{"style":847},[3948],{"type":418,"value":2195},{"type":412,"tag":620,"props":3950,"children":3951},{"class":622,"line":2313},[3952,3957,3961,3965,3969,3973,3977,3981],{"type":412,"tag":620,"props":3953,"children":3954},{"style":853},[3955],{"type":418,"value":3956},"    run",{"type":412,"tag":620,"props":3958,"children":3959},{"style":847},[3960],{"type":418,"value":2242},{"type":412,"tag":620,"props":3962,"children":3963},{"style":841},[3964],{"type":418,"value":2247},{"type":412,"tag":620,"props":3966,"children":3967},{"style":673},[3968],{"type":418,"value":1353},{"type":412,"tag":620,"props":3970,"children":3971},{"style":1958},[3972],{"type":418,"value":2145},{"type":412,"tag":620,"props":3974,"children":3975},{"style":853},[3976],{"type":418,"value":3583},{"type":412,"tag":620,"props":3978,"children":3979},{"style":1958},[3980],{"type":418,"value":1868},{"type":412,"tag":620,"props":3982,"children":3983},{"style":847},[3984],{"type":418,"value":886},{"type":412,"tag":620,"props":3986,"children":3987},{"class":622,"line":2321},[3988,3992,3997],{"type":412,"tag":620,"props":3989,"children":3990},{"style":847},[3991],{"type":418,"value":2754},{"type":412,"tag":620,"props":3993,"children":3994},{"style":841},[3995],{"type":418,"value":3996}," catch",{"type":412,"tag":620,"props":3998,"children":3999},{"style":847},[4000],{"type":418,"value":2195},{"type":412,"tag":620,"props":4002,"children":4003},{"class":622,"line":2342},[4004,4008,4013,4017,4021],{"type":412,"tag":620,"props":4005,"children":4006},{"style":841},[4007],{"type":418,"value":2737},{"type":412,"tag":620,"props":4009,"children":4010},{"style":853},[4011],{"type":418,"value":4012}," Response",{"type":412,"tag":620,"props":4014,"children":4015},{"style":847},[4016],{"type":418,"value":1090},{"type":412,"tag":620,"props":4018,"children":4019},{"style":673},[4020],{"type":418,"value":3462},{"type":412,"tag":620,"props":4022,"children":4023},{"style":1958},[4024],{"type":418,"value":4025},"(\n",{"type":412,"tag":620,"props":4027,"children":4028},{"class":622,"line":2351},[4029,4034,4039,4043,4049,4053,4058,4062,4066,4071,4075,4079,4084,4088,4092,4097,4101,4106,4110,4115,4119,4124,4129,4134,4138],{"type":412,"tag":620,"props":4030,"children":4031},{"style":847},[4032],{"type":418,"value":4033},"      {",{"type":412,"tag":620,"props":4035,"children":4036},{"style":1958},[4037],{"type":418,"value":4038}," ok",{"type":412,"tag":620,"props":4040,"children":4041},{"style":847},[4042],{"type":418,"value":826},{"type":412,"tag":620,"props":4044,"children":4046},{"style":4045},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[4047],{"type":418,"value":4048}," false",{"type":412,"tag":620,"props":4050,"children":4051},{"style":847},[4052],{"type":418,"value":1142},{"type":412,"tag":620,"props":4054,"children":4055},{"style":1958},[4056],{"type":418,"value":4057}," error",{"type":412,"tag":620,"props":4059,"children":4060},{"style":847},[4061],{"type":418,"value":826},{"type":412,"tag":620,"props":4063,"children":4064},{"style":847},[4065],{"type":418,"value":850},{"type":412,"tag":620,"props":4067,"children":4068},{"style":1958},[4069],{"type":418,"value":4070}," code",{"type":412,"tag":620,"props":4072,"children":4073},{"style":847},[4074],{"type":418,"value":826},{"type":412,"tag":620,"props":4076,"children":4077},{"style":847},[4078],{"type":418,"value":871},{"type":412,"tag":620,"props":4080,"children":4081},{"style":633},[4082],{"type":418,"value":4083},"RUN_NOT_FOUND",{"type":412,"tag":620,"props":4085,"children":4086},{"style":847},[4087],{"type":418,"value":881},{"type":412,"tag":620,"props":4089,"children":4090},{"style":847},[4091],{"type":418,"value":1142},{"type":412,"tag":620,"props":4093,"children":4094},{"style":1958},[4095],{"type":418,"value":4096}," message",{"type":412,"tag":620,"props":4098,"children":4099},{"style":847},[4100],{"type":418,"value":826},{"type":412,"tag":620,"props":4102,"children":4103},{"style":847},[4104],{"type":418,"value":4105}," `",{"type":412,"tag":620,"props":4107,"children":4108},{"style":633},[4109],{"type":418,"value":750},{"type":412,"tag":620,"props":4111,"children":4112},{"style":847},[4113],{"type":418,"value":4114},"${",{"type":412,"tag":620,"props":4116,"children":4117},{"style":853},[4118],{"type":418,"value":3583},{"type":412,"tag":620,"props":4120,"children":4121},{"style":847},[4122],{"type":418,"value":4123},"}",{"type":412,"tag":620,"props":4125,"children":4126},{"style":633},[4127],{"type":418,"value":4128}," not found",{"type":412,"tag":620,"props":4130,"children":4131},{"style":847},[4132],{"type":418,"value":4133},"`",{"type":412,"tag":620,"props":4135,"children":4136},{"style":847},[4137],{"type":418,"value":861},{"type":412,"tag":620,"props":4139,"children":4140},{"style":847},[4141],{"type":418,"value":4142}," },\n",{"type":412,"tag":620,"props":4144,"children":4145},{"class":622,"line":2359},[4146,4150,4155,4159,4165],{"type":412,"tag":620,"props":4147,"children":4148},{"style":847},[4149],{"type":418,"value":4033},{"type":412,"tag":620,"props":4151,"children":4152},{"style":1958},[4153],{"type":418,"value":4154}," status",{"type":412,"tag":620,"props":4156,"children":4157},{"style":847},[4158],{"type":418,"value":826},{"type":412,"tag":620,"props":4160,"children":4162},{"style":4161},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[4163],{"type":418,"value":4164}," 404",{"type":412,"tag":620,"props":4166,"children":4167},{"style":847},[4168],{"type":418,"value":2001},{"type":412,"tag":620,"props":4170,"children":4171},{"class":622,"line":2419},[4172,4177],{"type":412,"tag":620,"props":4173,"children":4174},{"style":1958},[4175],{"type":418,"value":4176},"    )",{"type":412,"tag":620,"props":4178,"children":4179},{"style":847},[4180],{"type":418,"value":886},{"type":412,"tag":620,"props":4182,"children":4183},{"class":622,"line":2439},[4184],{"type":412,"tag":620,"props":4185,"children":4186},{"style":847},[4187],{"type":418,"value":2798},{"type":412,"tag":620,"props":4189,"children":4190},{"class":622,"line":2495},[4191],{"type":412,"tag":620,"props":4192,"children":4193},{"emptyLinePlaceholder":892},[4194],{"type":418,"value":895},{"type":412,"tag":620,"props":4196,"children":4197},{"class":622,"line":2508},[4198,4202,4207,4211,4215,4219,4224,4228],{"type":412,"tag":620,"props":4199,"children":4200},{"style":901},[4201],{"type":418,"value":2232},{"type":412,"tag":620,"props":4203,"children":4204},{"style":853},[4205],{"type":418,"value":4206}," readable",{"type":412,"tag":620,"props":4208,"children":4209},{"style":847},[4210],{"type":418,"value":2242},{"type":412,"tag":620,"props":4212,"children":4213},{"style":853},[4214],{"type":418,"value":3482},{"type":412,"tag":620,"props":4216,"children":4217},{"style":847},[4218],{"type":418,"value":1090},{"type":412,"tag":620,"props":4220,"children":4221},{"style":673},[4222],{"type":418,"value":4223},"getReadable",{"type":412,"tag":620,"props":4225,"children":4226},{"style":1958},[4227],{"type":418,"value":2475},{"type":412,"tag":620,"props":4229,"children":4230},{"style":847},[4231],{"type":418,"value":886},{"type":412,"tag":620,"props":4233,"children":4234},{"class":622,"line":2596},[4235,4239,4244,4248,4253,4258,4262],{"type":412,"tag":620,"props":4236,"children":4237},{"style":901},[4238],{"type":418,"value":2232},{"type":412,"tag":620,"props":4240,"children":4241},{"style":853},[4242],{"type":418,"value":4243}," encoder",{"type":412,"tag":620,"props":4245,"children":4246},{"style":847},[4247],{"type":418,"value":2242},{"type":412,"tag":620,"props":4249,"children":4250},{"style":847},[4251],{"type":418,"value":4252}," new",{"type":412,"tag":620,"props":4254,"children":4255},{"style":673},[4256],{"type":418,"value":4257}," TextEncoder",{"type":412,"tag":620,"props":4259,"children":4260},{"style":1958},[4261],{"type":418,"value":2475},{"type":412,"tag":620,"props":4263,"children":4264},{"style":847},[4265],{"type":418,"value":886},{"type":412,"tag":620,"props":4267,"children":4268},{"class":622,"line":2605},[4269,4273,4278,4282,4287,4292,4297,4302,4306,4311,4315,4319,4324],{"type":412,"tag":620,"props":4270,"children":4271},{"style":901},[4272],{"type":418,"value":2232},{"type":412,"tag":620,"props":4274,"children":4275},{"style":853},[4276],{"type":418,"value":4277}," sseStream",{"type":412,"tag":620,"props":4279,"children":4280},{"style":847},[4281],{"type":418,"value":2242},{"type":412,"tag":620,"props":4283,"children":4284},{"style":1958},[4285],{"type":418,"value":4286}," (",{"type":412,"tag":620,"props":4288,"children":4289},{"style":853},[4290],{"type":418,"value":4291},"readable",{"type":412,"tag":620,"props":4293,"children":4294},{"style":841},[4295],{"type":418,"value":4296}," as",{"type":412,"tag":620,"props":4298,"children":4299},{"style":627},[4300],{"type":418,"value":4301}," unknown",{"type":412,"tag":620,"props":4303,"children":4304},{"style":841},[4305],{"type":418,"value":4296},{"type":412,"tag":620,"props":4307,"children":4308},{"style":627},[4309],{"type":418,"value":4310}," ReadableStream",{"type":412,"tag":620,"props":4312,"children":4313},{"style":1958},[4314],{"type":418,"value":1868},{"type":412,"tag":620,"props":4316,"children":4317},{"style":847},[4318],{"type":418,"value":1090},{"type":412,"tag":620,"props":4320,"children":4321},{"style":673},[4322],{"type":418,"value":4323},"pipeThrough",{"type":412,"tag":620,"props":4325,"children":4326},{"style":1958},[4327],{"type":418,"value":4025},{"type":412,"tag":620,"props":4329,"children":4330},{"class":622,"line":2647},[4331,4336,4341,4345],{"type":412,"tag":620,"props":4332,"children":4333},{"style":847},[4334],{"type":418,"value":4335},"    new",{"type":412,"tag":620,"props":4337,"children":4338},{"style":673},[4339],{"type":418,"value":4340}," TransformStream",{"type":412,"tag":620,"props":4342,"children":4343},{"style":1958},[4344],{"type":418,"value":2145},{"type":412,"tag":620,"props":4346,"children":4347},{"style":847},[4348],{"type":418,"value":4349},"{\n",{"type":412,"tag":620,"props":4351,"children":4352},{"class":622,"line":2731},[4353,4358,4362,4367,4371,4376,4380],{"type":412,"tag":620,"props":4354,"children":4355},{"style":1958},[4356],{"type":418,"value":4357},"      transform",{"type":412,"tag":620,"props":4359,"children":4360},{"style":847},[4361],{"type":418,"value":2145},{"type":412,"tag":620,"props":4363,"children":4364},{"style":2148},[4365],{"type":418,"value":4366},"chunk",{"type":412,"tag":620,"props":4368,"children":4369},{"style":847},[4370],{"type":418,"value":1142},{"type":412,"tag":620,"props":4372,"children":4373},{"style":2148},[4374],{"type":418,"value":4375}," controller",{"type":412,"tag":620,"props":4377,"children":4378},{"style":847},[4379],{"type":418,"value":1868},{"type":412,"tag":620,"props":4381,"children":4382},{"style":847},[4383],{"type":418,"value":2195},{"type":412,"tag":620,"props":4385,"children":4386},{"class":622,"line":2748},[4387,4392,4396,4400,4405,4410,4415,4419,4423,4427,4432,4436,4441,4446,4450,4455,4459,4463,4467],{"type":412,"tag":620,"props":4388,"children":4389},{"style":901},[4390],{"type":418,"value":4391},"        const",{"type":412,"tag":620,"props":4393,"children":4394},{"style":853},[4395],{"type":418,"value":2237},{"type":412,"tag":620,"props":4397,"children":4398},{"style":847},[4399],{"type":418,"value":2242},{"type":412,"tag":620,"props":4401,"children":4402},{"style":847},[4403],{"type":418,"value":4404}," typeof",{"type":412,"tag":620,"props":4406,"children":4407},{"style":853},[4408],{"type":418,"value":4409}," chunk",{"type":412,"tag":620,"props":4411,"children":4412},{"style":847},[4413],{"type":418,"value":4414}," ===",{"type":412,"tag":620,"props":4416,"children":4417},{"style":847},[4418],{"type":418,"value":871},{"type":412,"tag":620,"props":4420,"children":4421},{"style":633},[4422],{"type":418,"value":2407},{"type":412,"tag":620,"props":4424,"children":4425},{"style":847},[4426],{"type":418,"value":881},{"type":412,"tag":620,"props":4428,"children":4429},{"style":847},[4430],{"type":418,"value":4431}," ?",{"type":412,"tag":620,"props":4433,"children":4434},{"style":853},[4435],{"type":418,"value":4409},{"type":412,"tag":620,"props":4437,"children":4438},{"style":847},[4439],{"type":418,"value":4440}," :",{"type":412,"tag":620,"props":4442,"children":4443},{"style":853},[4444],{"type":418,"value":4445}," JSON",{"type":412,"tag":620,"props":4447,"children":4448},{"style":847},[4449],{"type":418,"value":1090},{"type":412,"tag":620,"props":4451,"children":4452},{"style":673},[4453],{"type":418,"value":4454},"stringify",{"type":412,"tag":620,"props":4456,"children":4457},{"style":1958},[4458],{"type":418,"value":2145},{"type":412,"tag":620,"props":4460,"children":4461},{"style":853},[4462],{"type":418,"value":4366},{"type":412,"tag":620,"props":4464,"children":4465},{"style":1958},[4466],{"type":418,"value":1868},{"type":412,"tag":620,"props":4468,"children":4469},{"style":847},[4470],{"type":418,"value":886},{"type":412,"tag":620,"props":4472,"children":4473},{"class":622,"line":2766},[4474,4479,4483,4488,4492,4497,4501,4506,4510,4514,4519,4523,4527,4531,4536,4540,4545],{"type":412,"tag":620,"props":4475,"children":4476},{"style":853},[4477],{"type":418,"value":4478},"        controller",{"type":412,"tag":620,"props":4480,"children":4481},{"style":847},[4482],{"type":418,"value":1090},{"type":412,"tag":620,"props":4484,"children":4485},{"style":673},[4486],{"type":418,"value":4487},"enqueue",{"type":412,"tag":620,"props":4489,"children":4490},{"style":1958},[4491],{"type":418,"value":2145},{"type":412,"tag":620,"props":4493,"children":4494},{"style":853},[4495],{"type":418,"value":4496},"encoder",{"type":412,"tag":620,"props":4498,"children":4499},{"style":847},[4500],{"type":418,"value":1090},{"type":412,"tag":620,"props":4502,"children":4503},{"style":673},[4504],{"type":418,"value":4505},"encode",{"type":412,"tag":620,"props":4507,"children":4508},{"style":1958},[4509],{"type":418,"value":2145},{"type":412,"tag":620,"props":4511,"children":4512},{"style":847},[4513],{"type":418,"value":4133},{"type":412,"tag":620,"props":4515,"children":4516},{"style":633},[4517],{"type":418,"value":4518},"data: ",{"type":412,"tag":620,"props":4520,"children":4521},{"style":847},[4522],{"type":418,"value":4114},{"type":412,"tag":620,"props":4524,"children":4525},{"style":853},[4526],{"type":418,"value":2302},{"type":412,"tag":620,"props":4528,"children":4529},{"style":847},[4530],{"type":418,"value":4123},{"type":412,"tag":620,"props":4532,"children":4533},{"style":853},[4534],{"type":418,"value":4535},"\\n\\n",{"type":412,"tag":620,"props":4537,"children":4538},{"style":847},[4539],{"type":418,"value":4133},{"type":412,"tag":620,"props":4541,"children":4542},{"style":1958},[4543],{"type":418,"value":4544},"))",{"type":412,"tag":620,"props":4546,"children":4547},{"style":847},[4548],{"type":418,"value":886},{"type":412,"tag":620,"props":4550,"children":4551},{"class":622,"line":2792},[4552],{"type":412,"tag":620,"props":4553,"children":4554},{"style":847},[4555],{"type":418,"value":4556},"      },\n",{"type":412,"tag":620,"props":4558,"children":4559},{"class":622,"line":2801},[4560,4565],{"type":412,"tag":620,"props":4561,"children":4562},{"style":847},[4563],{"type":418,"value":4564},"    }",{"type":412,"tag":620,"props":4566,"children":4567},{"style":1958},[4568],{"type":418,"value":4569},")\n",{"type":412,"tag":620,"props":4571,"children":4572},{"class":622,"line":2809},[4573,4578],{"type":412,"tag":620,"props":4574,"children":4575},{"style":1958},[4576],{"type":418,"value":4577},"  )",{"type":412,"tag":620,"props":4579,"children":4580},{"style":847},[4581],{"type":418,"value":886},{"type":412,"tag":620,"props":4583,"children":4584},{"class":622,"line":2817},[4585],{"type":412,"tag":620,"props":4586,"children":4587},{"emptyLinePlaceholder":892},[4588],{"type":418,"value":895},{"type":412,"tag":620,"props":4590,"children":4591},{"class":622,"line":2873},[4592,4596,4600,4604,4608,4613,4617],{"type":412,"tag":620,"props":4593,"children":4594},{"style":841},[4595],{"type":418,"value":2327},{"type":412,"tag":620,"props":4597,"children":4598},{"style":847},[4599],{"type":418,"value":4252},{"type":412,"tag":620,"props":4601,"children":4602},{"style":673},[4603],{"type":418,"value":4012},{"type":412,"tag":620,"props":4605,"children":4606},{"style":1958},[4607],{"type":418,"value":2145},{"type":412,"tag":620,"props":4609,"children":4610},{"style":853},[4611],{"type":418,"value":4612},"sseStream",{"type":412,"tag":620,"props":4614,"children":4615},{"style":847},[4616],{"type":418,"value":1142},{"type":412,"tag":620,"props":4618,"children":4619},{"style":847},[4620],{"type":418,"value":2195},{"type":412,"tag":620,"props":4622,"children":4623},{"class":622,"line":2893},[4624,4629,4633],{"type":412,"tag":620,"props":4625,"children":4626},{"style":1958},[4627],{"type":418,"value":4628},"    headers",{"type":412,"tag":620,"props":4630,"children":4631},{"style":847},[4632],{"type":418,"value":826},{"type":412,"tag":620,"props":4634,"children":4635},{"style":847},[4636],{"type":418,"value":2195},{"type":412,"tag":620,"props":4638,"children":4639},{"class":622,"line":2945},[4640,4645,4650,4654,4658,4662,4667,4671],{"type":412,"tag":620,"props":4641,"children":4642},{"style":847},[4643],{"type":418,"value":4644},"      \"",{"type":412,"tag":620,"props":4646,"children":4647},{"style":1958},[4648],{"type":418,"value":4649},"Content-Type",{"type":412,"tag":620,"props":4651,"children":4652},{"style":847},[4653],{"type":418,"value":881},{"type":412,"tag":620,"props":4655,"children":4656},{"style":847},[4657],{"type":418,"value":826},{"type":412,"tag":620,"props":4659,"children":4660},{"style":847},[4661],{"type":418,"value":871},{"type":412,"tag":620,"props":4663,"children":4664},{"style":633},[4665],{"type":418,"value":4666},"text\u002Fevent-stream; charset=utf-8",{"type":412,"tag":620,"props":4668,"children":4669},{"style":847},[4670],{"type":418,"value":881},{"type":412,"tag":620,"props":4672,"children":4673},{"style":847},[4674],{"type":418,"value":4675},",\n",{"type":412,"tag":620,"props":4677,"children":4678},{"class":622,"line":2957},[4679,4683,4688,4692,4696,4700,4705,4709],{"type":412,"tag":620,"props":4680,"children":4681},{"style":847},[4682],{"type":418,"value":4644},{"type":412,"tag":620,"props":4684,"children":4685},{"style":1958},[4686],{"type":418,"value":4687},"Cache-Control",{"type":412,"tag":620,"props":4689,"children":4690},{"style":847},[4691],{"type":418,"value":881},{"type":412,"tag":620,"props":4693,"children":4694},{"style":847},[4695],{"type":418,"value":826},{"type":412,"tag":620,"props":4697,"children":4698},{"style":847},[4699],{"type":418,"value":871},{"type":412,"tag":620,"props":4701,"children":4702},{"style":633},[4703],{"type":418,"value":4704},"no-cache, no-transform",{"type":412,"tag":620,"props":4706,"children":4707},{"style":847},[4708],{"type":418,"value":881},{"type":412,"tag":620,"props":4710,"children":4711},{"style":847},[4712],{"type":418,"value":4675},{"type":412,"tag":620,"props":4714,"children":4715},{"class":622,"line":3042},[4716,4721,4725,4729,4734,4738],{"type":412,"tag":620,"props":4717,"children":4718},{"style":1958},[4719],{"type":418,"value":4720},"      Connection",{"type":412,"tag":620,"props":4722,"children":4723},{"style":847},[4724],{"type":418,"value":826},{"type":412,"tag":620,"props":4726,"children":4727},{"style":847},[4728],{"type":418,"value":871},{"type":412,"tag":620,"props":4730,"children":4731},{"style":633},[4732],{"type":418,"value":4733},"keep-alive",{"type":412,"tag":620,"props":4735,"children":4736},{"style":847},[4737],{"type":418,"value":881},{"type":412,"tag":620,"props":4739,"children":4740},{"style":847},[4741],{"type":418,"value":4675},{"type":412,"tag":620,"props":4743,"children":4744},{"class":622,"line":3083},[4745,4749,4754,4758,4762,4766,4771,4775],{"type":412,"tag":620,"props":4746,"children":4747},{"style":847},[4748],{"type":418,"value":4644},{"type":412,"tag":620,"props":4750,"children":4751},{"style":1958},[4752],{"type":418,"value":4753},"X-Accel-Buffering",{"type":412,"tag":620,"props":4755,"children":4756},{"style":847},[4757],{"type":418,"value":881},{"type":412,"tag":620,"props":4759,"children":4760},{"style":847},[4761],{"type":418,"value":826},{"type":412,"tag":620,"props":4763,"children":4764},{"style":847},[4765],{"type":418,"value":871},{"type":412,"tag":620,"props":4767,"children":4768},{"style":633},[4769],{"type":418,"value":4770},"no",{"type":412,"tag":620,"props":4772,"children":4773},{"style":847},[4774],{"type":418,"value":881},{"type":412,"tag":620,"props":4776,"children":4777},{"style":847},[4778],{"type":418,"value":4675},{"type":412,"tag":620,"props":4780,"children":4781},{"class":622,"line":3167},[4782],{"type":412,"tag":620,"props":4783,"children":4784},{"style":847},[4785],{"type":418,"value":4786},"    },\n",{"type":412,"tag":620,"props":4788,"children":4789},{"class":622,"line":3183},[4790,4794,4798],{"type":412,"tag":620,"props":4791,"children":4792},{"style":847},[4793],{"type":418,"value":2754},{"type":412,"tag":620,"props":4795,"children":4796},{"style":1958},[4797],{"type":418,"value":1868},{"type":412,"tag":620,"props":4799,"children":4800},{"style":847},[4801],{"type":418,"value":886},{"type":412,"tag":620,"props":4803,"children":4804},{"class":622,"line":3199},[4805],{"type":412,"tag":620,"props":4806,"children":4807},{"style":847},[4808],{"type":418,"value":2348},{"type":412,"tag":800,"props":4810,"children":4812},{"id":4811},"_4-run-status-route-appapirunrunidroutets",[4813,4815,4821],{"type":418,"value":4814},"4. Run Status Route (",{"type":412,"tag":460,"props":4816,"children":4818},{"className":4817},[],[4819],{"type":418,"value":4820},"app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts",{"type":418,"value":1868},{"type":412,"tag":609,"props":4823,"children":4825},{"className":829,"code":4824,"language":831,"meta":614,"style":614},"import { NextResponse } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype RunRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: Request, { params }: RunRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return NextResponse.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const [status, workflowName, createdAt, startedAt, completedAt] =\n    await Promise.all([\n      run.status,\n      run.workflowName,\n      run.createdAt,\n      run.startedAt,\n      run.completedAt,\n    ]);\n\n  return NextResponse.json({\n    runId,\n    status,\n    workflowName,\n    createdAt: createdAt.toISOString(),\n    startedAt: startedAt?.toISOString() ?? null,\n    completedAt: completedAt?.toISOString() ?? null,\n  });\n}\n",[4826],{"type":412,"tag":460,"props":4827,"children":4828},{"__ignoreMap":614},[4829,4868,4907,4914,4934,4969,4976,4983,5046,5081,5088,5103,5114,5149,5164,5187,5290,5313,5324,5331,5338,5398,5423,5443,5463,5483,5503,5523,5535,5542,5569,5581,5593,5605,5638,5678,5714,5729],{"type":412,"tag":620,"props":4830,"children":4831},{"class":622,"line":623},[4832,4836,4840,4844,4848,4852,4856,4860,4864],{"type":412,"tag":620,"props":4833,"children":4834},{"style":841},[4835],{"type":418,"value":844},{"type":412,"tag":620,"props":4837,"children":4838},{"style":847},[4839],{"type":418,"value":850},{"type":412,"tag":620,"props":4841,"children":4842},{"style":853},[4843],{"type":418,"value":3272},{"type":412,"tag":620,"props":4845,"children":4846},{"style":847},[4847],{"type":418,"value":861},{"type":412,"tag":620,"props":4849,"children":4850},{"style":841},[4851],{"type":418,"value":866},{"type":412,"tag":620,"props":4853,"children":4854},{"style":847},[4855],{"type":418,"value":871},{"type":412,"tag":620,"props":4857,"children":4858},{"style":633},[4859],{"type":418,"value":3289},{"type":412,"tag":620,"props":4861,"children":4862},{"style":847},[4863],{"type":418,"value":881},{"type":412,"tag":620,"props":4865,"children":4866},{"style":847},[4867],{"type":418,"value":886},{"type":412,"tag":620,"props":4869,"children":4870},{"class":622,"line":669},[4871,4875,4879,4883,4887,4891,4895,4899,4903],{"type":412,"tag":620,"props":4872,"children":4873},{"style":841},[4874],{"type":418,"value":844},{"type":412,"tag":620,"props":4876,"children":4877},{"style":847},[4878],{"type":418,"value":850},{"type":412,"tag":620,"props":4880,"children":4881},{"style":853},[4882],{"type":418,"value":1353},{"type":412,"tag":620,"props":4884,"children":4885},{"style":847},[4886],{"type":418,"value":861},{"type":412,"tag":620,"props":4888,"children":4889},{"style":841},[4890],{"type":418,"value":866},{"type":412,"tag":620,"props":4892,"children":4893},{"style":847},[4894],{"type":418,"value":871},{"type":412,"tag":620,"props":4896,"children":4897},{"style":633},[4898],{"type":418,"value":1388},{"type":412,"tag":620,"props":4900,"children":4901},{"style":847},[4902],{"type":418,"value":881},{"type":412,"tag":620,"props":4904,"children":4905},{"style":847},[4906],{"type":418,"value":886},{"type":412,"tag":620,"props":4908,"children":4909},{"class":622,"line":684},[4910],{"type":412,"tag":620,"props":4911,"children":4912},{"emptyLinePlaceholder":892},[4913],{"type":418,"value":895},{"type":412,"tag":620,"props":4915,"children":4916},{"class":622,"line":407},[4917,4921,4926,4930],{"type":412,"tag":620,"props":4918,"children":4919},{"style":901},[4920],{"type":418,"value":3747},{"type":412,"tag":620,"props":4922,"children":4923},{"style":627},[4924],{"type":418,"value":4925}," RunRouteContext",{"type":412,"tag":620,"props":4927,"children":4928},{"style":847},[4929],{"type":418,"value":2242},{"type":412,"tag":620,"props":4931,"children":4932},{"style":847},[4933],{"type":418,"value":2195},{"type":412,"tag":620,"props":4935,"children":4936},{"class":622,"line":2004},[4937,4941,4945,4949,4953,4957,4961,4965],{"type":412,"tag":620,"props":4938,"children":4939},{"style":1958},[4940],{"type":418,"value":3768},{"type":412,"tag":620,"props":4942,"children":4943},{"style":847},[4944],{"type":418,"value":826},{"type":412,"tag":620,"props":4946,"children":4947},{"style":627},[4948],{"type":418,"value":2168},{"type":412,"tag":620,"props":4950,"children":4951},{"style":847},[4952],{"type":418,"value":2173},{"type":412,"tag":620,"props":4954,"children":4955},{"style":1958},[4956],{"type":418,"value":3566},{"type":412,"tag":620,"props":4958,"children":4959},{"style":847},[4960],{"type":418,"value":826},{"type":412,"tag":620,"props":4962,"children":4963},{"style":627},[4964],{"type":418,"value":1996},{"type":412,"tag":620,"props":4966,"children":4967},{"style":847},[4968],{"type":418,"value":3797},{"type":412,"tag":620,"props":4970,"children":4971},{"class":622,"line":2057},[4972],{"type":412,"tag":620,"props":4973,"children":4974},{"style":847},[4975],{"type":418,"value":3805},{"type":412,"tag":620,"props":4977,"children":4978},{"class":622,"line":2112},[4979],{"type":412,"tag":620,"props":4980,"children":4981},{"emptyLinePlaceholder":892},[4982],{"type":418,"value":895},{"type":412,"tag":620,"props":4984,"children":4985},{"class":622,"line":2120},[4986,4990,4994,4998,5002,5006,5010,5014,5018,5022,5026,5030,5034,5038,5042],{"type":412,"tag":620,"props":4987,"children":4988},{"style":841},[4989],{"type":418,"value":927},{"type":412,"tag":620,"props":4991,"children":4992},{"style":901},[4993],{"type":418,"value":2130},{"type":412,"tag":620,"props":4995,"children":4996},{"style":901},[4997],{"type":418,"value":2135},{"type":412,"tag":620,"props":4999,"children":5000},{"style":673},[5001],{"type":418,"value":3832},{"type":412,"tag":620,"props":5003,"children":5004},{"style":847},[5005],{"type":418,"value":2145},{"type":412,"tag":620,"props":5007,"children":5008},{"style":2148},[5009],{"type":418,"value":3841},{"type":412,"tag":620,"props":5011,"children":5012},{"style":847},[5013],{"type":418,"value":826},{"type":412,"tag":620,"props":5015,"children":5016},{"style":627},[5017],{"type":418,"value":3420},{"type":412,"tag":620,"props":5019,"children":5020},{"style":847},[5021],{"type":418,"value":1142},{"type":412,"tag":620,"props":5023,"children":5024},{"style":847},[5025],{"type":418,"value":850},{"type":412,"tag":620,"props":5027,"children":5028},{"style":2148},[5029],{"type":418,"value":3862},{"type":412,"tag":620,"props":5031,"children":5032},{"style":847},[5033],{"type":418,"value":3867},{"type":412,"tag":620,"props":5035,"children":5036},{"style":627},[5037],{"type":418,"value":4925},{"type":412,"tag":620,"props":5039,"children":5040},{"style":847},[5041],{"type":418,"value":1868},{"type":412,"tag":620,"props":5043,"children":5044},{"style":847},[5045],{"type":418,"value":2195},{"type":412,"tag":620,"props":5047,"children":5048},{"class":622,"line":33},[5049,5053,5057,5061,5065,5069,5073,5077],{"type":412,"tag":620,"props":5050,"children":5051},{"style":901},[5052],{"type":418,"value":2232},{"type":412,"tag":620,"props":5054,"children":5055},{"style":847},[5056],{"type":418,"value":850},{"type":412,"tag":620,"props":5058,"children":5059},{"style":853},[5060],{"type":418,"value":3566},{"type":412,"tag":620,"props":5062,"children":5063},{"style":847},[5064],{"type":418,"value":861},{"type":412,"tag":620,"props":5066,"children":5067},{"style":847},[5068],{"type":418,"value":2242},{"type":412,"tag":620,"props":5070,"children":5071},{"style":841},[5072],{"type":418,"value":2247},{"type":412,"tag":620,"props":5074,"children":5075},{"style":853},[5076],{"type":418,"value":3862},{"type":412,"tag":620,"props":5078,"children":5079},{"style":847},[5080],{"type":418,"value":886},{"type":412,"tag":620,"props":5082,"children":5083},{"class":622,"line":2218},[5084],{"type":412,"tag":620,"props":5085,"children":5086},{"emptyLinePlaceholder":892},[5087],{"type":418,"value":895},{"type":412,"tag":620,"props":5089,"children":5090},{"class":622,"line":2226},[5091,5095,5099],{"type":412,"tag":620,"props":5092,"children":5093},{"style":901},[5094],{"type":418,"value":3929},{"type":412,"tag":620,"props":5096,"children":5097},{"style":853},[5098],{"type":418,"value":3482},{"type":412,"tag":620,"props":5100,"children":5101},{"style":847},[5102],{"type":418,"value":886},{"type":412,"tag":620,"props":5104,"children":5105},{"class":622,"line":2271},[5106,5110],{"type":412,"tag":620,"props":5107,"children":5108},{"style":841},[5109],{"type":418,"value":2501},{"type":412,"tag":620,"props":5111,"children":5112},{"style":847},[5113],{"type":418,"value":2195},{"type":412,"tag":620,"props":5115,"children":5116},{"class":622,"line":2313},[5117,5121,5125,5129,5133,5137,5141,5145],{"type":412,"tag":620,"props":5118,"children":5119},{"style":853},[5120],{"type":418,"value":3956},{"type":412,"tag":620,"props":5122,"children":5123},{"style":847},[5124],{"type":418,"value":2242},{"type":412,"tag":620,"props":5126,"children":5127},{"style":841},[5128],{"type":418,"value":2247},{"type":412,"tag":620,"props":5130,"children":5131},{"style":673},[5132],{"type":418,"value":1353},{"type":412,"tag":620,"props":5134,"children":5135},{"style":1958},[5136],{"type":418,"value":2145},{"type":412,"tag":620,"props":5138,"children":5139},{"style":853},[5140],{"type":418,"value":3583},{"type":412,"tag":620,"props":5142,"children":5143},{"style":1958},[5144],{"type":418,"value":1868},{"type":412,"tag":620,"props":5146,"children":5147},{"style":847},[5148],{"type":418,"value":886},{"type":412,"tag":620,"props":5150,"children":5151},{"class":622,"line":2321},[5152,5156,5160],{"type":412,"tag":620,"props":5153,"children":5154},{"style":847},[5155],{"type":418,"value":2754},{"type":412,"tag":620,"props":5157,"children":5158},{"style":841},[5159],{"type":418,"value":3996},{"type":412,"tag":620,"props":5161,"children":5162},{"style":847},[5163],{"type":418,"value":2195},{"type":412,"tag":620,"props":5165,"children":5166},{"class":622,"line":2342},[5167,5171,5175,5179,5183],{"type":412,"tag":620,"props":5168,"children":5169},{"style":841},[5170],{"type":418,"value":2737},{"type":412,"tag":620,"props":5172,"children":5173},{"style":853},[5174],{"type":418,"value":3272},{"type":412,"tag":620,"props":5176,"children":5177},{"style":847},[5178],{"type":418,"value":1090},{"type":412,"tag":620,"props":5180,"children":5181},{"style":673},[5182],{"type":418,"value":3462},{"type":412,"tag":620,"props":5184,"children":5185},{"style":1958},[5186],{"type":418,"value":4025},{"type":412,"tag":620,"props":5188,"children":5189},{"class":622,"line":2351},[5190,5194,5198,5202,5206,5210,5214,5218,5222,5226,5230,5234,5238,5242,5246,5250,5254,5258,5262,5266,5270,5274,5278,5282,5286],{"type":412,"tag":620,"props":5191,"children":5192},{"style":847},[5193],{"type":418,"value":4033},{"type":412,"tag":620,"props":5195,"children":5196},{"style":1958},[5197],{"type":418,"value":4038},{"type":412,"tag":620,"props":5199,"children":5200},{"style":847},[5201],{"type":418,"value":826},{"type":412,"tag":620,"props":5203,"children":5204},{"style":4045},[5205],{"type":418,"value":4048},{"type":412,"tag":620,"props":5207,"children":5208},{"style":847},[5209],{"type":418,"value":1142},{"type":412,"tag":620,"props":5211,"children":5212},{"style":1958},[5213],{"type":418,"value":4057},{"type":412,"tag":620,"props":5215,"children":5216},{"style":847},[5217],{"type":418,"value":826},{"type":412,"tag":620,"props":5219,"children":5220},{"style":847},[5221],{"type":418,"value":850},{"type":412,"tag":620,"props":5223,"children":5224},{"style":1958},[5225],{"type":418,"value":4070},{"type":412,"tag":620,"props":5227,"children":5228},{"style":847},[5229],{"type":418,"value":826},{"type":412,"tag":620,"props":5231,"children":5232},{"style":847},[5233],{"type":418,"value":871},{"type":412,"tag":620,"props":5235,"children":5236},{"style":633},[5237],{"type":418,"value":4083},{"type":412,"tag":620,"props":5239,"children":5240},{"style":847},[5241],{"type":418,"value":881},{"type":412,"tag":620,"props":5243,"children":5244},{"style":847},[5245],{"type":418,"value":1142},{"type":412,"tag":620,"props":5247,"children":5248},{"style":1958},[5249],{"type":418,"value":4096},{"type":412,"tag":620,"props":5251,"children":5252},{"style":847},[5253],{"type":418,"value":826},{"type":412,"tag":620,"props":5255,"children":5256},{"style":847},[5257],{"type":418,"value":4105},{"type":412,"tag":620,"props":5259,"children":5260},{"style":633},[5261],{"type":418,"value":750},{"type":412,"tag":620,"props":5263,"children":5264},{"style":847},[5265],{"type":418,"value":4114},{"type":412,"tag":620,"props":5267,"children":5268},{"style":853},[5269],{"type":418,"value":3583},{"type":412,"tag":620,"props":5271,"children":5272},{"style":847},[5273],{"type":418,"value":4123},{"type":412,"tag":620,"props":5275,"children":5276},{"style":633},[5277],{"type":418,"value":4128},{"type":412,"tag":620,"props":5279,"children":5280},{"style":847},[5281],{"type":418,"value":4133},{"type":412,"tag":620,"props":5283,"children":5284},{"style":847},[5285],{"type":418,"value":861},{"type":412,"tag":620,"props":5287,"children":5288},{"style":847},[5289],{"type":418,"value":4142},{"type":412,"tag":620,"props":5291,"children":5292},{"class":622,"line":2359},[5293,5297,5301,5305,5309],{"type":412,"tag":620,"props":5294,"children":5295},{"style":847},[5296],{"type":418,"value":4033},{"type":412,"tag":620,"props":5298,"children":5299},{"style":1958},[5300],{"type":418,"value":4154},{"type":412,"tag":620,"props":5302,"children":5303},{"style":847},[5304],{"type":418,"value":826},{"type":412,"tag":620,"props":5306,"children":5307},{"style":4161},[5308],{"type":418,"value":4164},{"type":412,"tag":620,"props":5310,"children":5311},{"style":847},[5312],{"type":418,"value":2001},{"type":412,"tag":620,"props":5314,"children":5315},{"class":622,"line":2419},[5316,5320],{"type":412,"tag":620,"props":5317,"children":5318},{"style":1958},[5319],{"type":418,"value":4176},{"type":412,"tag":620,"props":5321,"children":5322},{"style":847},[5323],{"type":418,"value":886},{"type":412,"tag":620,"props":5325,"children":5326},{"class":622,"line":2439},[5327],{"type":412,"tag":620,"props":5328,"children":5329},{"style":847},[5330],{"type":418,"value":2798},{"type":412,"tag":620,"props":5332,"children":5333},{"class":622,"line":2495},[5334],{"type":412,"tag":620,"props":5335,"children":5336},{"emptyLinePlaceholder":892},[5337],{"type":418,"value":895},{"type":412,"tag":620,"props":5339,"children":5340},{"class":622,"line":2508},[5341,5345,5349,5353,5357,5362,5366,5371,5375,5380,5384,5389,5394],{"type":412,"tag":620,"props":5342,"children":5343},{"style":901},[5344],{"type":418,"value":2232},{"type":412,"tag":620,"props":5346,"children":5347},{"style":847},[5348],{"type":418,"value":3512},{"type":412,"tag":620,"props":5350,"children":5351},{"style":853},[5352],{"type":418,"value":378},{"type":412,"tag":620,"props":5354,"children":5355},{"style":847},[5356],{"type":418,"value":1142},{"type":412,"tag":620,"props":5358,"children":5359},{"style":853},[5360],{"type":418,"value":5361}," workflowName",{"type":412,"tag":620,"props":5363,"children":5364},{"style":847},[5365],{"type":418,"value":1142},{"type":412,"tag":620,"props":5367,"children":5368},{"style":853},[5369],{"type":418,"value":5370}," createdAt",{"type":412,"tag":620,"props":5372,"children":5373},{"style":847},[5374],{"type":418,"value":1142},{"type":412,"tag":620,"props":5376,"children":5377},{"style":853},[5378],{"type":418,"value":5379}," startedAt",{"type":412,"tag":620,"props":5381,"children":5382},{"style":847},[5383],{"type":418,"value":1142},{"type":412,"tag":620,"props":5385,"children":5386},{"style":853},[5387],{"type":418,"value":5388}," completedAt",{"type":412,"tag":620,"props":5390,"children":5391},{"style":847},[5392],{"type":418,"value":5393},"]",{"type":412,"tag":620,"props":5395,"children":5396},{"style":847},[5397],{"type":418,"value":1943},{"type":412,"tag":620,"props":5399,"children":5400},{"class":622,"line":2596},[5401,5405,5409,5413,5418],{"type":412,"tag":620,"props":5402,"children":5403},{"style":841},[5404],{"type":418,"value":2514},{"type":412,"tag":620,"props":5406,"children":5407},{"style":627},[5408],{"type":418,"value":2168},{"type":412,"tag":620,"props":5410,"children":5411},{"style":847},[5412],{"type":418,"value":1090},{"type":412,"tag":620,"props":5414,"children":5415},{"style":673},[5416],{"type":418,"value":5417},"all",{"type":412,"tag":620,"props":5419,"children":5420},{"style":1958},[5421],{"type":418,"value":5422},"([\n",{"type":412,"tag":620,"props":5424,"children":5425},{"class":622,"line":2605},[5426,5431,5435,5439],{"type":412,"tag":620,"props":5427,"children":5428},{"style":853},[5429],{"type":418,"value":5430},"      run",{"type":412,"tag":620,"props":5432,"children":5433},{"style":847},[5434],{"type":418,"value":1090},{"type":412,"tag":620,"props":5436,"children":5437},{"style":853},[5438],{"type":418,"value":378},{"type":412,"tag":620,"props":5440,"children":5441},{"style":847},[5442],{"type":418,"value":4675},{"type":412,"tag":620,"props":5444,"children":5445},{"class":622,"line":2647},[5446,5450,5454,5459],{"type":412,"tag":620,"props":5447,"children":5448},{"style":853},[5449],{"type":418,"value":5430},{"type":412,"tag":620,"props":5451,"children":5452},{"style":847},[5453],{"type":418,"value":1090},{"type":412,"tag":620,"props":5455,"children":5456},{"style":853},[5457],{"type":418,"value":5458},"workflowName",{"type":412,"tag":620,"props":5460,"children":5461},{"style":847},[5462],{"type":418,"value":4675},{"type":412,"tag":620,"props":5464,"children":5465},{"class":622,"line":2731},[5466,5470,5474,5479],{"type":412,"tag":620,"props":5467,"children":5468},{"style":853},[5469],{"type":418,"value":5430},{"type":412,"tag":620,"props":5471,"children":5472},{"style":847},[5473],{"type":418,"value":1090},{"type":412,"tag":620,"props":5475,"children":5476},{"style":853},[5477],{"type":418,"value":5478},"createdAt",{"type":412,"tag":620,"props":5480,"children":5481},{"style":847},[5482],{"type":418,"value":4675},{"type":412,"tag":620,"props":5484,"children":5485},{"class":622,"line":2748},[5486,5490,5494,5499],{"type":412,"tag":620,"props":5487,"children":5488},{"style":853},[5489],{"type":418,"value":5430},{"type":412,"tag":620,"props":5491,"children":5492},{"style":847},[5493],{"type":418,"value":1090},{"type":412,"tag":620,"props":5495,"children":5496},{"style":853},[5497],{"type":418,"value":5498},"startedAt",{"type":412,"tag":620,"props":5500,"children":5501},{"style":847},[5502],{"type":418,"value":4675},{"type":412,"tag":620,"props":5504,"children":5505},{"class":622,"line":2766},[5506,5510,5514,5519],{"type":412,"tag":620,"props":5507,"children":5508},{"style":853},[5509],{"type":418,"value":5430},{"type":412,"tag":620,"props":5511,"children":5512},{"style":847},[5513],{"type":418,"value":1090},{"type":412,"tag":620,"props":5515,"children":5516},{"style":853},[5517],{"type":418,"value":5518},"completedAt",{"type":412,"tag":620,"props":5520,"children":5521},{"style":847},[5522],{"type":418,"value":4675},{"type":412,"tag":620,"props":5524,"children":5525},{"class":622,"line":2792},[5526,5531],{"type":412,"tag":620,"props":5527,"children":5528},{"style":1958},[5529],{"type":418,"value":5530},"    ])",{"type":412,"tag":620,"props":5532,"children":5533},{"style":847},[5534],{"type":418,"value":886},{"type":412,"tag":620,"props":5536,"children":5537},{"class":622,"line":2801},[5538],{"type":412,"tag":620,"props":5539,"children":5540},{"emptyLinePlaceholder":892},[5541],{"type":418,"value":895},{"type":412,"tag":620,"props":5543,"children":5544},{"class":622,"line":2809},[5545,5549,5553,5557,5561,5565],{"type":412,"tag":620,"props":5546,"children":5547},{"style":841},[5548],{"type":418,"value":2327},{"type":412,"tag":620,"props":5550,"children":5551},{"style":853},[5552],{"type":418,"value":3272},{"type":412,"tag":620,"props":5554,"children":5555},{"style":847},[5556],{"type":418,"value":1090},{"type":412,"tag":620,"props":5558,"children":5559},{"style":673},[5560],{"type":418,"value":3462},{"type":412,"tag":620,"props":5562,"children":5563},{"style":1958},[5564],{"type":418,"value":2145},{"type":412,"tag":620,"props":5566,"children":5567},{"style":847},[5568],{"type":418,"value":4349},{"type":412,"tag":620,"props":5570,"children":5571},{"class":622,"line":2817},[5572,5577],{"type":412,"tag":620,"props":5573,"children":5574},{"style":853},[5575],{"type":418,"value":5576},"    runId",{"type":412,"tag":620,"props":5578,"children":5579},{"style":847},[5580],{"type":418,"value":4675},{"type":412,"tag":620,"props":5582,"children":5583},{"class":622,"line":2873},[5584,5589],{"type":412,"tag":620,"props":5585,"children":5586},{"style":853},[5587],{"type":418,"value":5588},"    status",{"type":412,"tag":620,"props":5590,"children":5591},{"style":847},[5592],{"type":418,"value":4675},{"type":412,"tag":620,"props":5594,"children":5595},{"class":622,"line":2893},[5596,5601],{"type":412,"tag":620,"props":5597,"children":5598},{"style":853},[5599],{"type":418,"value":5600},"    workflowName",{"type":412,"tag":620,"props":5602,"children":5603},{"style":847},[5604],{"type":418,"value":4675},{"type":412,"tag":620,"props":5606,"children":5607},{"class":622,"line":2945},[5608,5613,5617,5621,5625,5630,5634],{"type":412,"tag":620,"props":5609,"children":5610},{"style":1958},[5611],{"type":418,"value":5612},"    createdAt",{"type":412,"tag":620,"props":5614,"children":5615},{"style":847},[5616],{"type":418,"value":826},{"type":412,"tag":620,"props":5618,"children":5619},{"style":853},[5620],{"type":418,"value":5370},{"type":412,"tag":620,"props":5622,"children":5623},{"style":847},[5624],{"type":418,"value":1090},{"type":412,"tag":620,"props":5626,"children":5627},{"style":673},[5628],{"type":418,"value":5629},"toISOString",{"type":412,"tag":620,"props":5631,"children":5632},{"style":1958},[5633],{"type":418,"value":2475},{"type":412,"tag":620,"props":5635,"children":5636},{"style":847},[5637],{"type":418,"value":4675},{"type":412,"tag":620,"props":5639,"children":5640},{"class":622,"line":2957},[5641,5646,5650,5654,5659,5663,5668,5673],{"type":412,"tag":620,"props":5642,"children":5643},{"style":1958},[5644],{"type":418,"value":5645},"    startedAt",{"type":412,"tag":620,"props":5647,"children":5648},{"style":847},[5649],{"type":418,"value":826},{"type":412,"tag":620,"props":5651,"children":5652},{"style":853},[5653],{"type":418,"value":5379},{"type":412,"tag":620,"props":5655,"children":5656},{"style":847},[5657],{"type":418,"value":5658},"?.",{"type":412,"tag":620,"props":5660,"children":5661},{"style":673},[5662],{"type":418,"value":5629},{"type":412,"tag":620,"props":5664,"children":5665},{"style":1958},[5666],{"type":418,"value":5667},"() ",{"type":412,"tag":620,"props":5669,"children":5670},{"style":847},[5671],{"type":418,"value":5672},"??",{"type":412,"tag":620,"props":5674,"children":5675},{"style":847},[5676],{"type":418,"value":5677}," null,\n",{"type":412,"tag":620,"props":5679,"children":5680},{"class":622,"line":3042},[5681,5686,5690,5694,5698,5702,5706,5710],{"type":412,"tag":620,"props":5682,"children":5683},{"style":1958},[5684],{"type":418,"value":5685},"    completedAt",{"type":412,"tag":620,"props":5687,"children":5688},{"style":847},[5689],{"type":418,"value":826},{"type":412,"tag":620,"props":5691,"children":5692},{"style":853},[5693],{"type":418,"value":5388},{"type":412,"tag":620,"props":5695,"children":5696},{"style":847},[5697],{"type":418,"value":5658},{"type":412,"tag":620,"props":5699,"children":5700},{"style":673},[5701],{"type":418,"value":5629},{"type":412,"tag":620,"props":5703,"children":5704},{"style":1958},[5705],{"type":418,"value":5667},{"type":412,"tag":620,"props":5707,"children":5708},{"style":847},[5709],{"type":418,"value":5672},{"type":412,"tag":620,"props":5711,"children":5712},{"style":847},[5713],{"type":418,"value":5677},{"type":412,"tag":620,"props":5715,"children":5716},{"class":622,"line":3083},[5717,5721,5725],{"type":412,"tag":620,"props":5718,"children":5719},{"style":847},[5720],{"type":418,"value":2754},{"type":412,"tag":620,"props":5722,"children":5723},{"style":1958},[5724],{"type":418,"value":1868},{"type":412,"tag":620,"props":5726,"children":5727},{"style":847},[5728],{"type":418,"value":886},{"type":412,"tag":620,"props":5730,"children":5731},{"class":622,"line":3167},[5732],{"type":412,"tag":620,"props":5733,"children":5734},{"style":847},[5735],{"type":418,"value":2348},{"type":412,"tag":513,"props":5737,"children":5739},{"id":5738},"streaming-with-getwritable",[5740,5742],{"type":418,"value":5741},"Streaming with ",{"type":412,"tag":460,"props":5743,"children":5745},{"className":5744},[],[5746],{"type":418,"value":473},{"type":412,"tag":425,"props":5748,"children":5749},{},[5750,5756,5758,5764],{"type":412,"tag":460,"props":5751,"children":5753},{"className":5752},[],[5754],{"type":418,"value":5755},"getWritable\u003CT>()",{"type":418,"value":5757}," returns a ",{"type":412,"tag":460,"props":5759,"children":5761},{"className":5760},[],[5762],{"type":418,"value":5763},"WritableStream",{"type":418,"value":5765}," scoped to the current run. Call it inside step functions and always release the lock:",{"type":412,"tag":609,"props":5767,"children":5769},{"className":829,"code":5768,"language":831,"meta":614,"style":614},"async function emit\u003CT>(event: T): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003CT>().getWriter();\n  try {\n    await writer.write(event);\n  } finally {\n    writer.releaseLock();\n  }\n}\n",[5770],{"type":412,"tag":460,"props":5771,"children":5772},{"__ignoreMap":614},[5773,5841,5860,5911,5922,5957,5972,5995,6002],{"type":412,"tag":620,"props":5774,"children":5775},{"class":622,"line":623},[5776,5780,5784,5789,5793,5798,5803,5807,5811,5816,5820,5824,5828,5833,5837],{"type":412,"tag":620,"props":5777,"children":5778},{"style":901},[5779],{"type":418,"value":2365},{"type":412,"tag":620,"props":5781,"children":5782},{"style":901},[5783],{"type":418,"value":2135},{"type":412,"tag":620,"props":5785,"children":5786},{"style":673},[5787],{"type":418,"value":5788}," emit",{"type":412,"tag":620,"props":5790,"children":5791},{"style":847},[5792],{"type":418,"value":2402},{"type":412,"tag":620,"props":5794,"children":5795},{"style":627},[5796],{"type":418,"value":5797},"T",{"type":412,"tag":620,"props":5799,"children":5800},{"style":847},[5801],{"type":418,"value":5802},">(",{"type":412,"tag":620,"props":5804,"children":5805},{"style":2148},[5806],{"type":418,"value":361},{"type":412,"tag":620,"props":5808,"children":5809},{"style":847},[5810],{"type":418,"value":826},{"type":412,"tag":620,"props":5812,"children":5813},{"style":627},[5814],{"type":418,"value":5815}," T",{"type":412,"tag":620,"props":5817,"children":5818},{"style":847},[5819],{"type":418,"value":1114},{"type":412,"tag":620,"props":5821,"children":5822},{"style":627},[5823],{"type":418,"value":2168},{"type":412,"tag":620,"props":5825,"children":5826},{"style":847},[5827],{"type":418,"value":2402},{"type":412,"tag":620,"props":5829,"children":5830},{"style":627},[5831],{"type":418,"value":5832},"void",{"type":412,"tag":620,"props":5834,"children":5835},{"style":847},[5836],{"type":418,"value":2412},{"type":412,"tag":620,"props":5838,"children":5839},{"style":847},[5840],{"type":418,"value":2195},{"type":412,"tag":620,"props":5842,"children":5843},{"class":622,"line":669},[5844,5848,5852,5856],{"type":412,"tag":620,"props":5845,"children":5846},{"style":847},[5847],{"type":418,"value":2203},{"type":412,"tag":620,"props":5849,"children":5850},{"style":633},[5851],{"type":418,"value":90},{"type":412,"tag":620,"props":5853,"children":5854},{"style":847},[5855],{"type":418,"value":881},{"type":412,"tag":620,"props":5857,"children":5858},{"style":847},[5859],{"type":418,"value":886},{"type":412,"tag":620,"props":5861,"children":5862},{"class":622,"line":684},[5863,5867,5871,5875,5879,5883,5887,5891,5895,5899,5903,5907],{"type":412,"tag":620,"props":5864,"children":5865},{"style":901},[5866],{"type":418,"value":2232},{"type":412,"tag":620,"props":5868,"children":5869},{"style":853},[5870],{"type":418,"value":2449},{"type":412,"tag":620,"props":5872,"children":5873},{"style":847},[5874],{"type":418,"value":2242},{"type":412,"tag":620,"props":5876,"children":5877},{"style":673},[5878],{"type":418,"value":1137},{"type":412,"tag":620,"props":5880,"children":5881},{"style":847},[5882],{"type":418,"value":2402},{"type":412,"tag":620,"props":5884,"children":5885},{"style":627},[5886],{"type":418,"value":5797},{"type":412,"tag":620,"props":5888,"children":5889},{"style":847},[5890],{"type":418,"value":2412},{"type":412,"tag":620,"props":5892,"children":5893},{"style":1958},[5894],{"type":418,"value":2475},{"type":412,"tag":620,"props":5896,"children":5897},{"style":847},[5898],{"type":418,"value":1090},{"type":412,"tag":620,"props":5900,"children":5901},{"style":673},[5902],{"type":418,"value":2484},{"type":412,"tag":620,"props":5904,"children":5905},{"style":1958},[5906],{"type":418,"value":2475},{"type":412,"tag":620,"props":5908,"children":5909},{"style":847},[5910],{"type":418,"value":886},{"type":412,"tag":620,"props":5912,"children":5913},{"class":622,"line":407},[5914,5918],{"type":412,"tag":620,"props":5915,"children":5916},{"style":841},[5917],{"type":418,"value":2501},{"type":412,"tag":620,"props":5919,"children":5920},{"style":847},[5921],{"type":418,"value":2195},{"type":412,"tag":620,"props":5923,"children":5924},{"class":622,"line":2004},[5925,5929,5933,5937,5941,5945,5949,5953],{"type":412,"tag":620,"props":5926,"children":5927},{"style":841},[5928],{"type":418,"value":2514},{"type":412,"tag":620,"props":5930,"children":5931},{"style":853},[5932],{"type":418,"value":2449},{"type":412,"tag":620,"props":5934,"children":5935},{"style":847},[5936],{"type":418,"value":1090},{"type":412,"tag":620,"props":5938,"children":5939},{"style":673},[5940],{"type":418,"value":2527},{"type":412,"tag":620,"props":5942,"children":5943},{"style":1958},[5944],{"type":418,"value":2145},{"type":412,"tag":620,"props":5946,"children":5947},{"style":853},[5948],{"type":418,"value":361},{"type":412,"tag":620,"props":5950,"children":5951},{"style":1958},[5952],{"type":418,"value":1868},{"type":412,"tag":620,"props":5954,"children":5955},{"style":847},[5956],{"type":418,"value":886},{"type":412,"tag":620,"props":5958,"children":5959},{"class":622,"line":2057},[5960,5964,5968],{"type":412,"tag":620,"props":5961,"children":5962},{"style":847},[5963],{"type":418,"value":2754},{"type":412,"tag":620,"props":5965,"children":5966},{"style":841},[5967],{"type":418,"value":2759},{"type":412,"tag":620,"props":5969,"children":5970},{"style":847},[5971],{"type":418,"value":2195},{"type":412,"tag":620,"props":5973,"children":5974},{"class":622,"line":2112},[5975,5979,5983,5987,5991],{"type":412,"tag":620,"props":5976,"children":5977},{"style":853},[5978],{"type":418,"value":2772},{"type":412,"tag":620,"props":5980,"children":5981},{"style":847},[5982],{"type":418,"value":1090},{"type":412,"tag":620,"props":5984,"children":5985},{"style":673},[5986],{"type":418,"value":2781},{"type":412,"tag":620,"props":5988,"children":5989},{"style":1958},[5990],{"type":418,"value":2475},{"type":412,"tag":620,"props":5992,"children":5993},{"style":847},[5994],{"type":418,"value":886},{"type":412,"tag":620,"props":5996,"children":5997},{"class":622,"line":2120},[5998],{"type":412,"tag":620,"props":5999,"children":6000},{"style":847},[6001],{"type":418,"value":2798},{"type":412,"tag":620,"props":6003,"children":6004},{"class":622,"line":33},[6005],{"type":412,"tag":620,"props":6006,"children":6007},{"style":847},[6008],{"type":418,"value":2348},{"type":412,"tag":425,"props":6010,"children":6011},{},[6012,6014,6020],{"type":418,"value":6013},"Consumers read via ",{"type":412,"tag":460,"props":6015,"children":6017},{"className":6016},[],[6018],{"type":418,"value":6019},"getRun(runId).getReadable()",{"type":418,"value":6021}," in the readable route (see above).",{"type":412,"tag":425,"props":6023,"children":6024},{},[6025,6030,6032,6038,6039,6045,6047,6053],{"type":412,"tag":429,"props":6026,"children":6027},{},[6028],{"type":418,"value":6029},"Rendering workflow events in the UI",{"type":418,"value":6031},": When workflow events contain AI-generated text (narratives, briefings, reports), render them with ",{"type":412,"tag":460,"props":6033,"children":6035},{"className":6034},[],[6036],{"type":418,"value":6037},"\u003CMessageResponse>",{"type":418,"value":3619},{"type":412,"tag":460,"props":6040,"children":6042},{"className":6041},[],[6043],{"type":418,"value":6044},"@\u002Fcomponents\u002Fai-elements\u002Fmessage",{"type":418,"value":6046}," — never as raw ",{"type":412,"tag":460,"props":6048,"children":6050},{"className":6049},[],[6051],{"type":418,"value":6052},"{event.content}",{"type":418,"value":6054},". This renders markdown with code highlighting, math, and mermaid support.",{"type":412,"tag":609,"props":6056,"children":6060},{"className":6057,"code":6058,"language":6059,"meta":614,"style":614},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { MessageResponse } from \"@\u002Fcomponents\u002Fai-elements\u002Fmessage\";\n\n\u002F\u002F In your event stream display\n{events.map(event => (\n  event.type === \"narrative\" && \u003CMessageResponse>{event.text}\u003C\u002FMessageResponse>\n))}\n","tsx",[6061],{"type":412,"tag":460,"props":6062,"children":6063},{"__ignoreMap":614},[6064,6104,6111,6119,6158,6237],{"type":412,"tag":620,"props":6065,"children":6066},{"class":622,"line":623},[6067,6071,6075,6080,6084,6088,6092,6096,6100],{"type":412,"tag":620,"props":6068,"children":6069},{"style":841},[6070],{"type":418,"value":844},{"type":412,"tag":620,"props":6072,"children":6073},{"style":847},[6074],{"type":418,"value":850},{"type":412,"tag":620,"props":6076,"children":6077},{"style":853},[6078],{"type":418,"value":6079}," MessageResponse",{"type":412,"tag":620,"props":6081,"children":6082},{"style":847},[6083],{"type":418,"value":861},{"type":412,"tag":620,"props":6085,"children":6086},{"style":841},[6087],{"type":418,"value":866},{"type":412,"tag":620,"props":6089,"children":6090},{"style":847},[6091],{"type":418,"value":871},{"type":412,"tag":620,"props":6093,"children":6094},{"style":633},[6095],{"type":418,"value":6044},{"type":412,"tag":620,"props":6097,"children":6098},{"style":847},[6099],{"type":418,"value":881},{"type":412,"tag":620,"props":6101,"children":6102},{"style":847},[6103],{"type":418,"value":886},{"type":412,"tag":620,"props":6105,"children":6106},{"class":622,"line":669},[6107],{"type":412,"tag":620,"props":6108,"children":6109},{"emptyLinePlaceholder":892},[6110],{"type":418,"value":895},{"type":412,"tag":620,"props":6112,"children":6113},{"class":622,"line":684},[6114],{"type":412,"tag":620,"props":6115,"children":6116},{"style":1005},[6117],{"type":418,"value":6118},"\u002F\u002F In your event stream display\n",{"type":412,"tag":620,"props":6120,"children":6121},{"class":622,"line":407},[6122,6126,6131,6135,6140,6144,6148,6153],{"type":412,"tag":620,"props":6123,"children":6124},{"style":847},[6125],{"type":418,"value":2536},{"type":412,"tag":620,"props":6127,"children":6128},{"style":853},[6129],{"type":418,"value":6130},"events",{"type":412,"tag":620,"props":6132,"children":6133},{"style":847},[6134],{"type":418,"value":1090},{"type":412,"tag":620,"props":6136,"children":6137},{"style":673},[6138],{"type":418,"value":6139},"map",{"type":412,"tag":620,"props":6141,"children":6142},{"style":1958},[6143],{"type":418,"value":2145},{"type":412,"tag":620,"props":6145,"children":6146},{"style":2148},[6147],{"type":418,"value":361},{"type":412,"tag":620,"props":6149,"children":6150},{"style":901},[6151],{"type":418,"value":6152}," =>",{"type":412,"tag":620,"props":6154,"children":6155},{"style":1958},[6156],{"type":418,"value":6157}," (\n",{"type":412,"tag":620,"props":6159,"children":6160},{"class":622,"line":2004},[6161,6166,6170,6174,6178,6182,6187,6191,6196,6201,6206,6211,6215,6219,6223,6228,6232],{"type":412,"tag":620,"props":6162,"children":6163},{"style":853},[6164],{"type":418,"value":6165},"  event",{"type":412,"tag":620,"props":6167,"children":6168},{"style":847},[6169],{"type":418,"value":1090},{"type":412,"tag":620,"props":6171,"children":6172},{"style":853},[6173],{"type":418,"value":3747},{"type":412,"tag":620,"props":6175,"children":6176},{"style":847},[6177],{"type":418,"value":4414},{"type":412,"tag":620,"props":6179,"children":6180},{"style":847},[6181],{"type":418,"value":871},{"type":412,"tag":620,"props":6183,"children":6184},{"style":633},[6185],{"type":418,"value":6186},"narrative",{"type":412,"tag":620,"props":6188,"children":6189},{"style":847},[6190],{"type":418,"value":881},{"type":412,"tag":620,"props":6192,"children":6193},{"style":847},[6194],{"type":418,"value":6195}," &&",{"type":412,"tag":620,"props":6197,"children":6198},{"style":847},[6199],{"type":418,"value":6200}," \u003C",{"type":412,"tag":620,"props":6202,"children":6203},{"style":627},[6204],{"type":418,"value":6205},"MessageResponse",{"type":412,"tag":620,"props":6207,"children":6208},{"style":847},[6209],{"type":418,"value":6210},">{",{"type":412,"tag":620,"props":6212,"children":6213},{"style":853},[6214],{"type":418,"value":361},{"type":412,"tag":620,"props":6216,"children":6217},{"style":847},[6218],{"type":418,"value":1090},{"type":412,"tag":620,"props":6220,"children":6221},{"style":853},[6222],{"type":418,"value":418},{"type":412,"tag":620,"props":6224,"children":6225},{"style":847},[6226],{"type":418,"value":6227},"}\u003C\u002F",{"type":412,"tag":620,"props":6229,"children":6230},{"style":627},[6231],{"type":418,"value":6205},{"type":412,"tag":620,"props":6233,"children":6234},{"style":847},[6235],{"type":418,"value":6236},">\n",{"type":412,"tag":620,"props":6238,"children":6239},{"class":622,"line":2057},[6240,6244],{"type":412,"tag":620,"props":6241,"children":6242},{"style":1958},[6243],{"type":418,"value":4544},{"type":412,"tag":620,"props":6245,"children":6246},{"style":847},[6247],{"type":418,"value":2348},{"type":412,"tag":513,"props":6249,"children":6251},{"id":6250},"hooks-waiting-for-external-events",[6252],{"type":418,"value":6253},"Hooks — Waiting for External Events",{"type":412,"tag":425,"props":6255,"children":6256},{},[6257,6259,6264,6266,6271,6273,6279,6281,6287],{"type":418,"value":6258},"Use ",{"type":412,"tag":460,"props":6260,"children":6262},{"className":6261},[],[6263],{"type":418,"value":1657},{"type":418,"value":6265}," for typed, reusable hooks. ",{"type":412,"tag":429,"props":6267,"children":6268},{},[6269],{"type":418,"value":6270},"Three required pieces",{"type":418,"value":6272},": (1) define + create the hook in the workflow, (2) emit the token to the client via ",{"type":412,"tag":460,"props":6274,"children":6276},{"className":6275},[],[6277],{"type":418,"value":6278},"getWritable",{"type":418,"value":6280},", (3) create an API route that calls ",{"type":412,"tag":460,"props":6282,"children":6284},{"className":6283},[],[6285],{"type":418,"value":6286},"resumeHook",{"type":418,"value":6288}," so the client can resume it.",{"type":412,"tag":800,"props":6290,"children":6292},{"id":6291},"_1-define-and-create-the-hook-workflow-file",[6293],{"type":418,"value":6294},"1. Define and create the hook (workflow file)",{"type":412,"tag":609,"props":6296,"children":6298},{"className":829,"code":6297,"language":831,"meta":614,"style":614},"import { defineHook, getWritable, sleep } from \"workflow\";\n\nexport interface ApprovalPayload {\n  approved: boolean;\n  comment?: string;\n}\n\n\u002F\u002F Define at module scope — reusable across workflows\nexport const approvalHook = defineHook\u003CApprovalPayload>();\n\nexport async function approvalGate(orderId: string): Promise\u003C{ status: string }> {\n  \"use workflow\";\n\n  \u002F\u002F .create() returns a hook instance — NOT directly callable\n  const hook = approvalHook.create({ token: `approval:${orderId}` });\n\n  \u002F\u002F CRITICAL: Emit the token to the client so it knows what to resume\n  await emitToken(hook.token, orderId);\n\n  \u002F\u002F Race between approval and timeout\n  const result = await Promise.race([\n    hook.then((payload) => ({ type: \"approval\" as const, payload })),\n    sleep(\"24h\").then(() => ({ type: \"timeout\" as const, payload: null })),\n  ]);\n\n  if (result.type === \"timeout\") {\n    return { status: \"timeout\" };\n  }\n  return { status: result.payload!.approved ? \"approved\" : \"rejected\" };\n}\n\nasync function emitToken(token: string, orderId: string): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003C{ type: string; token: string; orderId: string }>().getWriter();\n  try {\n    await writer.write({ type: \"awaiting_approval\", token, orderId });\n  } finally {\n    writer.releaseLock();\n  }\n}\n",[6299],{"type":412,"tag":460,"props":6300,"children":6301},{"__ignoreMap":614},[6302,6357,6364,6385,6406,6427,6434,6441,6449,6495,6502,6571,6590,6597,6605,6686,6693,6701,6749,6756,6764,6800,6895,7009,7021,7028,7078,7113,7120,7198,7205,7212,7283,7302,7393,7404,7480,7495,7518,7525],{"type":412,"tag":620,"props":6303,"children":6304},{"class":622,"line":623},[6305,6309,6313,6317,6321,6325,6329,6333,6337,6341,6345,6349,6353],{"type":412,"tag":620,"props":6306,"children":6307},{"style":841},[6308],{"type":418,"value":844},{"type":412,"tag":620,"props":6310,"children":6311},{"style":847},[6312],{"type":418,"value":850},{"type":412,"tag":620,"props":6314,"children":6315},{"style":853},[6316],{"type":418,"value":1214},{"type":412,"tag":620,"props":6318,"children":6319},{"style":847},[6320],{"type":418,"value":1142},{"type":412,"tag":620,"props":6322,"children":6323},{"style":853},[6324],{"type":418,"value":1137},{"type":412,"tag":620,"props":6326,"children":6327},{"style":847},[6328],{"type":418,"value":1142},{"type":412,"tag":620,"props":6330,"children":6331},{"style":853},[6332],{"type":418,"value":1196},{"type":412,"tag":620,"props":6334,"children":6335},{"style":847},[6336],{"type":418,"value":861},{"type":412,"tag":620,"props":6338,"children":6339},{"style":841},[6340],{"type":418,"value":866},{"type":412,"tag":620,"props":6342,"children":6343},{"style":847},[6344],{"type":418,"value":871},{"type":412,"tag":620,"props":6346,"children":6347},{"style":633},[6348],{"type":418,"value":4},{"type":412,"tag":620,"props":6350,"children":6351},{"style":847},[6352],{"type":418,"value":881},{"type":412,"tag":620,"props":6354,"children":6355},{"style":847},[6356],{"type":418,"value":886},{"type":412,"tag":620,"props":6358,"children":6359},{"class":622,"line":669},[6360],{"type":412,"tag":620,"props":6361,"children":6362},{"emptyLinePlaceholder":892},[6363],{"type":418,"value":895},{"type":412,"tag":620,"props":6365,"children":6366},{"class":622,"line":684},[6367,6371,6376,6381],{"type":412,"tag":620,"props":6368,"children":6369},{"style":841},[6370],{"type":418,"value":927},{"type":412,"tag":620,"props":6372,"children":6373},{"style":901},[6374],{"type":418,"value":6375}," interface",{"type":412,"tag":620,"props":6377,"children":6378},{"style":627},[6379],{"type":418,"value":6380}," ApprovalPayload",{"type":412,"tag":620,"props":6382,"children":6383},{"style":847},[6384],{"type":418,"value":2195},{"type":412,"tag":620,"props":6386,"children":6387},{"class":622,"line":407},[6388,6393,6397,6402],{"type":412,"tag":620,"props":6389,"children":6390},{"style":1958},[6391],{"type":418,"value":6392},"  approved",{"type":412,"tag":620,"props":6394,"children":6395},{"style":847},[6396],{"type":418,"value":826},{"type":412,"tag":620,"props":6398,"children":6399},{"style":627},[6400],{"type":418,"value":6401}," boolean",{"type":412,"tag":620,"props":6403,"children":6404},{"style":847},[6405],{"type":418,"value":886},{"type":412,"tag":620,"props":6407,"children":6408},{"class":622,"line":2004},[6409,6414,6419,6423],{"type":412,"tag":620,"props":6410,"children":6411},{"style":1958},[6412],{"type":418,"value":6413},"  comment",{"type":412,"tag":620,"props":6415,"children":6416},{"style":847},[6417],{"type":418,"value":6418},"?:",{"type":412,"tag":620,"props":6420,"children":6421},{"style":627},[6422],{"type":418,"value":1996},{"type":412,"tag":620,"props":6424,"children":6425},{"style":847},[6426],{"type":418,"value":886},{"type":412,"tag":620,"props":6428,"children":6429},{"class":622,"line":2057},[6430],{"type":412,"tag":620,"props":6431,"children":6432},{"style":847},[6433],{"type":418,"value":2348},{"type":412,"tag":620,"props":6435,"children":6436},{"class":622,"line":2112},[6437],{"type":412,"tag":620,"props":6438,"children":6439},{"emptyLinePlaceholder":892},[6440],{"type":418,"value":895},{"type":412,"tag":620,"props":6442,"children":6443},{"class":622,"line":2120},[6444],{"type":412,"tag":620,"props":6445,"children":6446},{"style":1005},[6447],{"type":418,"value":6448},"\u002F\u002F Define at module scope — reusable across workflows\n",{"type":412,"tag":620,"props":6450,"children":6451},{"class":622,"line":33},[6452,6456,6461,6466,6470,6474,6478,6483,6487,6491],{"type":412,"tag":620,"props":6453,"children":6454},{"style":841},[6455],{"type":418,"value":927},{"type":412,"tag":620,"props":6457,"children":6458},{"style":901},[6459],{"type":418,"value":6460}," const",{"type":412,"tag":620,"props":6462,"children":6463},{"style":853},[6464],{"type":418,"value":6465}," approvalHook ",{"type":412,"tag":620,"props":6467,"children":6468},{"style":847},[6469],{"type":418,"value":914},{"type":412,"tag":620,"props":6471,"children":6472},{"style":673},[6473],{"type":418,"value":1214},{"type":412,"tag":620,"props":6475,"children":6476},{"style":847},[6477],{"type":418,"value":2402},{"type":412,"tag":620,"props":6479,"children":6480},{"style":627},[6481],{"type":418,"value":6482},"ApprovalPayload",{"type":412,"tag":620,"props":6484,"children":6485},{"style":847},[6486],{"type":418,"value":2412},{"type":412,"tag":620,"props":6488,"children":6489},{"style":853},[6490],{"type":418,"value":2475},{"type":412,"tag":620,"props":6492,"children":6493},{"style":847},[6494],{"type":418,"value":886},{"type":412,"tag":620,"props":6496,"children":6497},{"class":622,"line":2218},[6498],{"type":412,"tag":620,"props":6499,"children":6500},{"emptyLinePlaceholder":892},[6501],{"type":418,"value":895},{"type":412,"tag":620,"props":6503,"children":6504},{"class":622,"line":2226},[6505,6509,6513,6517,6522,6526,6531,6535,6539,6543,6547,6551,6555,6559,6563,6567],{"type":412,"tag":620,"props":6506,"children":6507},{"style":841},[6508],{"type":418,"value":927},{"type":412,"tag":620,"props":6510,"children":6511},{"style":901},[6512],{"type":418,"value":2130},{"type":412,"tag":620,"props":6514,"children":6515},{"style":901},[6516],{"type":418,"value":2135},{"type":412,"tag":620,"props":6518,"children":6519},{"style":673},[6520],{"type":418,"value":6521}," approvalGate",{"type":412,"tag":620,"props":6523,"children":6524},{"style":847},[6525],{"type":418,"value":2145},{"type":412,"tag":620,"props":6527,"children":6528},{"style":2148},[6529],{"type":418,"value":6530},"orderId",{"type":412,"tag":620,"props":6532,"children":6533},{"style":847},[6534],{"type":418,"value":826},{"type":412,"tag":620,"props":6536,"children":6537},{"style":627},[6538],{"type":418,"value":1996},{"type":412,"tag":620,"props":6540,"children":6541},{"style":847},[6542],{"type":418,"value":1114},{"type":412,"tag":620,"props":6544,"children":6545},{"style":627},[6546],{"type":418,"value":2168},{"type":412,"tag":620,"props":6548,"children":6549},{"style":847},[6550],{"type":418,"value":2173},{"type":412,"tag":620,"props":6552,"children":6553},{"style":1958},[6554],{"type":418,"value":4154},{"type":412,"tag":620,"props":6556,"children":6557},{"style":847},[6558],{"type":418,"value":826},{"type":412,"tag":620,"props":6560,"children":6561},{"style":627},[6562],{"type":418,"value":1996},{"type":412,"tag":620,"props":6564,"children":6565},{"style":847},[6566],{"type":418,"value":2190},{"type":412,"tag":620,"props":6568,"children":6569},{"style":847},[6570],{"type":418,"value":2195},{"type":412,"tag":620,"props":6572,"children":6573},{"class":622,"line":2271},[6574,6578,6582,6586],{"type":412,"tag":620,"props":6575,"children":6576},{"style":847},[6577],{"type":418,"value":2203},{"type":412,"tag":620,"props":6579,"children":6580},{"style":633},[6581],{"type":418,"value":89},{"type":412,"tag":620,"props":6583,"children":6584},{"style":847},[6585],{"type":418,"value":881},{"type":412,"tag":620,"props":6587,"children":6588},{"style":847},[6589],{"type":418,"value":886},{"type":412,"tag":620,"props":6591,"children":6592},{"class":622,"line":2313},[6593],{"type":412,"tag":620,"props":6594,"children":6595},{"emptyLinePlaceholder":892},[6596],{"type":418,"value":895},{"type":412,"tag":620,"props":6598,"children":6599},{"class":622,"line":2321},[6600],{"type":412,"tag":620,"props":6601,"children":6602},{"style":1005},[6603],{"type":418,"value":6604},"  \u002F\u002F .create() returns a hook instance — NOT directly callable\n",{"type":412,"tag":620,"props":6606,"children":6607},{"class":622,"line":2342},[6608,6612,6617,6621,6626,6630,6635,6639,6643,6648,6652,6656,6661,6665,6669,6674,6678,6682],{"type":412,"tag":620,"props":6609,"children":6610},{"style":901},[6611],{"type":418,"value":2232},{"type":412,"tag":620,"props":6613,"children":6614},{"style":853},[6615],{"type":418,"value":6616}," hook",{"type":412,"tag":620,"props":6618,"children":6619},{"style":847},[6620],{"type":418,"value":2242},{"type":412,"tag":620,"props":6622,"children":6623},{"style":853},[6624],{"type":418,"value":6625}," approvalHook",{"type":412,"tag":620,"props":6627,"children":6628},{"style":847},[6629],{"type":418,"value":1090},{"type":412,"tag":620,"props":6631,"children":6632},{"style":673},[6633],{"type":418,"value":6634},"create",{"type":412,"tag":620,"props":6636,"children":6637},{"style":1958},[6638],{"type":418,"value":2145},{"type":412,"tag":620,"props":6640,"children":6641},{"style":847},[6642],{"type":418,"value":2536},{"type":412,"tag":620,"props":6644,"children":6645},{"style":1958},[6646],{"type":418,"value":6647}," token",{"type":412,"tag":620,"props":6649,"children":6650},{"style":847},[6651],{"type":418,"value":826},{"type":412,"tag":620,"props":6653,"children":6654},{"style":847},[6655],{"type":418,"value":4105},{"type":412,"tag":620,"props":6657,"children":6658},{"style":633},[6659],{"type":418,"value":6660},"approval:",{"type":412,"tag":620,"props":6662,"children":6663},{"style":847},[6664],{"type":418,"value":4114},{"type":412,"tag":620,"props":6666,"children":6667},{"style":853},[6668],{"type":418,"value":6530},{"type":412,"tag":620,"props":6670,"children":6671},{"style":847},[6672],{"type":418,"value":6673},"}`",{"type":412,"tag":620,"props":6675,"children":6676},{"style":847},[6677],{"type":418,"value":861},{"type":412,"tag":620,"props":6679,"children":6680},{"style":1958},[6681],{"type":418,"value":1868},{"type":412,"tag":620,"props":6683,"children":6684},{"style":847},[6685],{"type":418,"value":886},{"type":412,"tag":620,"props":6687,"children":6688},{"class":622,"line":2351},[6689],{"type":412,"tag":620,"props":6690,"children":6691},{"emptyLinePlaceholder":892},[6692],{"type":418,"value":895},{"type":412,"tag":620,"props":6694,"children":6695},{"class":622,"line":2359},[6696],{"type":412,"tag":620,"props":6697,"children":6698},{"style":1005},[6699],{"type":418,"value":6700},"  \u002F\u002F CRITICAL: Emit the token to the client so it knows what to resume\n",{"type":412,"tag":620,"props":6702,"children":6703},{"class":622,"line":2419},[6704,6709,6714,6718,6723,6727,6732,6736,6741,6745],{"type":412,"tag":620,"props":6705,"children":6706},{"style":841},[6707],{"type":418,"value":6708},"  await",{"type":412,"tag":620,"props":6710,"children":6711},{"style":673},[6712],{"type":418,"value":6713}," emitToken",{"type":412,"tag":620,"props":6715,"children":6716},{"style":1958},[6717],{"type":418,"value":2145},{"type":412,"tag":620,"props":6719,"children":6720},{"style":853},[6721],{"type":418,"value":6722},"hook",{"type":412,"tag":620,"props":6724,"children":6725},{"style":847},[6726],{"type":418,"value":1090},{"type":412,"tag":620,"props":6728,"children":6729},{"style":853},[6730],{"type":418,"value":6731},"token",{"type":412,"tag":620,"props":6733,"children":6734},{"style":847},[6735],{"type":418,"value":1142},{"type":412,"tag":620,"props":6737,"children":6738},{"style":853},[6739],{"type":418,"value":6740}," orderId",{"type":412,"tag":620,"props":6742,"children":6743},{"style":1958},[6744],{"type":418,"value":1868},{"type":412,"tag":620,"props":6746,"children":6747},{"style":847},[6748],{"type":418,"value":886},{"type":412,"tag":620,"props":6750,"children":6751},{"class":622,"line":2439},[6752],{"type":412,"tag":620,"props":6753,"children":6754},{"emptyLinePlaceholder":892},[6755],{"type":418,"value":895},{"type":412,"tag":620,"props":6757,"children":6758},{"class":622,"line":2495},[6759],{"type":412,"tag":620,"props":6760,"children":6761},{"style":1005},[6762],{"type":418,"value":6763},"  \u002F\u002F Race between approval and timeout\n",{"type":412,"tag":620,"props":6765,"children":6766},{"class":622,"line":2508},[6767,6771,6775,6779,6783,6787,6791,6796],{"type":412,"tag":620,"props":6768,"children":6769},{"style":901},[6770],{"type":418,"value":2232},{"type":412,"tag":620,"props":6772,"children":6773},{"style":853},[6774],{"type":418,"value":2096},{"type":412,"tag":620,"props":6776,"children":6777},{"style":847},[6778],{"type":418,"value":2242},{"type":412,"tag":620,"props":6780,"children":6781},{"style":841},[6782],{"type":418,"value":2247},{"type":412,"tag":620,"props":6784,"children":6785},{"style":627},[6786],{"type":418,"value":2168},{"type":412,"tag":620,"props":6788,"children":6789},{"style":847},[6790],{"type":418,"value":1090},{"type":412,"tag":620,"props":6792,"children":6793},{"style":673},[6794],{"type":418,"value":6795},"race",{"type":412,"tag":620,"props":6797,"children":6798},{"style":1958},[6799],{"type":418,"value":5422},{"type":412,"tag":620,"props":6801,"children":6802},{"class":622,"line":2596},[6803,6808,6812,6817,6821,6825,6830,6834,6838,6842,6846,6850,6854,6858,6862,6866,6870,6874,6878,6883,6887,6891],{"type":412,"tag":620,"props":6804,"children":6805},{"style":853},[6806],{"type":418,"value":6807},"    hook",{"type":412,"tag":620,"props":6809,"children":6810},{"style":847},[6811],{"type":418,"value":1090},{"type":412,"tag":620,"props":6813,"children":6814},{"style":673},[6815],{"type":418,"value":6816},"then",{"type":412,"tag":620,"props":6818,"children":6819},{"style":1958},[6820],{"type":418,"value":2145},{"type":412,"tag":620,"props":6822,"children":6823},{"style":847},[6824],{"type":418,"value":2145},{"type":412,"tag":620,"props":6826,"children":6827},{"style":2148},[6828],{"type":418,"value":6829},"payload",{"type":412,"tag":620,"props":6831,"children":6832},{"style":847},[6833],{"type":418,"value":1868},{"type":412,"tag":620,"props":6835,"children":6836},{"style":901},[6837],{"type":418,"value":6152},{"type":412,"tag":620,"props":6839,"children":6840},{"style":1958},[6841],{"type":418,"value":4286},{"type":412,"tag":620,"props":6843,"children":6844},{"style":847},[6845],{"type":418,"value":2536},{"type":412,"tag":620,"props":6847,"children":6848},{"style":1958},[6849],{"type":418,"value":1933},{"type":412,"tag":620,"props":6851,"children":6852},{"style":847},[6853],{"type":418,"value":826},{"type":412,"tag":620,"props":6855,"children":6856},{"style":847},[6857],{"type":418,"value":871},{"type":412,"tag":620,"props":6859,"children":6860},{"style":633},[6861],{"type":418,"value":300},{"type":412,"tag":620,"props":6863,"children":6864},{"style":847},[6865],{"type":418,"value":881},{"type":412,"tag":620,"props":6867,"children":6868},{"style":841},[6869],{"type":418,"value":4296},{"type":412,"tag":620,"props":6871,"children":6872},{"style":901},[6873],{"type":418,"value":6460},{"type":412,"tag":620,"props":6875,"children":6876},{"style":847},[6877],{"type":418,"value":1142},{"type":412,"tag":620,"props":6879,"children":6880},{"style":853},[6881],{"type":418,"value":6882}," payload",{"type":412,"tag":620,"props":6884,"children":6885},{"style":847},[6886],{"type":418,"value":861},{"type":412,"tag":620,"props":6888,"children":6889},{"style":1958},[6890],{"type":418,"value":4544},{"type":412,"tag":620,"props":6892,"children":6893},{"style":847},[6894],{"type":418,"value":4675},{"type":412,"tag":620,"props":6896,"children":6897},{"class":622,"line":2605},[6898,6903,6907,6911,6916,6920,6924,6928,6932,6936,6940,6944,6948,6952,6956,6960,6964,6968,6972,6976,6980,6984,6988,6992,6997,7001,7005],{"type":412,"tag":620,"props":6899,"children":6900},{"style":673},[6901],{"type":418,"value":6902},"    sleep",{"type":412,"tag":620,"props":6904,"children":6905},{"style":1958},[6906],{"type":418,"value":2145},{"type":412,"tag":620,"props":6908,"children":6909},{"style":847},[6910],{"type":418,"value":881},{"type":412,"tag":620,"props":6912,"children":6913},{"style":633},[6914],{"type":418,"value":6915},"24h",{"type":412,"tag":620,"props":6917,"children":6918},{"style":847},[6919],{"type":418,"value":881},{"type":412,"tag":620,"props":6921,"children":6922},{"style":1958},[6923],{"type":418,"value":1868},{"type":412,"tag":620,"props":6925,"children":6926},{"style":847},[6927],{"type":418,"value":1090},{"type":412,"tag":620,"props":6929,"children":6930},{"style":673},[6931],{"type":418,"value":6816},{"type":412,"tag":620,"props":6933,"children":6934},{"style":1958},[6935],{"type":418,"value":2145},{"type":412,"tag":620,"props":6937,"children":6938},{"style":847},[6939],{"type":418,"value":2475},{"type":412,"tag":620,"props":6941,"children":6942},{"style":901},[6943],{"type":418,"value":6152},{"type":412,"tag":620,"props":6945,"children":6946},{"style":1958},[6947],{"type":418,"value":4286},{"type":412,"tag":620,"props":6949,"children":6950},{"style":847},[6951],{"type":418,"value":2536},{"type":412,"tag":620,"props":6953,"children":6954},{"style":1958},[6955],{"type":418,"value":1933},{"type":412,"tag":620,"props":6957,"children":6958},{"style":847},[6959],{"type":418,"value":826},{"type":412,"tag":620,"props":6961,"children":6962},{"style":847},[6963],{"type":418,"value":871},{"type":412,"tag":620,"props":6965,"children":6966},{"style":633},[6967],{"type":418,"value":367},{"type":412,"tag":620,"props":6969,"children":6970},{"style":847},[6971],{"type":418,"value":881},{"type":412,"tag":620,"props":6973,"children":6974},{"style":841},[6975],{"type":418,"value":4296},{"type":412,"tag":620,"props":6977,"children":6978},{"style":901},[6979],{"type":418,"value":6460},{"type":412,"tag":620,"props":6981,"children":6982},{"style":847},[6983],{"type":418,"value":1142},{"type":412,"tag":620,"props":6985,"children":6986},{"style":1958},[6987],{"type":418,"value":6882},{"type":412,"tag":620,"props":6989,"children":6990},{"style":847},[6991],{"type":418,"value":826},{"type":412,"tag":620,"props":6993,"children":6994},{"style":847},[6995],{"type":418,"value":6996}," null",{"type":412,"tag":620,"props":6998,"children":6999},{"style":847},[7000],{"type":418,"value":861},{"type":412,"tag":620,"props":7002,"children":7003},{"style":1958},[7004],{"type":418,"value":4544},{"type":412,"tag":620,"props":7006,"children":7007},{"style":847},[7008],{"type":418,"value":4675},{"type":412,"tag":620,"props":7010,"children":7011},{"class":622,"line":2647},[7012,7017],{"type":412,"tag":620,"props":7013,"children":7014},{"style":1958},[7015],{"type":418,"value":7016},"  ])",{"type":412,"tag":620,"props":7018,"children":7019},{"style":847},[7020],{"type":418,"value":886},{"type":412,"tag":620,"props":7022,"children":7023},{"class":622,"line":2731},[7024],{"type":412,"tag":620,"props":7025,"children":7026},{"emptyLinePlaceholder":892},[7027],{"type":418,"value":895},{"type":412,"tag":620,"props":7029,"children":7030},{"class":622,"line":2748},[7031,7036,7040,7045,7049,7053,7057,7061,7065,7069,7074],{"type":412,"tag":620,"props":7032,"children":7033},{"style":841},[7034],{"type":418,"value":7035},"  if",{"type":412,"tag":620,"props":7037,"children":7038},{"style":1958},[7039],{"type":418,"value":4286},{"type":412,"tag":620,"props":7041,"children":7042},{"style":853},[7043],{"type":418,"value":7044},"result",{"type":412,"tag":620,"props":7046,"children":7047},{"style":847},[7048],{"type":418,"value":1090},{"type":412,"tag":620,"props":7050,"children":7051},{"style":853},[7052],{"type":418,"value":3747},{"type":412,"tag":620,"props":7054,"children":7055},{"style":847},[7056],{"type":418,"value":4414},{"type":412,"tag":620,"props":7058,"children":7059},{"style":847},[7060],{"type":418,"value":871},{"type":412,"tag":620,"props":7062,"children":7063},{"style":633},[7064],{"type":418,"value":367},{"type":412,"tag":620,"props":7066,"children":7067},{"style":847},[7068],{"type":418,"value":881},{"type":412,"tag":620,"props":7070,"children":7071},{"style":1958},[7072],{"type":418,"value":7073},") ",{"type":412,"tag":620,"props":7075,"children":7076},{"style":847},[7077],{"type":418,"value":4349},{"type":412,"tag":620,"props":7079,"children":7080},{"class":622,"line":2766},[7081,7085,7089,7093,7097,7101,7105,7109],{"type":412,"tag":620,"props":7082,"children":7083},{"style":841},[7084],{"type":418,"value":2737},{"type":412,"tag":620,"props":7086,"children":7087},{"style":847},[7088],{"type":418,"value":850},{"type":412,"tag":620,"props":7090,"children":7091},{"style":1958},[7092],{"type":418,"value":4154},{"type":412,"tag":620,"props":7094,"children":7095},{"style":847},[7096],{"type":418,"value":826},{"type":412,"tag":620,"props":7098,"children":7099},{"style":847},[7100],{"type":418,"value":871},{"type":412,"tag":620,"props":7102,"children":7103},{"style":633},[7104],{"type":418,"value":367},{"type":412,"tag":620,"props":7106,"children":7107},{"style":847},[7108],{"type":418,"value":881},{"type":412,"tag":620,"props":7110,"children":7111},{"style":847},[7112],{"type":418,"value":2109},{"type":412,"tag":620,"props":7114,"children":7115},{"class":622,"line":2792},[7116],{"type":412,"tag":620,"props":7117,"children":7118},{"style":847},[7119],{"type":418,"value":2798},{"type":412,"tag":620,"props":7121,"children":7122},{"class":622,"line":2801},[7123,7127,7131,7135,7139,7143,7147,7151,7156,7161,7165,7169,7173,7177,7181,7185,7190,7194],{"type":412,"tag":620,"props":7124,"children":7125},{"style":841},[7126],{"type":418,"value":2327},{"type":412,"tag":620,"props":7128,"children":7129},{"style":847},[7130],{"type":418,"value":850},{"type":412,"tag":620,"props":7132,"children":7133},{"style":1958},[7134],{"type":418,"value":4154},{"type":412,"tag":620,"props":7136,"children":7137},{"style":847},[7138],{"type":418,"value":826},{"type":412,"tag":620,"props":7140,"children":7141},{"style":853},[7142],{"type":418,"value":2096},{"type":412,"tag":620,"props":7144,"children":7145},{"style":847},[7146],{"type":418,"value":1090},{"type":412,"tag":620,"props":7148,"children":7149},{"style":853},[7150],{"type":418,"value":6829},{"type":412,"tag":620,"props":7152,"children":7153},{"style":847},[7154],{"type":418,"value":7155},"!.",{"type":412,"tag":620,"props":7157,"children":7158},{"style":853},[7159],{"type":418,"value":7160},"approved",{"type":412,"tag":620,"props":7162,"children":7163},{"style":847},[7164],{"type":418,"value":4431},{"type":412,"tag":620,"props":7166,"children":7167},{"style":847},[7168],{"type":418,"value":871},{"type":412,"tag":620,"props":7170,"children":7171},{"style":633},[7172],{"type":418,"value":7160},{"type":412,"tag":620,"props":7174,"children":7175},{"style":847},[7176],{"type":418,"value":881},{"type":412,"tag":620,"props":7178,"children":7179},{"style":847},[7180],{"type":418,"value":4440},{"type":412,"tag":620,"props":7182,"children":7183},{"style":847},[7184],{"type":418,"value":871},{"type":412,"tag":620,"props":7186,"children":7187},{"style":633},[7188],{"type":418,"value":7189},"rejected",{"type":412,"tag":620,"props":7191,"children":7192},{"style":847},[7193],{"type":418,"value":881},{"type":412,"tag":620,"props":7195,"children":7196},{"style":847},[7197],{"type":418,"value":2109},{"type":412,"tag":620,"props":7199,"children":7200},{"class":622,"line":2809},[7201],{"type":412,"tag":620,"props":7202,"children":7203},{"style":847},[7204],{"type":418,"value":2348},{"type":412,"tag":620,"props":7206,"children":7207},{"class":622,"line":2817},[7208],{"type":412,"tag":620,"props":7209,"children":7210},{"emptyLinePlaceholder":892},[7211],{"type":418,"value":895},{"type":412,"tag":620,"props":7213,"children":7214},{"class":622,"line":2873},[7215,7219,7223,7227,7231,7235,7239,7243,7247,7251,7255,7259,7263,7267,7271,7275,7279],{"type":412,"tag":620,"props":7216,"children":7217},{"style":901},[7218],{"type":418,"value":2365},{"type":412,"tag":620,"props":7220,"children":7221},{"style":901},[7222],{"type":418,"value":2135},{"type":412,"tag":620,"props":7224,"children":7225},{"style":673},[7226],{"type":418,"value":6713},{"type":412,"tag":620,"props":7228,"children":7229},{"style":847},[7230],{"type":418,"value":2145},{"type":412,"tag":620,"props":7232,"children":7233},{"style":2148},[7234],{"type":418,"value":6731},{"type":412,"tag":620,"props":7236,"children":7237},{"style":847},[7238],{"type":418,"value":826},{"type":412,"tag":620,"props":7240,"children":7241},{"style":627},[7242],{"type":418,"value":1996},{"type":412,"tag":620,"props":7244,"children":7245},{"style":847},[7246],{"type":418,"value":1142},{"type":412,"tag":620,"props":7248,"children":7249},{"style":2148},[7250],{"type":418,"value":6740},{"type":412,"tag":620,"props":7252,"children":7253},{"style":847},[7254],{"type":418,"value":826},{"type":412,"tag":620,"props":7256,"children":7257},{"style":627},[7258],{"type":418,"value":1996},{"type":412,"tag":620,"props":7260,"children":7261},{"style":847},[7262],{"type":418,"value":1114},{"type":412,"tag":620,"props":7264,"children":7265},{"style":627},[7266],{"type":418,"value":2168},{"type":412,"tag":620,"props":7268,"children":7269},{"style":847},[7270],{"type":418,"value":2402},{"type":412,"tag":620,"props":7272,"children":7273},{"style":627},[7274],{"type":418,"value":5832},{"type":412,"tag":620,"props":7276,"children":7277},{"style":847},[7278],{"type":418,"value":2412},{"type":412,"tag":620,"props":7280,"children":7281},{"style":847},[7282],{"type":418,"value":2195},{"type":412,"tag":620,"props":7284,"children":7285},{"class":622,"line":2893},[7286,7290,7294,7298],{"type":412,"tag":620,"props":7287,"children":7288},{"style":847},[7289],{"type":418,"value":2203},{"type":412,"tag":620,"props":7291,"children":7292},{"style":633},[7293],{"type":418,"value":90},{"type":412,"tag":620,"props":7295,"children":7296},{"style":847},[7297],{"type":418,"value":881},{"type":412,"tag":620,"props":7299,"children":7300},{"style":847},[7301],{"type":418,"value":886},{"type":412,"tag":620,"props":7303,"children":7304},{"class":622,"line":2945},[7305,7309,7313,7317,7321,7325,7329,7333,7337,7341,7345,7349,7353,7357,7361,7365,7369,7373,7377,7381,7385,7389],{"type":412,"tag":620,"props":7306,"children":7307},{"style":901},[7308],{"type":418,"value":2232},{"type":412,"tag":620,"props":7310,"children":7311},{"style":853},[7312],{"type":418,"value":2449},{"type":412,"tag":620,"props":7314,"children":7315},{"style":847},[7316],{"type":418,"value":2242},{"type":412,"tag":620,"props":7318,"children":7319},{"style":673},[7320],{"type":418,"value":1137},{"type":412,"tag":620,"props":7322,"children":7323},{"style":847},[7324],{"type":418,"value":2173},{"type":412,"tag":620,"props":7326,"children":7327},{"style":1958},[7328],{"type":418,"value":1933},{"type":412,"tag":620,"props":7330,"children":7331},{"style":847},[7332],{"type":418,"value":826},{"type":412,"tag":620,"props":7334,"children":7335},{"style":627},[7336],{"type":418,"value":1996},{"type":412,"tag":620,"props":7338,"children":7339},{"style":847},[7340],{"type":418,"value":1982},{"type":412,"tag":620,"props":7342,"children":7343},{"style":1958},[7344],{"type":418,"value":6647},{"type":412,"tag":620,"props":7346,"children":7347},{"style":847},[7348],{"type":418,"value":826},{"type":412,"tag":620,"props":7350,"children":7351},{"style":627},[7352],{"type":418,"value":1996},{"type":412,"tag":620,"props":7354,"children":7355},{"style":847},[7356],{"type":418,"value":1982},{"type":412,"tag":620,"props":7358,"children":7359},{"style":1958},[7360],{"type":418,"value":6740},{"type":412,"tag":620,"props":7362,"children":7363},{"style":847},[7364],{"type":418,"value":826},{"type":412,"tag":620,"props":7366,"children":7367},{"style":627},[7368],{"type":418,"value":1996},{"type":412,"tag":620,"props":7370,"children":7371},{"style":847},[7372],{"type":418,"value":2190},{"type":412,"tag":620,"props":7374,"children":7375},{"style":1958},[7376],{"type":418,"value":2475},{"type":412,"tag":620,"props":7378,"children":7379},{"style":847},[7380],{"type":418,"value":1090},{"type":412,"tag":620,"props":7382,"children":7383},{"style":673},[7384],{"type":418,"value":2484},{"type":412,"tag":620,"props":7386,"children":7387},{"style":1958},[7388],{"type":418,"value":2475},{"type":412,"tag":620,"props":7390,"children":7391},{"style":847},[7392],{"type":418,"value":886},{"type":412,"tag":620,"props":7394,"children":7395},{"class":622,"line":2957},[7396,7400],{"type":412,"tag":620,"props":7397,"children":7398},{"style":841},[7399],{"type":418,"value":2501},{"type":412,"tag":620,"props":7401,"children":7402},{"style":847},[7403],{"type":418,"value":2195},{"type":412,"tag":620,"props":7405,"children":7406},{"class":622,"line":3042},[7407,7411,7415,7419,7423,7427,7431,7435,7439,7443,7448,7452,7456,7460,7464,7468,7472,7476],{"type":412,"tag":620,"props":7408,"children":7409},{"style":841},[7410],{"type":418,"value":2514},{"type":412,"tag":620,"props":7412,"children":7413},{"style":853},[7414],{"type":418,"value":2449},{"type":412,"tag":620,"props":7416,"children":7417},{"style":847},[7418],{"type":418,"value":1090},{"type":412,"tag":620,"props":7420,"children":7421},{"style":673},[7422],{"type":418,"value":2527},{"type":412,"tag":620,"props":7424,"children":7425},{"style":1958},[7426],{"type":418,"value":2145},{"type":412,"tag":620,"props":7428,"children":7429},{"style":847},[7430],{"type":418,"value":2536},{"type":412,"tag":620,"props":7432,"children":7433},{"style":1958},[7434],{"type":418,"value":1933},{"type":412,"tag":620,"props":7436,"children":7437},{"style":847},[7438],{"type":418,"value":826},{"type":412,"tag":620,"props":7440,"children":7441},{"style":847},[7442],{"type":418,"value":871},{"type":412,"tag":620,"props":7444,"children":7445},{"style":633},[7446],{"type":418,"value":7447},"awaiting_approval",{"type":412,"tag":620,"props":7449,"children":7450},{"style":847},[7451],{"type":418,"value":881},{"type":412,"tag":620,"props":7453,"children":7454},{"style":847},[7455],{"type":418,"value":1142},{"type":412,"tag":620,"props":7457,"children":7458},{"style":853},[7459],{"type":418,"value":6647},{"type":412,"tag":620,"props":7461,"children":7462},{"style":847},[7463],{"type":418,"value":1142},{"type":412,"tag":620,"props":7465,"children":7466},{"style":853},[7467],{"type":418,"value":6740},{"type":412,"tag":620,"props":7469,"children":7470},{"style":847},[7471],{"type":418,"value":861},{"type":412,"tag":620,"props":7473,"children":7474},{"style":1958},[7475],{"type":418,"value":1868},{"type":412,"tag":620,"props":7477,"children":7478},{"style":847},[7479],{"type":418,"value":886},{"type":412,"tag":620,"props":7481,"children":7482},{"class":622,"line":3083},[7483,7487,7491],{"type":412,"tag":620,"props":7484,"children":7485},{"style":847},[7486],{"type":418,"value":2754},{"type":412,"tag":620,"props":7488,"children":7489},{"style":841},[7490],{"type":418,"value":2759},{"type":412,"tag":620,"props":7492,"children":7493},{"style":847},[7494],{"type":418,"value":2195},{"type":412,"tag":620,"props":7496,"children":7497},{"class":622,"line":3167},[7498,7502,7506,7510,7514],{"type":412,"tag":620,"props":7499,"children":7500},{"style":853},[7501],{"type":418,"value":2772},{"type":412,"tag":620,"props":7503,"children":7504},{"style":847},[7505],{"type":418,"value":1090},{"type":412,"tag":620,"props":7507,"children":7508},{"style":673},[7509],{"type":418,"value":2781},{"type":412,"tag":620,"props":7511,"children":7512},{"style":1958},[7513],{"type":418,"value":2475},{"type":412,"tag":620,"props":7515,"children":7516},{"style":847},[7517],{"type":418,"value":886},{"type":412,"tag":620,"props":7519,"children":7520},{"class":622,"line":3183},[7521],{"type":412,"tag":620,"props":7522,"children":7523},{"style":847},[7524],{"type":418,"value":2798},{"type":412,"tag":620,"props":7526,"children":7527},{"class":622,"line":3199},[7528],{"type":412,"tag":620,"props":7529,"children":7530},{"style":847},[7531],{"type":418,"value":2348},{"type":412,"tag":425,"props":7533,"children":7534},{},[7535,7540,7542,7547,7549,7555,7557,7563],{"type":412,"tag":429,"props":7536,"children":7537},{},[7538],{"type":418,"value":7539},"Common mistake",{"type":418,"value":7541},": Calling ",{"type":412,"tag":460,"props":7543,"children":7545},{"className":7544},[],[7546],{"type":418,"value":481},{"type":418,"value":7548}," directly or forgetting ",{"type":412,"tag":460,"props":7550,"children":7552},{"className":7551},[],[7553],{"type":418,"value":7554},".create()",{"type":418,"value":7556},". Always: ",{"type":412,"tag":460,"props":7558,"children":7560},{"className":7559},[],[7561],{"type":418,"value":7562},"const hook = myHook.create({ token })",{"type":418,"value":1090},{"type":412,"tag":800,"props":7565,"children":7567},{"id":7566},"_2-resume-route-api-file-required",[7568],{"type":418,"value":7569},"2. Resume route (API file — required!)",{"type":412,"tag":609,"props":7571,"children":7573},{"className":829,"code":7572,"language":831,"meta":614,"style":614},"\u002F\u002F app\u002Fapi\u002Fapprove\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { resumeHook } from \"workflow\u002Fapi\";\n\nexport async function POST(req: Request) {\n  const { token, ...data } = await req.json();\n  await resumeHook(token, data);\n  return NextResponse.json({ ok: true });\n}\n",[7574],{"type":412,"tag":460,"props":7575,"children":7576},{"__ignoreMap":614},[7577,7585,7624,7663,7670,7714,7775,7810,7862],{"type":412,"tag":620,"props":7578,"children":7579},{"class":622,"line":623},[7580],{"type":412,"tag":620,"props":7581,"children":7582},{"style":1005},[7583],{"type":418,"value":7584},"\u002F\u002F app\u002Fapi\u002Fapprove\u002Froute.ts\n",{"type":412,"tag":620,"props":7586,"children":7587},{"class":622,"line":669},[7588,7592,7596,7600,7604,7608,7612,7616,7620],{"type":412,"tag":620,"props":7589,"children":7590},{"style":841},[7591],{"type":418,"value":844},{"type":412,"tag":620,"props":7593,"children":7594},{"style":847},[7595],{"type":418,"value":850},{"type":412,"tag":620,"props":7597,"children":7598},{"style":853},[7599],{"type":418,"value":3272},{"type":412,"tag":620,"props":7601,"children":7602},{"style":847},[7603],{"type":418,"value":861},{"type":412,"tag":620,"props":7605,"children":7606},{"style":841},[7607],{"type":418,"value":866},{"type":412,"tag":620,"props":7609,"children":7610},{"style":847},[7611],{"type":418,"value":871},{"type":412,"tag":620,"props":7613,"children":7614},{"style":633},[7615],{"type":418,"value":3289},{"type":412,"tag":620,"props":7617,"children":7618},{"style":847},[7619],{"type":418,"value":881},{"type":412,"tag":620,"props":7621,"children":7622},{"style":847},[7623],{"type":418,"value":886},{"type":412,"tag":620,"props":7625,"children":7626},{"class":622,"line":684},[7627,7631,7635,7639,7643,7647,7651,7655,7659],{"type":412,"tag":620,"props":7628,"children":7629},{"style":841},[7630],{"type":418,"value":844},{"type":412,"tag":620,"props":7632,"children":7633},{"style":847},[7634],{"type":418,"value":850},{"type":412,"tag":620,"props":7636,"children":7637},{"style":853},[7638],{"type":418,"value":1362},{"type":412,"tag":620,"props":7640,"children":7641},{"style":847},[7642],{"type":418,"value":861},{"type":412,"tag":620,"props":7644,"children":7645},{"style":841},[7646],{"type":418,"value":866},{"type":412,"tag":620,"props":7648,"children":7649},{"style":847},[7650],{"type":418,"value":871},{"type":412,"tag":620,"props":7652,"children":7653},{"style":633},[7654],{"type":418,"value":1388},{"type":412,"tag":620,"props":7656,"children":7657},{"style":847},[7658],{"type":418,"value":881},{"type":412,"tag":620,"props":7660,"children":7661},{"style":847},[7662],{"type":418,"value":886},{"type":412,"tag":620,"props":7664,"children":7665},{"class":622,"line":407},[7666],{"type":412,"tag":620,"props":7667,"children":7668},{"emptyLinePlaceholder":892},[7669],{"type":418,"value":895},{"type":412,"tag":620,"props":7671,"children":7672},{"class":622,"line":2004},[7673,7677,7681,7685,7689,7693,7698,7702,7706,7710],{"type":412,"tag":620,"props":7674,"children":7675},{"style":841},[7676],{"type":418,"value":927},{"type":412,"tag":620,"props":7678,"children":7679},{"style":901},[7680],{"type":418,"value":2130},{"type":412,"tag":620,"props":7682,"children":7683},{"style":901},[7684],{"type":418,"value":2135},{"type":412,"tag":620,"props":7686,"children":7687},{"style":673},[7688],{"type":418,"value":3402},{"type":412,"tag":620,"props":7690,"children":7691},{"style":847},[7692],{"type":418,"value":2145},{"type":412,"tag":620,"props":7694,"children":7695},{"style":2148},[7696],{"type":418,"value":7697},"req",{"type":412,"tag":620,"props":7699,"children":7700},{"style":847},[7701],{"type":418,"value":826},{"type":412,"tag":620,"props":7703,"children":7704},{"style":627},[7705],{"type":418,"value":3420},{"type":412,"tag":620,"props":7707,"children":7708},{"style":847},[7709],{"type":418,"value":1868},{"type":412,"tag":620,"props":7711,"children":7712},{"style":847},[7713],{"type":418,"value":2195},{"type":412,"tag":620,"props":7715,"children":7716},{"class":622,"line":2057},[7717,7721,7725,7729,7733,7738,7742,7746,7750,7754,7759,7763,7767,7771],{"type":412,"tag":620,"props":7718,"children":7719},{"style":901},[7720],{"type":418,"value":2232},{"type":412,"tag":620,"props":7722,"children":7723},{"style":847},[7724],{"type":418,"value":850},{"type":412,"tag":620,"props":7726,"children":7727},{"style":853},[7728],{"type":418,"value":6647},{"type":412,"tag":620,"props":7730,"children":7731},{"style":847},[7732],{"type":418,"value":1142},{"type":412,"tag":620,"props":7734,"children":7735},{"style":847},[7736],{"type":418,"value":7737}," ...",{"type":412,"tag":620,"props":7739,"children":7740},{"style":853},[7741],{"type":418,"value":2302},{"type":412,"tag":620,"props":7743,"children":7744},{"style":847},[7745],{"type":418,"value":861},{"type":412,"tag":620,"props":7747,"children":7748},{"style":847},[7749],{"type":418,"value":2242},{"type":412,"tag":620,"props":7751,"children":7752},{"style":841},[7753],{"type":418,"value":2247},{"type":412,"tag":620,"props":7755,"children":7756},{"style":853},[7757],{"type":418,"value":7758}," req",{"type":412,"tag":620,"props":7760,"children":7761},{"style":847},[7762],{"type":418,"value":1090},{"type":412,"tag":620,"props":7764,"children":7765},{"style":673},[7766],{"type":418,"value":3462},{"type":412,"tag":620,"props":7768,"children":7769},{"style":1958},[7770],{"type":418,"value":2475},{"type":412,"tag":620,"props":7772,"children":7773},{"style":847},[7774],{"type":418,"value":886},{"type":412,"tag":620,"props":7776,"children":7777},{"class":622,"line":2112},[7778,7782,7786,7790,7794,7798,7802,7806],{"type":412,"tag":620,"props":7779,"children":7780},{"style":841},[7781],{"type":418,"value":6708},{"type":412,"tag":620,"props":7783,"children":7784},{"style":673},[7785],{"type":418,"value":1362},{"type":412,"tag":620,"props":7787,"children":7788},{"style":1958},[7789],{"type":418,"value":2145},{"type":412,"tag":620,"props":7791,"children":7792},{"style":853},[7793],{"type":418,"value":6731},{"type":412,"tag":620,"props":7795,"children":7796},{"style":847},[7797],{"type":418,"value":1142},{"type":412,"tag":620,"props":7799,"children":7800},{"style":853},[7801],{"type":418,"value":2237},{"type":412,"tag":620,"props":7803,"children":7804},{"style":1958},[7805],{"type":418,"value":1868},{"type":412,"tag":620,"props":7807,"children":7808},{"style":847},[7809],{"type":418,"value":886},{"type":412,"tag":620,"props":7811,"children":7812},{"class":622,"line":2120},[7813,7817,7821,7825,7829,7833,7837,7841,7845,7850,7854,7858],{"type":412,"tag":620,"props":7814,"children":7815},{"style":841},[7816],{"type":418,"value":2327},{"type":412,"tag":620,"props":7818,"children":7819},{"style":853},[7820],{"type":418,"value":3272},{"type":412,"tag":620,"props":7822,"children":7823},{"style":847},[7824],{"type":418,"value":1090},{"type":412,"tag":620,"props":7826,"children":7827},{"style":673},[7828],{"type":418,"value":3462},{"type":412,"tag":620,"props":7830,"children":7831},{"style":1958},[7832],{"type":418,"value":2145},{"type":412,"tag":620,"props":7834,"children":7835},{"style":847},[7836],{"type":418,"value":2536},{"type":412,"tag":620,"props":7838,"children":7839},{"style":1958},[7840],{"type":418,"value":4038},{"type":412,"tag":620,"props":7842,"children":7843},{"style":847},[7844],{"type":418,"value":826},{"type":412,"tag":620,"props":7846,"children":7847},{"style":4045},[7848],{"type":418,"value":7849}," true",{"type":412,"tag":620,"props":7851,"children":7852},{"style":847},[7853],{"type":418,"value":861},{"type":412,"tag":620,"props":7855,"children":7856},{"style":1958},[7857],{"type":418,"value":1868},{"type":412,"tag":620,"props":7859,"children":7860},{"style":847},[7861],{"type":418,"value":886},{"type":412,"tag":620,"props":7863,"children":7864},{"class":622,"line":33},[7865],{"type":412,"tag":620,"props":7866,"children":7867},{"style":847},[7868],{"type":418,"value":2348},{"type":412,"tag":425,"props":7870,"children":7871},{},[7872,7877],{"type":412,"tag":429,"props":7873,"children":7874},{},[7875],{"type":418,"value":7876},"You MUST create this route.",{"type":418,"value":7878}," Without it, the workflow suspends forever — the client has no way to resume it.",{"type":412,"tag":800,"props":7880,"children":7882},{"id":7881},"_3-client-side-resume-react-component",[7883],{"type":418,"value":7884},"3. Client-side resume (React component)",{"type":412,"tag":609,"props":7886,"children":7888},{"className":6057,"code":7887,"language":6059,"meta":614,"style":614},"\u002F\u002F When the SSE stream emits { type: \"awaiting_approval\", token }, show UI and POST back:\nasync function handleApprove(token: string) {\n  await fetch(\"\u002Fapi\u002Fapprove\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n    body: JSON.stringify({ token, approved: true, comment: \"Looks good\" }),\n  });\n}\n",[7889],{"type":412,"tag":460,"props":7890,"children":7891},{"__ignoreMap":614},[7892,7900,7940,7976,8005,8053,8144,8159],{"type":412,"tag":620,"props":7893,"children":7894},{"class":622,"line":623},[7895],{"type":412,"tag":620,"props":7896,"children":7897},{"style":1005},[7898],{"type":418,"value":7899},"\u002F\u002F When the SSE stream emits { type: \"awaiting_approval\", token }, show UI and POST back:\n",{"type":412,"tag":620,"props":7901,"children":7902},{"class":622,"line":669},[7903,7907,7911,7916,7920,7924,7928,7932,7936],{"type":412,"tag":620,"props":7904,"children":7905},{"style":901},[7906],{"type":418,"value":2365},{"type":412,"tag":620,"props":7908,"children":7909},{"style":901},[7910],{"type":418,"value":2135},{"type":412,"tag":620,"props":7912,"children":7913},{"style":673},[7914],{"type":418,"value":7915}," handleApprove",{"type":412,"tag":620,"props":7917,"children":7918},{"style":847},[7919],{"type":418,"value":2145},{"type":412,"tag":620,"props":7921,"children":7922},{"style":2148},[7923],{"type":418,"value":6731},{"type":412,"tag":620,"props":7925,"children":7926},{"style":847},[7927],{"type":418,"value":826},{"type":412,"tag":620,"props":7929,"children":7930},{"style":627},[7931],{"type":418,"value":1996},{"type":412,"tag":620,"props":7933,"children":7934},{"style":847},[7935],{"type":418,"value":1868},{"type":412,"tag":620,"props":7937,"children":7938},{"style":847},[7939],{"type":418,"value":2195},{"type":412,"tag":620,"props":7941,"children":7942},{"class":622,"line":684},[7943,7947,7951,7955,7959,7964,7968,7972],{"type":412,"tag":620,"props":7944,"children":7945},{"style":841},[7946],{"type":418,"value":6708},{"type":412,"tag":620,"props":7948,"children":7949},{"style":673},[7950],{"type":418,"value":1205},{"type":412,"tag":620,"props":7952,"children":7953},{"style":1958},[7954],{"type":418,"value":2145},{"type":412,"tag":620,"props":7956,"children":7957},{"style":847},[7958],{"type":418,"value":881},{"type":412,"tag":620,"props":7960,"children":7961},{"style":633},[7962],{"type":418,"value":7963},"\u002Fapi\u002Fapprove",{"type":412,"tag":620,"props":7965,"children":7966},{"style":847},[7967],{"type":418,"value":881},{"type":412,"tag":620,"props":7969,"children":7970},{"style":847},[7971],{"type":418,"value":1142},{"type":412,"tag":620,"props":7973,"children":7974},{"style":847},[7975],{"type":418,"value":2195},{"type":412,"tag":620,"props":7977,"children":7978},{"class":622,"line":407},[7979,7984,7988,7992,7997,8001],{"type":412,"tag":620,"props":7980,"children":7981},{"style":1958},[7982],{"type":418,"value":7983},"    method",{"type":412,"tag":620,"props":7985,"children":7986},{"style":847},[7987],{"type":418,"value":826},{"type":412,"tag":620,"props":7989,"children":7990},{"style":847},[7991],{"type":418,"value":871},{"type":412,"tag":620,"props":7993,"children":7994},{"style":633},[7995],{"type":418,"value":7996},"POST",{"type":412,"tag":620,"props":7998,"children":7999},{"style":847},[8000],{"type":418,"value":881},{"type":412,"tag":620,"props":8002,"children":8003},{"style":847},[8004],{"type":418,"value":4675},{"type":412,"tag":620,"props":8006,"children":8007},{"class":622,"line":2004},[8008,8012,8016,8020,8024,8028,8032,8036,8040,8045,8049],{"type":412,"tag":620,"props":8009,"children":8010},{"style":1958},[8011],{"type":418,"value":4628},{"type":412,"tag":620,"props":8013,"children":8014},{"style":847},[8015],{"type":418,"value":826},{"type":412,"tag":620,"props":8017,"children":8018},{"style":847},[8019],{"type":418,"value":850},{"type":412,"tag":620,"props":8021,"children":8022},{"style":847},[8023],{"type":418,"value":871},{"type":412,"tag":620,"props":8025,"children":8026},{"style":1958},[8027],{"type":418,"value":4649},{"type":412,"tag":620,"props":8029,"children":8030},{"style":847},[8031],{"type":418,"value":881},{"type":412,"tag":620,"props":8033,"children":8034},{"style":847},[8035],{"type":418,"value":826},{"type":412,"tag":620,"props":8037,"children":8038},{"style":847},[8039],{"type":418,"value":871},{"type":412,"tag":620,"props":8041,"children":8042},{"style":633},[8043],{"type":418,"value":8044},"application\u002Fjson",{"type":412,"tag":620,"props":8046,"children":8047},{"style":847},[8048],{"type":418,"value":881},{"type":412,"tag":620,"props":8050,"children":8051},{"style":847},[8052],{"type":418,"value":4142},{"type":412,"tag":620,"props":8054,"children":8055},{"class":622,"line":2057},[8056,8061,8065,8069,8073,8077,8081,8085,8089,8093,8098,8102,8106,8110,8115,8119,8123,8128,8132,8136,8140],{"type":412,"tag":620,"props":8057,"children":8058},{"style":1958},[8059],{"type":418,"value":8060},"    body",{"type":412,"tag":620,"props":8062,"children":8063},{"style":847},[8064],{"type":418,"value":826},{"type":412,"tag":620,"props":8066,"children":8067},{"style":853},[8068],{"type":418,"value":4445},{"type":412,"tag":620,"props":8070,"children":8071},{"style":847},[8072],{"type":418,"value":1090},{"type":412,"tag":620,"props":8074,"children":8075},{"style":673},[8076],{"type":418,"value":4454},{"type":412,"tag":620,"props":8078,"children":8079},{"style":1958},[8080],{"type":418,"value":2145},{"type":412,"tag":620,"props":8082,"children":8083},{"style":847},[8084],{"type":418,"value":2536},{"type":412,"tag":620,"props":8086,"children":8087},{"style":853},[8088],{"type":418,"value":6647},{"type":412,"tag":620,"props":8090,"children":8091},{"style":847},[8092],{"type":418,"value":1142},{"type":412,"tag":620,"props":8094,"children":8095},{"style":1958},[8096],{"type":418,"value":8097}," approved",{"type":412,"tag":620,"props":8099,"children":8100},{"style":847},[8101],{"type":418,"value":826},{"type":412,"tag":620,"props":8103,"children":8104},{"style":4045},[8105],{"type":418,"value":7849},{"type":412,"tag":620,"props":8107,"children":8108},{"style":847},[8109],{"type":418,"value":1142},{"type":412,"tag":620,"props":8111,"children":8112},{"style":1958},[8113],{"type":418,"value":8114}," comment",{"type":412,"tag":620,"props":8116,"children":8117},{"style":847},[8118],{"type":418,"value":826},{"type":412,"tag":620,"props":8120,"children":8121},{"style":847},[8122],{"type":418,"value":871},{"type":412,"tag":620,"props":8124,"children":8125},{"style":633},[8126],{"type":418,"value":8127},"Looks good",{"type":412,"tag":620,"props":8129,"children":8130},{"style":847},[8131],{"type":418,"value":881},{"type":412,"tag":620,"props":8133,"children":8134},{"style":847},[8135],{"type":418,"value":861},{"type":412,"tag":620,"props":8137,"children":8138},{"style":1958},[8139],{"type":418,"value":1868},{"type":412,"tag":620,"props":8141,"children":8142},{"style":847},[8143],{"type":418,"value":4675},{"type":412,"tag":620,"props":8145,"children":8146},{"class":622,"line":2112},[8147,8151,8155],{"type":412,"tag":620,"props":8148,"children":8149},{"style":847},[8150],{"type":418,"value":2754},{"type":412,"tag":620,"props":8152,"children":8153},{"style":1958},[8154],{"type":418,"value":1868},{"type":412,"tag":620,"props":8156,"children":8157},{"style":847},[8158],{"type":418,"value":886},{"type":412,"tag":620,"props":8160,"children":8161},{"class":622,"line":2120},[8162],{"type":412,"tag":620,"props":8163,"children":8164},{"style":847},[8165],{"type":418,"value":2348},{"type":412,"tag":513,"props":8167,"children":8169},{"id":8168},"error-handling",[8170],{"type":418,"value":8171},"Error Handling",{"type":412,"tag":609,"props":8173,"children":8175},{"className":829,"code":8174,"language":831,"meta":614,"style":614},"import { FatalError, RetryableError } from \"workflow\";\n\nasync function callExternalAPI(url: string) {\n  \"use step\";\n  const res = await fetch(url);\n\n  if (res.status >= 400 && res.status \u003C 500) {\n    throw new FatalError(`Client error: ${res.status}`);  \u002F\u002F No retry\n  }\n  if (res.status === 429) {\n    throw new RetryableError(\"Rate limited\", { retryAfter: \"5m\" });  \u002F\u002F Retry after 5 min\n  }\n  return res.json();\n}\n",[8176],{"type":412,"tag":460,"props":8177,"children":8178},{"__ignoreMap":614},[8179,8226,8233,8274,8293,8333,8340,8407,8469,8476,8516,8595,8602,8629],{"type":412,"tag":620,"props":8180,"children":8181},{"class":622,"line":623},[8182,8186,8190,8194,8198,8202,8206,8210,8214,8218,8222],{"type":412,"tag":620,"props":8183,"children":8184},{"style":841},[8185],{"type":418,"value":844},{"type":412,"tag":620,"props":8187,"children":8188},{"style":847},[8189],{"type":418,"value":850},{"type":412,"tag":620,"props":8191,"children":8192},{"style":853},[8193],{"type":418,"value":1272},{"type":412,"tag":620,"props":8195,"children":8196},{"style":847},[8197],{"type":418,"value":1142},{"type":412,"tag":620,"props":8199,"children":8200},{"style":853},[8201],{"type":418,"value":1281},{"type":412,"tag":620,"props":8203,"children":8204},{"style":847},[8205],{"type":418,"value":861},{"type":412,"tag":620,"props":8207,"children":8208},{"style":841},[8209],{"type":418,"value":866},{"type":412,"tag":620,"props":8211,"children":8212},{"style":847},[8213],{"type":418,"value":871},{"type":412,"tag":620,"props":8215,"children":8216},{"style":633},[8217],{"type":418,"value":4},{"type":412,"tag":620,"props":8219,"children":8220},{"style":847},[8221],{"type":418,"value":881},{"type":412,"tag":620,"props":8223,"children":8224},{"style":847},[8225],{"type":418,"value":886},{"type":412,"tag":620,"props":8227,"children":8228},{"class":622,"line":669},[8229],{"type":412,"tag":620,"props":8230,"children":8231},{"emptyLinePlaceholder":892},[8232],{"type":418,"value":895},{"type":412,"tag":620,"props":8234,"children":8235},{"class":622,"line":684},[8236,8240,8244,8249,8253,8258,8262,8266,8270],{"type":412,"tag":620,"props":8237,"children":8238},{"style":901},[8239],{"type":418,"value":2365},{"type":412,"tag":620,"props":8241,"children":8242},{"style":901},[8243],{"type":418,"value":2135},{"type":412,"tag":620,"props":8245,"children":8246},{"style":673},[8247],{"type":418,"value":8248}," callExternalAPI",{"type":412,"tag":620,"props":8250,"children":8251},{"style":847},[8252],{"type":418,"value":2145},{"type":412,"tag":620,"props":8254,"children":8255},{"style":2148},[8256],{"type":418,"value":8257},"url",{"type":412,"tag":620,"props":8259,"children":8260},{"style":847},[8261],{"type":418,"value":826},{"type":412,"tag":620,"props":8263,"children":8264},{"style":627},[8265],{"type":418,"value":1996},{"type":412,"tag":620,"props":8267,"children":8268},{"style":847},[8269],{"type":418,"value":1868},{"type":412,"tag":620,"props":8271,"children":8272},{"style":847},[8273],{"type":418,"value":2195},{"type":412,"tag":620,"props":8275,"children":8276},{"class":622,"line":407},[8277,8281,8285,8289],{"type":412,"tag":620,"props":8278,"children":8279},{"style":847},[8280],{"type":418,"value":2203},{"type":412,"tag":620,"props":8282,"children":8283},{"style":633},[8284],{"type":418,"value":90},{"type":412,"tag":620,"props":8286,"children":8287},{"style":847},[8288],{"type":418,"value":881},{"type":412,"tag":620,"props":8290,"children":8291},{"style":847},[8292],{"type":418,"value":886},{"type":412,"tag":620,"props":8294,"children":8295},{"class":622,"line":2004},[8296,8300,8305,8309,8313,8317,8321,8325,8329],{"type":412,"tag":620,"props":8297,"children":8298},{"style":901},[8299],{"type":418,"value":2232},{"type":412,"tag":620,"props":8301,"children":8302},{"style":853},[8303],{"type":418,"value":8304}," res",{"type":412,"tag":620,"props":8306,"children":8307},{"style":847},[8308],{"type":418,"value":2242},{"type":412,"tag":620,"props":8310,"children":8311},{"style":841},[8312],{"type":418,"value":2247},{"type":412,"tag":620,"props":8314,"children":8315},{"style":673},[8316],{"type":418,"value":1205},{"type":412,"tag":620,"props":8318,"children":8319},{"style":1958},[8320],{"type":418,"value":2145},{"type":412,"tag":620,"props":8322,"children":8323},{"style":853},[8324],{"type":418,"value":8257},{"type":412,"tag":620,"props":8326,"children":8327},{"style":1958},[8328],{"type":418,"value":1868},{"type":412,"tag":620,"props":8330,"children":8331},{"style":847},[8332],{"type":418,"value":886},{"type":412,"tag":620,"props":8334,"children":8335},{"class":622,"line":2057},[8336],{"type":412,"tag":620,"props":8337,"children":8338},{"emptyLinePlaceholder":892},[8339],{"type":418,"value":895},{"type":412,"tag":620,"props":8341,"children":8342},{"class":622,"line":2112},[8343,8347,8351,8356,8360,8364,8369,8374,8378,8382,8386,8390,8394,8399,8403],{"type":412,"tag":620,"props":8344,"children":8345},{"style":841},[8346],{"type":418,"value":7035},{"type":412,"tag":620,"props":8348,"children":8349},{"style":1958},[8350],{"type":418,"value":4286},{"type":412,"tag":620,"props":8352,"children":8353},{"style":853},[8354],{"type":418,"value":8355},"res",{"type":412,"tag":620,"props":8357,"children":8358},{"style":847},[8359],{"type":418,"value":1090},{"type":412,"tag":620,"props":8361,"children":8362},{"style":853},[8363],{"type":418,"value":378},{"type":412,"tag":620,"props":8365,"children":8366},{"style":847},[8367],{"type":418,"value":8368}," >=",{"type":412,"tag":620,"props":8370,"children":8371},{"style":4161},[8372],{"type":418,"value":8373}," 400",{"type":412,"tag":620,"props":8375,"children":8376},{"style":847},[8377],{"type":418,"value":6195},{"type":412,"tag":620,"props":8379,"children":8380},{"style":853},[8381],{"type":418,"value":8304},{"type":412,"tag":620,"props":8383,"children":8384},{"style":847},[8385],{"type":418,"value":1090},{"type":412,"tag":620,"props":8387,"children":8388},{"style":853},[8389],{"type":418,"value":378},{"type":412,"tag":620,"props":8391,"children":8392},{"style":847},[8393],{"type":418,"value":6200},{"type":412,"tag":620,"props":8395,"children":8396},{"style":4161},[8397],{"type":418,"value":8398}," 500",{"type":412,"tag":620,"props":8400,"children":8401},{"style":1958},[8402],{"type":418,"value":7073},{"type":412,"tag":620,"props":8404,"children":8405},{"style":847},[8406],{"type":418,"value":4349},{"type":412,"tag":620,"props":8408,"children":8409},{"class":622,"line":2120},[8410,8415,8419,8423,8427,8431,8436,8440,8444,8448,8452,8456,8460,8464],{"type":412,"tag":620,"props":8411,"children":8412},{"style":841},[8413],{"type":418,"value":8414},"    throw",{"type":412,"tag":620,"props":8416,"children":8417},{"style":847},[8418],{"type":418,"value":4252},{"type":412,"tag":620,"props":8420,"children":8421},{"style":673},[8422],{"type":418,"value":1272},{"type":412,"tag":620,"props":8424,"children":8425},{"style":1958},[8426],{"type":418,"value":2145},{"type":412,"tag":620,"props":8428,"children":8429},{"style":847},[8430],{"type":418,"value":4133},{"type":412,"tag":620,"props":8432,"children":8433},{"style":633},[8434],{"type":418,"value":8435},"Client error: ",{"type":412,"tag":620,"props":8437,"children":8438},{"style":847},[8439],{"type":418,"value":4114},{"type":412,"tag":620,"props":8441,"children":8442},{"style":853},[8443],{"type":418,"value":8355},{"type":412,"tag":620,"props":8445,"children":8446},{"style":847},[8447],{"type":418,"value":1090},{"type":412,"tag":620,"props":8449,"children":8450},{"style":853},[8451],{"type":418,"value":378},{"type":412,"tag":620,"props":8453,"children":8454},{"style":847},[8455],{"type":418,"value":6673},{"type":412,"tag":620,"props":8457,"children":8458},{"style":1958},[8459],{"type":418,"value":1868},{"type":412,"tag":620,"props":8461,"children":8462},{"style":847},[8463],{"type":418,"value":1982},{"type":412,"tag":620,"props":8465,"children":8466},{"style":1005},[8467],{"type":418,"value":8468},"  \u002F\u002F No retry\n",{"type":412,"tag":620,"props":8470,"children":8471},{"class":622,"line":33},[8472],{"type":412,"tag":620,"props":8473,"children":8474},{"style":847},[8475],{"type":418,"value":2798},{"type":412,"tag":620,"props":8477,"children":8478},{"class":622,"line":2218},[8479,8483,8487,8491,8495,8499,8503,8508,8512],{"type":412,"tag":620,"props":8480,"children":8481},{"style":841},[8482],{"type":418,"value":7035},{"type":412,"tag":620,"props":8484,"children":8485},{"style":1958},[8486],{"type":418,"value":4286},{"type":412,"tag":620,"props":8488,"children":8489},{"style":853},[8490],{"type":418,"value":8355},{"type":412,"tag":620,"props":8492,"children":8493},{"style":847},[8494],{"type":418,"value":1090},{"type":412,"tag":620,"props":8496,"children":8497},{"style":853},[8498],{"type":418,"value":378},{"type":412,"tag":620,"props":8500,"children":8501},{"style":847},[8502],{"type":418,"value":4414},{"type":412,"tag":620,"props":8504,"children":8505},{"style":4161},[8506],{"type":418,"value":8507}," 429",{"type":412,"tag":620,"props":8509,"children":8510},{"style":1958},[8511],{"type":418,"value":7073},{"type":412,"tag":620,"props":8513,"children":8514},{"style":847},[8515],{"type":418,"value":4349},{"type":412,"tag":620,"props":8517,"children":8518},{"class":622,"line":2226},[8519,8523,8527,8531,8535,8539,8544,8548,8552,8556,8561,8565,8569,8574,8578,8582,8586,8590],{"type":412,"tag":620,"props":8520,"children":8521},{"style":841},[8522],{"type":418,"value":8414},{"type":412,"tag":620,"props":8524,"children":8525},{"style":847},[8526],{"type":418,"value":4252},{"type":412,"tag":620,"props":8528,"children":8529},{"style":673},[8530],{"type":418,"value":1281},{"type":412,"tag":620,"props":8532,"children":8533},{"style":1958},[8534],{"type":418,"value":2145},{"type":412,"tag":620,"props":8536,"children":8537},{"style":847},[8538],{"type":418,"value":881},{"type":412,"tag":620,"props":8540,"children":8541},{"style":633},[8542],{"type":418,"value":8543},"Rate limited",{"type":412,"tag":620,"props":8545,"children":8546},{"style":847},[8547],{"type":418,"value":881},{"type":412,"tag":620,"props":8549,"children":8550},{"style":847},[8551],{"type":418,"value":1142},{"type":412,"tag":620,"props":8553,"children":8554},{"style":847},[8555],{"type":418,"value":850},{"type":412,"tag":620,"props":8557,"children":8558},{"style":1958},[8559],{"type":418,"value":8560}," retryAfter",{"type":412,"tag":620,"props":8562,"children":8563},{"style":847},[8564],{"type":418,"value":826},{"type":412,"tag":620,"props":8566,"children":8567},{"style":847},[8568],{"type":418,"value":871},{"type":412,"tag":620,"props":8570,"children":8571},{"style":633},[8572],{"type":418,"value":8573},"5m",{"type":412,"tag":620,"props":8575,"children":8576},{"style":847},[8577],{"type":418,"value":881},{"type":412,"tag":620,"props":8579,"children":8580},{"style":847},[8581],{"type":418,"value":861},{"type":412,"tag":620,"props":8583,"children":8584},{"style":1958},[8585],{"type":418,"value":1868},{"type":412,"tag":620,"props":8587,"children":8588},{"style":847},[8589],{"type":418,"value":1982},{"type":412,"tag":620,"props":8591,"children":8592},{"style":1005},[8593],{"type":418,"value":8594},"  \u002F\u002F Retry after 5 min\n",{"type":412,"tag":620,"props":8596,"children":8597},{"class":622,"line":2271},[8598],{"type":412,"tag":620,"props":8599,"children":8600},{"style":847},[8601],{"type":418,"value":2798},{"type":412,"tag":620,"props":8603,"children":8604},{"class":622,"line":2313},[8605,8609,8613,8617,8621,8625],{"type":412,"tag":620,"props":8606,"children":8607},{"style":841},[8608],{"type":418,"value":2327},{"type":412,"tag":620,"props":8610,"children":8611},{"style":853},[8612],{"type":418,"value":8304},{"type":412,"tag":620,"props":8614,"children":8615},{"style":847},[8616],{"type":418,"value":1090},{"type":412,"tag":620,"props":8618,"children":8619},{"style":673},[8620],{"type":418,"value":3462},{"type":412,"tag":620,"props":8622,"children":8623},{"style":1958},[8624],{"type":418,"value":2475},{"type":412,"tag":620,"props":8626,"children":8627},{"style":847},[8628],{"type":418,"value":886},{"type":412,"tag":620,"props":8630,"children":8631},{"class":622,"line":2321},[8632],{"type":412,"tag":620,"props":8633,"children":8634},{"style":847},[8635],{"type":418,"value":2348},{"type":412,"tag":425,"props":8637,"children":8638},{},[8639],{"type":418,"value":8640},"Step retry metadata:",{"type":412,"tag":609,"props":8642,"children":8644},{"className":829,"code":8643,"language":831,"meta":614,"style":614},"import { getStepMetadata } from \"workflow\";\n\nasync function processWithRetry(id: string) {\n  \"use step\";\n  const { attempt } = getStepMetadata();\n  console.log(`Attempt ${attempt} for ${id}`);\n  \u002F\u002F ...\n}\n",[8645],{"type":412,"tag":460,"props":8646,"children":8647},{"__ignoreMap":614},[8648,8687,8694,8735,8754,8790,8858,8866],{"type":412,"tag":620,"props":8649,"children":8650},{"class":622,"line":623},[8651,8655,8659,8663,8667,8671,8675,8679,8683],{"type":412,"tag":620,"props":8652,"children":8653},{"style":841},[8654],{"type":418,"value":844},{"type":412,"tag":620,"props":8656,"children":8657},{"style":847},[8658],{"type":418,"value":850},{"type":412,"tag":620,"props":8660,"children":8661},{"style":853},[8662],{"type":418,"value":1147},{"type":412,"tag":620,"props":8664,"children":8665},{"style":847},[8666],{"type":418,"value":861},{"type":412,"tag":620,"props":8668,"children":8669},{"style":841},[8670],{"type":418,"value":866},{"type":412,"tag":620,"props":8672,"children":8673},{"style":847},[8674],{"type":418,"value":871},{"type":412,"tag":620,"props":8676,"children":8677},{"style":633},[8678],{"type":418,"value":4},{"type":412,"tag":620,"props":8680,"children":8681},{"style":847},[8682],{"type":418,"value":881},{"type":412,"tag":620,"props":8684,"children":8685},{"style":847},[8686],{"type":418,"value":886},{"type":412,"tag":620,"props":8688,"children":8689},{"class":622,"line":669},[8690],{"type":412,"tag":620,"props":8691,"children":8692},{"emptyLinePlaceholder":892},[8693],{"type":418,"value":895},{"type":412,"tag":620,"props":8695,"children":8696},{"class":622,"line":684},[8697,8701,8705,8710,8714,8719,8723,8727,8731],{"type":412,"tag":620,"props":8698,"children":8699},{"style":901},[8700],{"type":418,"value":2365},{"type":412,"tag":620,"props":8702,"children":8703},{"style":901},[8704],{"type":418,"value":2135},{"type":412,"tag":620,"props":8706,"children":8707},{"style":673},[8708],{"type":418,"value":8709}," processWithRetry",{"type":412,"tag":620,"props":8711,"children":8712},{"style":847},[8713],{"type":418,"value":2145},{"type":412,"tag":620,"props":8715,"children":8716},{"style":2148},[8717],{"type":418,"value":8718},"id",{"type":412,"tag":620,"props":8720,"children":8721},{"style":847},[8722],{"type":418,"value":826},{"type":412,"tag":620,"props":8724,"children":8725},{"style":627},[8726],{"type":418,"value":1996},{"type":412,"tag":620,"props":8728,"children":8729},{"style":847},[8730],{"type":418,"value":1868},{"type":412,"tag":620,"props":8732,"children":8733},{"style":847},[8734],{"type":418,"value":2195},{"type":412,"tag":620,"props":8736,"children":8737},{"class":622,"line":407},[8738,8742,8746,8750],{"type":412,"tag":620,"props":8739,"children":8740},{"style":847},[8741],{"type":418,"value":2203},{"type":412,"tag":620,"props":8743,"children":8744},{"style":633},[8745],{"type":418,"value":90},{"type":412,"tag":620,"props":8747,"children":8748},{"style":847},[8749],{"type":418,"value":881},{"type":412,"tag":620,"props":8751,"children":8752},{"style":847},[8753],{"type":418,"value":886},{"type":412,"tag":620,"props":8755,"children":8756},{"class":622,"line":2004},[8757,8761,8765,8770,8774,8778,8782,8786],{"type":412,"tag":620,"props":8758,"children":8759},{"style":901},[8760],{"type":418,"value":2232},{"type":412,"tag":620,"props":8762,"children":8763},{"style":847},[8764],{"type":418,"value":850},{"type":412,"tag":620,"props":8766,"children":8767},{"style":853},[8768],{"type":418,"value":8769}," attempt",{"type":412,"tag":620,"props":8771,"children":8772},{"style":847},[8773],{"type":418,"value":861},{"type":412,"tag":620,"props":8775,"children":8776},{"style":847},[8777],{"type":418,"value":2242},{"type":412,"tag":620,"props":8779,"children":8780},{"style":673},[8781],{"type":418,"value":1147},{"type":412,"tag":620,"props":8783,"children":8784},{"style":1958},[8785],{"type":418,"value":2475},{"type":412,"tag":620,"props":8787,"children":8788},{"style":847},[8789],{"type":418,"value":886},{"type":412,"tag":620,"props":8791,"children":8792},{"class":622,"line":2057},[8793,8798,8802,8807,8811,8815,8820,8824,8829,8833,8838,8842,8846,8850,8854],{"type":412,"tag":620,"props":8794,"children":8795},{"style":853},[8796],{"type":418,"value":8797},"  console",{"type":412,"tag":620,"props":8799,"children":8800},{"style":847},[8801],{"type":418,"value":1090},{"type":412,"tag":620,"props":8803,"children":8804},{"style":673},[8805],{"type":418,"value":8806},"log",{"type":412,"tag":620,"props":8808,"children":8809},{"style":1958},[8810],{"type":418,"value":2145},{"type":412,"tag":620,"props":8812,"children":8813},{"style":847},[8814],{"type":418,"value":4133},{"type":412,"tag":620,"props":8816,"children":8817},{"style":633},[8818],{"type":418,"value":8819},"Attempt ",{"type":412,"tag":620,"props":8821,"children":8822},{"style":847},[8823],{"type":418,"value":4114},{"type":412,"tag":620,"props":8825,"children":8826},{"style":853},[8827],{"type":418,"value":8828},"attempt",{"type":412,"tag":620,"props":8830,"children":8831},{"style":847},[8832],{"type":418,"value":4123},{"type":412,"tag":620,"props":8834,"children":8835},{"style":633},[8836],{"type":418,"value":8837}," for ",{"type":412,"tag":620,"props":8839,"children":8840},{"style":847},[8841],{"type":418,"value":4114},{"type":412,"tag":620,"props":8843,"children":8844},{"style":853},[8845],{"type":418,"value":8718},{"type":412,"tag":620,"props":8847,"children":8848},{"style":847},[8849],{"type":418,"value":6673},{"type":412,"tag":620,"props":8851,"children":8852},{"style":1958},[8853],{"type":418,"value":1868},{"type":412,"tag":620,"props":8855,"children":8856},{"style":847},[8857],{"type":418,"value":886},{"type":412,"tag":620,"props":8859,"children":8860},{"class":622,"line":2112},[8861],{"type":412,"tag":620,"props":8862,"children":8863},{"style":1005},[8864],{"type":418,"value":8865},"  \u002F\u002F ...\n",{"type":412,"tag":620,"props":8867,"children":8868},{"class":622,"line":2120},[8869],{"type":412,"tag":620,"props":8870,"children":8871},{"style":847},[8872],{"type":418,"value":2348},{"type":412,"tag":513,"props":8874,"children":8876},{"id":8875},"sandbox-limitations-workarounds",[8877],{"type":418,"value":8878},"Sandbox Limitations & Workarounds",{"type":412,"tag":8880,"props":8881,"children":8882},"table",{},[8883,8902],{"type":412,"tag":8884,"props":8885,"children":8886},"thead",{},[8887],{"type":412,"tag":8888,"props":8889,"children":8890},"tr",{},[8891,8897],{"type":412,"tag":8892,"props":8893,"children":8894},"th",{},[8895],{"type":418,"value":8896},"Limitation",{"type":412,"tag":8892,"props":8898,"children":8899},{},[8900],{"type":418,"value":8901},"Solution",{"type":412,"tag":8903,"props":8904,"children":8905},"tbody",{},[8906,8941,8978],{"type":412,"tag":8888,"props":8907,"children":8908},{},[8909,8923],{"type":412,"tag":8910,"props":8911,"children":8912},"td",{},[8913,8915,8921],{"type":418,"value":8914},"No native ",{"type":412,"tag":460,"props":8916,"children":8918},{"className":8917},[],[8919],{"type":418,"value":8920},"fetch()",{"type":418,"value":8922}," in workflow scope",{"type":412,"tag":8910,"props":8924,"children":8925},{},[8926,8928,8933,8934,8939],{"type":418,"value":8927},"Import ",{"type":412,"tag":460,"props":8929,"children":8931},{"className":8930},[],[8932],{"type":418,"value":1603},{"type":418,"value":3619},{"type":412,"tag":460,"props":8935,"children":8937},{"className":8936},[],[8938],{"type":418,"value":1112},{"type":418,"value":8940}," or move to a step",{"type":412,"tag":8888,"props":8942,"children":8943},{},[8944,8962],{"type":412,"tag":8910,"props":8945,"children":8946},{},[8947,8949,8954,8956],{"type":418,"value":8948},"No ",{"type":412,"tag":460,"props":8950,"children":8952},{"className":8951},[],[8953],{"type":418,"value":1611},{"type":418,"value":8955},"\u002F",{"type":412,"tag":460,"props":8957,"children":8959},{"className":8958},[],[8960],{"type":418,"value":8961},"setInterval",{"type":412,"tag":8910,"props":8963,"children":8964},{},[8965,8966,8972,8973],{"type":418,"value":6258},{"type":412,"tag":460,"props":8967,"children":8969},{"className":8968},[],[8970],{"type":418,"value":8971},"sleep()",{"type":418,"value":3619},{"type":412,"tag":460,"props":8974,"children":8976},{"className":8975},[],[8977],{"type":418,"value":1112},{"type":412,"tag":8888,"props":8979,"children":8980},{},[8981,8986],{"type":412,"tag":8910,"props":8982,"children":8983},{},[8984],{"type":418,"value":8985},"No Node.js modules in workflow scope",{"type":412,"tag":8910,"props":8987,"children":8988},{},[8989],{"type":418,"value":8990},"Move all Node.js logic to step functions",{"type":412,"tag":513,"props":8992,"children":8994},{"id":8993},"durableagent-ai-sdk-integration",[8995],{"type":418,"value":8996},"DurableAgent (AI SDK Integration)",{"type":412,"tag":609,"props":8998,"children":9000},{"className":829,"code":8999,"language":831,"meta":614,"style":614},"import { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\nimport { getWritable } from \"workflow\";\nimport { z } from \"zod\";\n\nasync function searchDatabase(query: string) {\n  \"use step\";\n  \u002F\u002F Full Node.js access — real DB calls here\n  return `Results for \"${query}\"`;\n}\n\nexport async function researchAgent(topic: string) {\n  \"use workflow\";\n\n  const agent = new DurableAgent({\n    model: \"anthropic\u002Fclaude-sonnet-4-5\",\n    system: \"You are a research assistant.\",\n    tools: {\n      search: {\n        description: \"Search the database\",\n        inputSchema: z.object({ query: z.string() }),\n        execute: searchDatabase,  \u002F\u002F Tool execute uses \"use step\"\n      },\n    },\n  });\n\n  const result = await agent.stream({\n    messages: [{ role: \"user\", content: `Research ${topic}` }],\n    writable: getWritable(),\n    maxSteps: 10,\n  });\n\n  return result.messages;\n}\n",[9001],{"type":412,"tag":460,"props":9002,"children":9003},{"__ignoreMap":614},[9004,9043,9082,9123,9130,9171,9190,9198,9238,9245,9252,9297,9316,9323,9355,9384,9413,9429,9445,9474,9544,9569,9576,9583,9598,9605,9644,9732,9756,9777,9792,9799,9823],{"type":412,"tag":620,"props":9005,"children":9006},{"class":622,"line":623},[9007,9011,9015,9019,9023,9027,9031,9035,9039],{"type":412,"tag":620,"props":9008,"children":9009},{"style":841},[9010],{"type":418,"value":844},{"type":412,"tag":620,"props":9012,"children":9013},{"style":847},[9014],{"type":418,"value":850},{"type":412,"tag":620,"props":9016,"children":9017},{"style":853},[9018],{"type":418,"value":1497},{"type":412,"tag":620,"props":9020,"children":9021},{"style":847},[9022],{"type":418,"value":861},{"type":412,"tag":620,"props":9024,"children":9025},{"style":841},[9026],{"type":418,"value":866},{"type":412,"tag":620,"props":9028,"children":9029},{"style":847},[9030],{"type":418,"value":871},{"type":412,"tag":620,"props":9032,"children":9033},{"style":633},[9034],{"type":418,"value":1514},{"type":412,"tag":620,"props":9036,"children":9037},{"style":847},[9038],{"type":418,"value":881},{"type":412,"tag":620,"props":9040,"children":9041},{"style":847},[9042],{"type":418,"value":886},{"type":412,"tag":620,"props":9044,"children":9045},{"class":622,"line":669},[9046,9050,9054,9058,9062,9066,9070,9074,9078],{"type":412,"tag":620,"props":9047,"children":9048},{"style":841},[9049],{"type":418,"value":844},{"type":412,"tag":620,"props":9051,"children":9052},{"style":847},[9053],{"type":418,"value":850},{"type":412,"tag":620,"props":9055,"children":9056},{"style":853},[9057],{"type":418,"value":1137},{"type":412,"tag":620,"props":9059,"children":9060},{"style":847},[9061],{"type":418,"value":861},{"type":412,"tag":620,"props":9063,"children":9064},{"style":841},[9065],{"type":418,"value":866},{"type":412,"tag":620,"props":9067,"children":9068},{"style":847},[9069],{"type":418,"value":871},{"type":412,"tag":620,"props":9071,"children":9072},{"style":633},[9073],{"type":418,"value":4},{"type":412,"tag":620,"props":9075,"children":9076},{"style":847},[9077],{"type":418,"value":881},{"type":412,"tag":620,"props":9079,"children":9080},{"style":847},[9081],{"type":418,"value":886},{"type":412,"tag":620,"props":9083,"children":9084},{"class":622,"line":684},[9085,9089,9093,9098,9102,9106,9110,9115,9119],{"type":412,"tag":620,"props":9086,"children":9087},{"style":841},[9088],{"type":418,"value":844},{"type":412,"tag":620,"props":9090,"children":9091},{"style":847},[9092],{"type":418,"value":850},{"type":412,"tag":620,"props":9094,"children":9095},{"style":853},[9096],{"type":418,"value":9097}," z",{"type":412,"tag":620,"props":9099,"children":9100},{"style":847},[9101],{"type":418,"value":861},{"type":412,"tag":620,"props":9103,"children":9104},{"style":841},[9105],{"type":418,"value":866},{"type":412,"tag":620,"props":9107,"children":9108},{"style":847},[9109],{"type":418,"value":871},{"type":412,"tag":620,"props":9111,"children":9112},{"style":633},[9113],{"type":418,"value":9114},"zod",{"type":412,"tag":620,"props":9116,"children":9117},{"style":847},[9118],{"type":418,"value":881},{"type":412,"tag":620,"props":9120,"children":9121},{"style":847},[9122],{"type":418,"value":886},{"type":412,"tag":620,"props":9124,"children":9125},{"class":622,"line":407},[9126],{"type":412,"tag":620,"props":9127,"children":9128},{"emptyLinePlaceholder":892},[9129],{"type":418,"value":895},{"type":412,"tag":620,"props":9131,"children":9132},{"class":622,"line":2004},[9133,9137,9141,9146,9150,9155,9159,9163,9167],{"type":412,"tag":620,"props":9134,"children":9135},{"style":901},[9136],{"type":418,"value":2365},{"type":412,"tag":620,"props":9138,"children":9139},{"style":901},[9140],{"type":418,"value":2135},{"type":412,"tag":620,"props":9142,"children":9143},{"style":673},[9144],{"type":418,"value":9145}," searchDatabase",{"type":412,"tag":620,"props":9147,"children":9148},{"style":847},[9149],{"type":418,"value":2145},{"type":412,"tag":620,"props":9151,"children":9152},{"style":2148},[9153],{"type":418,"value":9154},"query",{"type":412,"tag":620,"props":9156,"children":9157},{"style":847},[9158],{"type":418,"value":826},{"type":412,"tag":620,"props":9160,"children":9161},{"style":627},[9162],{"type":418,"value":1996},{"type":412,"tag":620,"props":9164,"children":9165},{"style":847},[9166],{"type":418,"value":1868},{"type":412,"tag":620,"props":9168,"children":9169},{"style":847},[9170],{"type":418,"value":2195},{"type":412,"tag":620,"props":9172,"children":9173},{"class":622,"line":2057},[9174,9178,9182,9186],{"type":412,"tag":620,"props":9175,"children":9176},{"style":847},[9177],{"type":418,"value":2203},{"type":412,"tag":620,"props":9179,"children":9180},{"style":633},[9181],{"type":418,"value":90},{"type":412,"tag":620,"props":9183,"children":9184},{"style":847},[9185],{"type":418,"value":881},{"type":412,"tag":620,"props":9187,"children":9188},{"style":847},[9189],{"type":418,"value":886},{"type":412,"tag":620,"props":9191,"children":9192},{"class":622,"line":2112},[9193],{"type":412,"tag":620,"props":9194,"children":9195},{"style":1005},[9196],{"type":418,"value":9197},"  \u002F\u002F Full Node.js access — real DB calls here\n",{"type":412,"tag":620,"props":9199,"children":9200},{"class":622,"line":2120},[9201,9205,9209,9214,9218,9222,9226,9230,9234],{"type":412,"tag":620,"props":9202,"children":9203},{"style":841},[9204],{"type":418,"value":2327},{"type":412,"tag":620,"props":9206,"children":9207},{"style":847},[9208],{"type":418,"value":4105},{"type":412,"tag":620,"props":9210,"children":9211},{"style":633},[9212],{"type":418,"value":9213},"Results for \"",{"type":412,"tag":620,"props":9215,"children":9216},{"style":847},[9217],{"type":418,"value":4114},{"type":412,"tag":620,"props":9219,"children":9220},{"style":853},[9221],{"type":418,"value":9154},{"type":412,"tag":620,"props":9223,"children":9224},{"style":847},[9225],{"type":418,"value":4123},{"type":412,"tag":620,"props":9227,"children":9228},{"style":633},[9229],{"type":418,"value":881},{"type":412,"tag":620,"props":9231,"children":9232},{"style":847},[9233],{"type":418,"value":4133},{"type":412,"tag":620,"props":9235,"children":9236},{"style":847},[9237],{"type":418,"value":886},{"type":412,"tag":620,"props":9239,"children":9240},{"class":622,"line":33},[9241],{"type":412,"tag":620,"props":9242,"children":9243},{"style":847},[9244],{"type":418,"value":2348},{"type":412,"tag":620,"props":9246,"children":9247},{"class":622,"line":2218},[9248],{"type":412,"tag":620,"props":9249,"children":9250},{"emptyLinePlaceholder":892},[9251],{"type":418,"value":895},{"type":412,"tag":620,"props":9253,"children":9254},{"class":622,"line":2226},[9255,9259,9263,9267,9272,9276,9281,9285,9289,9293],{"type":412,"tag":620,"props":9256,"children":9257},{"style":841},[9258],{"type":418,"value":927},{"type":412,"tag":620,"props":9260,"children":9261},{"style":901},[9262],{"type":418,"value":2130},{"type":412,"tag":620,"props":9264,"children":9265},{"style":901},[9266],{"type":418,"value":2135},{"type":412,"tag":620,"props":9268,"children":9269},{"style":673},[9270],{"type":418,"value":9271}," researchAgent",{"type":412,"tag":620,"props":9273,"children":9274},{"style":847},[9275],{"type":418,"value":2145},{"type":412,"tag":620,"props":9277,"children":9278},{"style":2148},[9279],{"type":418,"value":9280},"topic",{"type":412,"tag":620,"props":9282,"children":9283},{"style":847},[9284],{"type":418,"value":826},{"type":412,"tag":620,"props":9286,"children":9287},{"style":627},[9288],{"type":418,"value":1996},{"type":412,"tag":620,"props":9290,"children":9291},{"style":847},[9292],{"type":418,"value":1868},{"type":412,"tag":620,"props":9294,"children":9295},{"style":847},[9296],{"type":418,"value":2195},{"type":412,"tag":620,"props":9298,"children":9299},{"class":622,"line":2271},[9300,9304,9308,9312],{"type":412,"tag":620,"props":9301,"children":9302},{"style":847},[9303],{"type":418,"value":2203},{"type":412,"tag":620,"props":9305,"children":9306},{"style":633},[9307],{"type":418,"value":89},{"type":412,"tag":620,"props":9309,"children":9310},{"style":847},[9311],{"type":418,"value":881},{"type":412,"tag":620,"props":9313,"children":9314},{"style":847},[9315],{"type":418,"value":886},{"type":412,"tag":620,"props":9317,"children":9318},{"class":622,"line":2313},[9319],{"type":412,"tag":620,"props":9320,"children":9321},{"emptyLinePlaceholder":892},[9322],{"type":418,"value":895},{"type":412,"tag":620,"props":9324,"children":9325},{"class":622,"line":2321},[9326,9330,9335,9339,9343,9347,9351],{"type":412,"tag":620,"props":9327,"children":9328},{"style":901},[9329],{"type":418,"value":2232},{"type":412,"tag":620,"props":9331,"children":9332},{"style":853},[9333],{"type":418,"value":9334}," agent",{"type":412,"tag":620,"props":9336,"children":9337},{"style":847},[9338],{"type":418,"value":2242},{"type":412,"tag":620,"props":9340,"children":9341},{"style":847},[9342],{"type":418,"value":4252},{"type":412,"tag":620,"props":9344,"children":9345},{"style":673},[9346],{"type":418,"value":1497},{"type":412,"tag":620,"props":9348,"children":9349},{"style":1958},[9350],{"type":418,"value":2145},{"type":412,"tag":620,"props":9352,"children":9353},{"style":847},[9354],{"type":418,"value":4349},{"type":412,"tag":620,"props":9356,"children":9357},{"class":622,"line":2342},[9358,9363,9367,9371,9376,9380],{"type":412,"tag":620,"props":9359,"children":9360},{"style":1958},[9361],{"type":418,"value":9362},"    model",{"type":412,"tag":620,"props":9364,"children":9365},{"style":847},[9366],{"type":418,"value":826},{"type":412,"tag":620,"props":9368,"children":9369},{"style":847},[9370],{"type":418,"value":871},{"type":412,"tag":620,"props":9372,"children":9373},{"style":633},[9374],{"type":418,"value":9375},"anthropic\u002Fclaude-sonnet-4-5",{"type":412,"tag":620,"props":9377,"children":9378},{"style":847},[9379],{"type":418,"value":881},{"type":412,"tag":620,"props":9381,"children":9382},{"style":847},[9383],{"type":418,"value":4675},{"type":412,"tag":620,"props":9385,"children":9386},{"class":622,"line":2351},[9387,9392,9396,9400,9405,9409],{"type":412,"tag":620,"props":9388,"children":9389},{"style":1958},[9390],{"type":418,"value":9391},"    system",{"type":412,"tag":620,"props":9393,"children":9394},{"style":847},[9395],{"type":418,"value":826},{"type":412,"tag":620,"props":9397,"children":9398},{"style":847},[9399],{"type":418,"value":871},{"type":412,"tag":620,"props":9401,"children":9402},{"style":633},[9403],{"type":418,"value":9404},"You are a research assistant.",{"type":412,"tag":620,"props":9406,"children":9407},{"style":847},[9408],{"type":418,"value":881},{"type":412,"tag":620,"props":9410,"children":9411},{"style":847},[9412],{"type":418,"value":4675},{"type":412,"tag":620,"props":9414,"children":9415},{"class":622,"line":2359},[9416,9421,9425],{"type":412,"tag":620,"props":9417,"children":9418},{"style":1958},[9419],{"type":418,"value":9420},"    tools",{"type":412,"tag":620,"props":9422,"children":9423},{"style":847},[9424],{"type":418,"value":826},{"type":412,"tag":620,"props":9426,"children":9427},{"style":847},[9428],{"type":418,"value":2195},{"type":412,"tag":620,"props":9430,"children":9431},{"class":622,"line":2419},[9432,9437,9441],{"type":412,"tag":620,"props":9433,"children":9434},{"style":1958},[9435],{"type":418,"value":9436},"      search",{"type":412,"tag":620,"props":9438,"children":9439},{"style":847},[9440],{"type":418,"value":826},{"type":412,"tag":620,"props":9442,"children":9443},{"style":847},[9444],{"type":418,"value":2195},{"type":412,"tag":620,"props":9446,"children":9447},{"class":622,"line":2439},[9448,9453,9457,9461,9466,9470],{"type":412,"tag":620,"props":9449,"children":9450},{"style":1958},[9451],{"type":418,"value":9452},"        description",{"type":412,"tag":620,"props":9454,"children":9455},{"style":847},[9456],{"type":418,"value":826},{"type":412,"tag":620,"props":9458,"children":9459},{"style":847},[9460],{"type":418,"value":871},{"type":412,"tag":620,"props":9462,"children":9463},{"style":633},[9464],{"type":418,"value":9465},"Search the database",{"type":412,"tag":620,"props":9467,"children":9468},{"style":847},[9469],{"type":418,"value":881},{"type":412,"tag":620,"props":9471,"children":9472},{"style":847},[9473],{"type":418,"value":4675},{"type":412,"tag":620,"props":9475,"children":9476},{"class":622,"line":2495},[9477,9482,9486,9490,9494,9499,9503,9507,9512,9516,9520,9524,9528,9532,9536,9540],{"type":412,"tag":620,"props":9478,"children":9479},{"style":1958},[9480],{"type":418,"value":9481},"        inputSchema",{"type":412,"tag":620,"props":9483,"children":9484},{"style":847},[9485],{"type":418,"value":826},{"type":412,"tag":620,"props":9487,"children":9488},{"style":853},[9489],{"type":418,"value":9097},{"type":412,"tag":620,"props":9491,"children":9492},{"style":847},[9493],{"type":418,"value":1090},{"type":412,"tag":620,"props":9495,"children":9496},{"style":673},[9497],{"type":418,"value":9498},"object",{"type":412,"tag":620,"props":9500,"children":9501},{"style":1958},[9502],{"type":418,"value":2145},{"type":412,"tag":620,"props":9504,"children":9505},{"style":847},[9506],{"type":418,"value":2536},{"type":412,"tag":620,"props":9508,"children":9509},{"style":1958},[9510],{"type":418,"value":9511}," query",{"type":412,"tag":620,"props":9513,"children":9514},{"style":847},[9515],{"type":418,"value":826},{"type":412,"tag":620,"props":9517,"children":9518},{"style":853},[9519],{"type":418,"value":9097},{"type":412,"tag":620,"props":9521,"children":9522},{"style":847},[9523],{"type":418,"value":1090},{"type":412,"tag":620,"props":9525,"children":9526},{"style":673},[9527],{"type":418,"value":2407},{"type":412,"tag":620,"props":9529,"children":9530},{"style":1958},[9531],{"type":418,"value":5667},{"type":412,"tag":620,"props":9533,"children":9534},{"style":847},[9535],{"type":418,"value":4123},{"type":412,"tag":620,"props":9537,"children":9538},{"style":1958},[9539],{"type":418,"value":1868},{"type":412,"tag":620,"props":9541,"children":9542},{"style":847},[9543],{"type":418,"value":4675},{"type":412,"tag":620,"props":9545,"children":9546},{"class":622,"line":2508},[9547,9552,9556,9560,9564],{"type":412,"tag":620,"props":9548,"children":9549},{"style":1958},[9550],{"type":418,"value":9551},"        execute",{"type":412,"tag":620,"props":9553,"children":9554},{"style":847},[9555],{"type":418,"value":826},{"type":412,"tag":620,"props":9557,"children":9558},{"style":853},[9559],{"type":418,"value":9145},{"type":412,"tag":620,"props":9561,"children":9562},{"style":847},[9563],{"type":418,"value":1142},{"type":412,"tag":620,"props":9565,"children":9566},{"style":1005},[9567],{"type":418,"value":9568},"  \u002F\u002F Tool execute uses \"use step\"\n",{"type":412,"tag":620,"props":9570,"children":9571},{"class":622,"line":2596},[9572],{"type":412,"tag":620,"props":9573,"children":9574},{"style":847},[9575],{"type":418,"value":4556},{"type":412,"tag":620,"props":9577,"children":9578},{"class":622,"line":2605},[9579],{"type":412,"tag":620,"props":9580,"children":9581},{"style":847},[9582],{"type":418,"value":4786},{"type":412,"tag":620,"props":9584,"children":9585},{"class":622,"line":2647},[9586,9590,9594],{"type":412,"tag":620,"props":9587,"children":9588},{"style":847},[9589],{"type":418,"value":2754},{"type":412,"tag":620,"props":9591,"children":9592},{"style":1958},[9593],{"type":418,"value":1868},{"type":412,"tag":620,"props":9595,"children":9596},{"style":847},[9597],{"type":418,"value":886},{"type":412,"tag":620,"props":9599,"children":9600},{"class":622,"line":2731},[9601],{"type":412,"tag":620,"props":9602,"children":9603},{"emptyLinePlaceholder":892},[9604],{"type":418,"value":895},{"type":412,"tag":620,"props":9606,"children":9607},{"class":622,"line":2748},[9608,9612,9616,9620,9624,9628,9632,9636,9640],{"type":412,"tag":620,"props":9609,"children":9610},{"style":901},[9611],{"type":418,"value":2232},{"type":412,"tag":620,"props":9613,"children":9614},{"style":853},[9615],{"type":418,"value":2096},{"type":412,"tag":620,"props":9617,"children":9618},{"style":847},[9619],{"type":418,"value":2242},{"type":412,"tag":620,"props":9621,"children":9622},{"style":841},[9623],{"type":418,"value":2247},{"type":412,"tag":620,"props":9625,"children":9626},{"style":853},[9627],{"type":418,"value":9334},{"type":412,"tag":620,"props":9629,"children":9630},{"style":847},[9631],{"type":418,"value":1090},{"type":412,"tag":620,"props":9633,"children":9634},{"style":673},[9635],{"type":418,"value":243},{"type":412,"tag":620,"props":9637,"children":9638},{"style":1958},[9639],{"type":418,"value":2145},{"type":412,"tag":620,"props":9641,"children":9642},{"style":847},[9643],{"type":418,"value":4349},{"type":412,"tag":620,"props":9645,"children":9646},{"class":622,"line":2766},[9647,9652,9656,9660,9664,9669,9673,9677,9682,9686,9690,9695,9699,9703,9708,9712,9716,9720,9724,9728],{"type":412,"tag":620,"props":9648,"children":9649},{"style":1958},[9650],{"type":418,"value":9651},"    messages",{"type":412,"tag":620,"props":9653,"children":9654},{"style":847},[9655],{"type":418,"value":826},{"type":412,"tag":620,"props":9657,"children":9658},{"style":1958},[9659],{"type":418,"value":3512},{"type":412,"tag":620,"props":9661,"children":9662},{"style":847},[9663],{"type":418,"value":2536},{"type":412,"tag":620,"props":9665,"children":9666},{"style":1958},[9667],{"type":418,"value":9668}," role",{"type":412,"tag":620,"props":9670,"children":9671},{"style":847},[9672],{"type":418,"value":826},{"type":412,"tag":620,"props":9674,"children":9675},{"style":847},[9676],{"type":418,"value":871},{"type":412,"tag":620,"props":9678,"children":9679},{"style":633},[9680],{"type":418,"value":9681},"user",{"type":412,"tag":620,"props":9683,"children":9684},{"style":847},[9685],{"type":418,"value":881},{"type":412,"tag":620,"props":9687,"children":9688},{"style":847},[9689],{"type":418,"value":1142},{"type":412,"tag":620,"props":9691,"children":9692},{"style":1958},[9693],{"type":418,"value":9694}," content",{"type":412,"tag":620,"props":9696,"children":9697},{"style":847},[9698],{"type":418,"value":826},{"type":412,"tag":620,"props":9700,"children":9701},{"style":847},[9702],{"type":418,"value":4105},{"type":412,"tag":620,"props":9704,"children":9705},{"style":633},[9706],{"type":418,"value":9707},"Research ",{"type":412,"tag":620,"props":9709,"children":9710},{"style":847},[9711],{"type":418,"value":4114},{"type":412,"tag":620,"props":9713,"children":9714},{"style":853},[9715],{"type":418,"value":9280},{"type":412,"tag":620,"props":9717,"children":9718},{"style":847},[9719],{"type":418,"value":6673},{"type":412,"tag":620,"props":9721,"children":9722},{"style":847},[9723],{"type":418,"value":861},{"type":412,"tag":620,"props":9725,"children":9726},{"style":1958},[9727],{"type":418,"value":5393},{"type":412,"tag":620,"props":9729,"children":9730},{"style":847},[9731],{"type":418,"value":4675},{"type":412,"tag":620,"props":9733,"children":9734},{"class":622,"line":2792},[9735,9740,9744,9748,9752],{"type":412,"tag":620,"props":9736,"children":9737},{"style":1958},[9738],{"type":418,"value":9739},"    writable",{"type":412,"tag":620,"props":9741,"children":9742},{"style":847},[9743],{"type":418,"value":826},{"type":412,"tag":620,"props":9745,"children":9746},{"style":673},[9747],{"type":418,"value":1137},{"type":412,"tag":620,"props":9749,"children":9750},{"style":1958},[9751],{"type":418,"value":2475},{"type":412,"tag":620,"props":9753,"children":9754},{"style":847},[9755],{"type":418,"value":4675},{"type":412,"tag":620,"props":9757,"children":9758},{"class":622,"line":2801},[9759,9764,9768,9773],{"type":412,"tag":620,"props":9760,"children":9761},{"style":1958},[9762],{"type":418,"value":9763},"    maxSteps",{"type":412,"tag":620,"props":9765,"children":9766},{"style":847},[9767],{"type":418,"value":826},{"type":412,"tag":620,"props":9769,"children":9770},{"style":4161},[9771],{"type":418,"value":9772}," 10",{"type":412,"tag":620,"props":9774,"children":9775},{"style":847},[9776],{"type":418,"value":4675},{"type":412,"tag":620,"props":9778,"children":9779},{"class":622,"line":2809},[9780,9784,9788],{"type":412,"tag":620,"props":9781,"children":9782},{"style":847},[9783],{"type":418,"value":2754},{"type":412,"tag":620,"props":9785,"children":9786},{"style":1958},[9787],{"type":418,"value":1868},{"type":412,"tag":620,"props":9789,"children":9790},{"style":847},[9791],{"type":418,"value":886},{"type":412,"tag":620,"props":9793,"children":9794},{"class":622,"line":2817},[9795],{"type":412,"tag":620,"props":9796,"children":9797},{"emptyLinePlaceholder":892},[9798],{"type":418,"value":895},{"type":412,"tag":620,"props":9800,"children":9801},{"class":622,"line":2873},[9802,9806,9810,9814,9819],{"type":412,"tag":620,"props":9803,"children":9804},{"style":841},[9805],{"type":418,"value":2327},{"type":412,"tag":620,"props":9807,"children":9808},{"style":853},[9809],{"type":418,"value":2096},{"type":412,"tag":620,"props":9811,"children":9812},{"style":847},[9813],{"type":418,"value":1090},{"type":412,"tag":620,"props":9815,"children":9816},{"style":853},[9817],{"type":418,"value":9818},"messages",{"type":412,"tag":620,"props":9820,"children":9821},{"style":847},[9822],{"type":418,"value":886},{"type":412,"tag":620,"props":9824,"children":9825},{"class":622,"line":2893},[9826],{"type":412,"tag":620,"props":9827,"children":9828},{"style":847},[9829],{"type":418,"value":2348},{"type":412,"tag":425,"props":9831,"children":9832},{},[9833],{"type":418,"value":9834},"Every LLM call and tool execution becomes a retryable step. The entire agent loop survives crashes and deployments.",{"type":412,"tag":513,"props":9836,"children":9838},{"id":9837},"common-patterns",[9839],{"type":418,"value":9840},"Common Patterns",{"type":412,"tag":800,"props":9842,"children":9844},{"id":9843},"fan-out-parallel-steps",[9845],{"type":418,"value":9846},"Fan-Out \u002F Parallel Steps",{"type":412,"tag":609,"props":9848,"children":9850},{"className":829,"code":9849,"language":831,"meta":614,"style":614},"export async function processImages(imageIds: string[]) {\n  \"use workflow\";\n\n  const results = await Promise.all(\n    imageIds.map(async (id) => {\n      return await resizeImage(id);  \u002F\u002F Each is its own step\n    })\n  );\n\n  await saveResults(results);\n}\n\nasync function resizeImage(id: string) {\n  \"use step\";\n  \u002F\u002F ...\n}\n",[9851],{"type":412,"tag":460,"props":9852,"children":9853},{"__ignoreMap":614},[9854,9904,9923,9930,9966,10010,10048,10059,10070,10077,10106,10113,10120,10159,10178,10185],{"type":412,"tag":620,"props":9855,"children":9856},{"class":622,"line":623},[9857,9861,9865,9869,9874,9878,9883,9887,9891,9896,9900],{"type":412,"tag":620,"props":9858,"children":9859},{"style":841},[9860],{"type":418,"value":927},{"type":412,"tag":620,"props":9862,"children":9863},{"style":901},[9864],{"type":418,"value":2130},{"type":412,"tag":620,"props":9866,"children":9867},{"style":901},[9868],{"type":418,"value":2135},{"type":412,"tag":620,"props":9870,"children":9871},{"style":673},[9872],{"type":418,"value":9873}," processImages",{"type":412,"tag":620,"props":9875,"children":9876},{"style":847},[9877],{"type":418,"value":2145},{"type":412,"tag":620,"props":9879,"children":9880},{"style":2148},[9881],{"type":418,"value":9882},"imageIds",{"type":412,"tag":620,"props":9884,"children":9885},{"style":847},[9886],{"type":418,"value":826},{"type":412,"tag":620,"props":9888,"children":9889},{"style":627},[9890],{"type":418,"value":1996},{"type":412,"tag":620,"props":9892,"children":9893},{"style":853},[9894],{"type":418,"value":9895},"[]",{"type":412,"tag":620,"props":9897,"children":9898},{"style":847},[9899],{"type":418,"value":1868},{"type":412,"tag":620,"props":9901,"children":9902},{"style":847},[9903],{"type":418,"value":2195},{"type":412,"tag":620,"props":9905,"children":9906},{"class":622,"line":669},[9907,9911,9915,9919],{"type":412,"tag":620,"props":9908,"children":9909},{"style":847},[9910],{"type":418,"value":2203},{"type":412,"tag":620,"props":9912,"children":9913},{"style":633},[9914],{"type":418,"value":89},{"type":412,"tag":620,"props":9916,"children":9917},{"style":847},[9918],{"type":418,"value":881},{"type":412,"tag":620,"props":9920,"children":9921},{"style":847},[9922],{"type":418,"value":886},{"type":412,"tag":620,"props":9924,"children":9925},{"class":622,"line":684},[9926],{"type":412,"tag":620,"props":9927,"children":9928},{"emptyLinePlaceholder":892},[9929],{"type":418,"value":895},{"type":412,"tag":620,"props":9931,"children":9932},{"class":622,"line":407},[9933,9937,9942,9946,9950,9954,9958,9962],{"type":412,"tag":620,"props":9934,"children":9935},{"style":901},[9936],{"type":418,"value":2232},{"type":412,"tag":620,"props":9938,"children":9939},{"style":853},[9940],{"type":418,"value":9941}," results",{"type":412,"tag":620,"props":9943,"children":9944},{"style":847},[9945],{"type":418,"value":2242},{"type":412,"tag":620,"props":9947,"children":9948},{"style":841},[9949],{"type":418,"value":2247},{"type":412,"tag":620,"props":9951,"children":9952},{"style":627},[9953],{"type":418,"value":2168},{"type":412,"tag":620,"props":9955,"children":9956},{"style":847},[9957],{"type":418,"value":1090},{"type":412,"tag":620,"props":9959,"children":9960},{"style":673},[9961],{"type":418,"value":5417},{"type":412,"tag":620,"props":9963,"children":9964},{"style":1958},[9965],{"type":418,"value":4025},{"type":412,"tag":620,"props":9967,"children":9968},{"class":622,"line":2004},[9969,9974,9978,9982,9986,9990,9994,9998,10002,10006],{"type":412,"tag":620,"props":9970,"children":9971},{"style":853},[9972],{"type":418,"value":9973},"    imageIds",{"type":412,"tag":620,"props":9975,"children":9976},{"style":847},[9977],{"type":418,"value":1090},{"type":412,"tag":620,"props":9979,"children":9980},{"style":673},[9981],{"type":418,"value":6139},{"type":412,"tag":620,"props":9983,"children":9984},{"style":1958},[9985],{"type":418,"value":2145},{"type":412,"tag":620,"props":9987,"children":9988},{"style":901},[9989],{"type":418,"value":2365},{"type":412,"tag":620,"props":9991,"children":9992},{"style":847},[9993],{"type":418,"value":4286},{"type":412,"tag":620,"props":9995,"children":9996},{"style":2148},[9997],{"type":418,"value":8718},{"type":412,"tag":620,"props":9999,"children":10000},{"style":847},[10001],{"type":418,"value":1868},{"type":412,"tag":620,"props":10003,"children":10004},{"style":901},[10005],{"type":418,"value":6152},{"type":412,"tag":620,"props":10007,"children":10008},{"style":847},[10009],{"type":418,"value":2195},{"type":412,"tag":620,"props":10011,"children":10012},{"class":622,"line":2057},[10013,10018,10022,10027,10031,10035,10039,10043],{"type":412,"tag":620,"props":10014,"children":10015},{"style":841},[10016],{"type":418,"value":10017},"      return",{"type":412,"tag":620,"props":10019,"children":10020},{"style":841},[10021],{"type":418,"value":2247},{"type":412,"tag":620,"props":10023,"children":10024},{"style":673},[10025],{"type":418,"value":10026}," resizeImage",{"type":412,"tag":620,"props":10028,"children":10029},{"style":1958},[10030],{"type":418,"value":2145},{"type":412,"tag":620,"props":10032,"children":10033},{"style":853},[10034],{"type":418,"value":8718},{"type":412,"tag":620,"props":10036,"children":10037},{"style":1958},[10038],{"type":418,"value":1868},{"type":412,"tag":620,"props":10040,"children":10041},{"style":847},[10042],{"type":418,"value":1982},{"type":412,"tag":620,"props":10044,"children":10045},{"style":1005},[10046],{"type":418,"value":10047},"  \u002F\u002F Each is its own step\n",{"type":412,"tag":620,"props":10049,"children":10050},{"class":622,"line":2112},[10051,10055],{"type":412,"tag":620,"props":10052,"children":10053},{"style":847},[10054],{"type":418,"value":4564},{"type":412,"tag":620,"props":10056,"children":10057},{"style":1958},[10058],{"type":418,"value":4569},{"type":412,"tag":620,"props":10060,"children":10061},{"class":622,"line":2120},[10062,10066],{"type":412,"tag":620,"props":10063,"children":10064},{"style":1958},[10065],{"type":418,"value":4577},{"type":412,"tag":620,"props":10067,"children":10068},{"style":847},[10069],{"type":418,"value":886},{"type":412,"tag":620,"props":10071,"children":10072},{"class":622,"line":33},[10073],{"type":412,"tag":620,"props":10074,"children":10075},{"emptyLinePlaceholder":892},[10076],{"type":418,"value":895},{"type":412,"tag":620,"props":10078,"children":10079},{"class":622,"line":2218},[10080,10084,10089,10093,10098,10102],{"type":412,"tag":620,"props":10081,"children":10082},{"style":841},[10083],{"type":418,"value":6708},{"type":412,"tag":620,"props":10085,"children":10086},{"style":673},[10087],{"type":418,"value":10088}," saveResults",{"type":412,"tag":620,"props":10090,"children":10091},{"style":1958},[10092],{"type":418,"value":2145},{"type":412,"tag":620,"props":10094,"children":10095},{"style":853},[10096],{"type":418,"value":10097},"results",{"type":412,"tag":620,"props":10099,"children":10100},{"style":1958},[10101],{"type":418,"value":1868},{"type":412,"tag":620,"props":10103,"children":10104},{"style":847},[10105],{"type":418,"value":886},{"type":412,"tag":620,"props":10107,"children":10108},{"class":622,"line":2226},[10109],{"type":412,"tag":620,"props":10110,"children":10111},{"style":847},[10112],{"type":418,"value":2348},{"type":412,"tag":620,"props":10114,"children":10115},{"class":622,"line":2271},[10116],{"type":412,"tag":620,"props":10117,"children":10118},{"emptyLinePlaceholder":892},[10119],{"type":418,"value":895},{"type":412,"tag":620,"props":10121,"children":10122},{"class":622,"line":2313},[10123,10127,10131,10135,10139,10143,10147,10151,10155],{"type":412,"tag":620,"props":10124,"children":10125},{"style":901},[10126],{"type":418,"value":2365},{"type":412,"tag":620,"props":10128,"children":10129},{"style":901},[10130],{"type":418,"value":2135},{"type":412,"tag":620,"props":10132,"children":10133},{"style":673},[10134],{"type":418,"value":10026},{"type":412,"tag":620,"props":10136,"children":10137},{"style":847},[10138],{"type":418,"value":2145},{"type":412,"tag":620,"props":10140,"children":10141},{"style":2148},[10142],{"type":418,"value":8718},{"type":412,"tag":620,"props":10144,"children":10145},{"style":847},[10146],{"type":418,"value":826},{"type":412,"tag":620,"props":10148,"children":10149},{"style":627},[10150],{"type":418,"value":1996},{"type":412,"tag":620,"props":10152,"children":10153},{"style":847},[10154],{"type":418,"value":1868},{"type":412,"tag":620,"props":10156,"children":10157},{"style":847},[10158],{"type":418,"value":2195},{"type":412,"tag":620,"props":10160,"children":10161},{"class":622,"line":2321},[10162,10166,10170,10174],{"type":412,"tag":620,"props":10163,"children":10164},{"style":847},[10165],{"type":418,"value":2203},{"type":412,"tag":620,"props":10167,"children":10168},{"style":633},[10169],{"type":418,"value":90},{"type":412,"tag":620,"props":10171,"children":10172},{"style":847},[10173],{"type":418,"value":881},{"type":412,"tag":620,"props":10175,"children":10176},{"style":847},[10177],{"type":418,"value":886},{"type":412,"tag":620,"props":10179,"children":10180},{"class":622,"line":2342},[10181],{"type":412,"tag":620,"props":10182,"children":10183},{"style":1005},[10184],{"type":418,"value":8865},{"type":412,"tag":620,"props":10186,"children":10187},{"class":622,"line":2351},[10188],{"type":412,"tag":620,"props":10189,"children":10190},{"style":847},[10191],{"type":418,"value":2348},{"type":412,"tag":800,"props":10193,"children":10195},{"id":10194},"saga-with-compensation",[10196],{"type":418,"value":10197},"Saga with Compensation",{"type":412,"tag":609,"props":10199,"children":10201},{"className":829,"code":10200,"language":831,"meta":614,"style":614},"import { FatalError, getWritable } from \"workflow\";\n\nexport async function upgradeSaga(userId: string) {\n  \"use workflow\";\n\n  await reserveSeats(userId);\n\n  try {\n    await chargePayment(userId);\n  } catch {\n    await releaseSeats(userId);  \u002F\u002F Compensate\n    throw new FatalError(\"Payment failed\");\n  }\n\n  await activatePlan(userId);\n}\n",[10202],{"type":412,"tag":460,"props":10203,"children":10204},{"__ignoreMap":614},[10205,10252,10259,10304,10323,10330,10358,10365,10376,10404,10419,10452,10492,10499,10506,10534],{"type":412,"tag":620,"props":10206,"children":10207},{"class":622,"line":623},[10208,10212,10216,10220,10224,10228,10232,10236,10240,10244,10248],{"type":412,"tag":620,"props":10209,"children":10210},{"style":841},[10211],{"type":418,"value":844},{"type":412,"tag":620,"props":10213,"children":10214},{"style":847},[10215],{"type":418,"value":850},{"type":412,"tag":620,"props":10217,"children":10218},{"style":853},[10219],{"type":418,"value":1272},{"type":412,"tag":620,"props":10221,"children":10222},{"style":847},[10223],{"type":418,"value":1142},{"type":412,"tag":620,"props":10225,"children":10226},{"style":853},[10227],{"type":418,"value":1137},{"type":412,"tag":620,"props":10229,"children":10230},{"style":847},[10231],{"type":418,"value":861},{"type":412,"tag":620,"props":10233,"children":10234},{"style":841},[10235],{"type":418,"value":866},{"type":412,"tag":620,"props":10237,"children":10238},{"style":847},[10239],{"type":418,"value":871},{"type":412,"tag":620,"props":10241,"children":10242},{"style":633},[10243],{"type":418,"value":4},{"type":412,"tag":620,"props":10245,"children":10246},{"style":847},[10247],{"type":418,"value":881},{"type":412,"tag":620,"props":10249,"children":10250},{"style":847},[10251],{"type":418,"value":886},{"type":412,"tag":620,"props":10253,"children":10254},{"class":622,"line":669},[10255],{"type":412,"tag":620,"props":10256,"children":10257},{"emptyLinePlaceholder":892},[10258],{"type":418,"value":895},{"type":412,"tag":620,"props":10260,"children":10261},{"class":622,"line":684},[10262,10266,10270,10274,10279,10283,10288,10292,10296,10300],{"type":412,"tag":620,"props":10263,"children":10264},{"style":841},[10265],{"type":418,"value":927},{"type":412,"tag":620,"props":10267,"children":10268},{"style":901},[10269],{"type":418,"value":2130},{"type":412,"tag":620,"props":10271,"children":10272},{"style":901},[10273],{"type":418,"value":2135},{"type":412,"tag":620,"props":10275,"children":10276},{"style":673},[10277],{"type":418,"value":10278}," upgradeSaga",{"type":412,"tag":620,"props":10280,"children":10281},{"style":847},[10282],{"type":418,"value":2145},{"type":412,"tag":620,"props":10284,"children":10285},{"style":2148},[10286],{"type":418,"value":10287},"userId",{"type":412,"tag":620,"props":10289,"children":10290},{"style":847},[10291],{"type":418,"value":826},{"type":412,"tag":620,"props":10293,"children":10294},{"style":627},[10295],{"type":418,"value":1996},{"type":412,"tag":620,"props":10297,"children":10298},{"style":847},[10299],{"type":418,"value":1868},{"type":412,"tag":620,"props":10301,"children":10302},{"style":847},[10303],{"type":418,"value":2195},{"type":412,"tag":620,"props":10305,"children":10306},{"class":622,"line":407},[10307,10311,10315,10319],{"type":412,"tag":620,"props":10308,"children":10309},{"style":847},[10310],{"type":418,"value":2203},{"type":412,"tag":620,"props":10312,"children":10313},{"style":633},[10314],{"type":418,"value":89},{"type":412,"tag":620,"props":10316,"children":10317},{"style":847},[10318],{"type":418,"value":881},{"type":412,"tag":620,"props":10320,"children":10321},{"style":847},[10322],{"type":418,"value":886},{"type":412,"tag":620,"props":10324,"children":10325},{"class":622,"line":2004},[10326],{"type":412,"tag":620,"props":10327,"children":10328},{"emptyLinePlaceholder":892},[10329],{"type":418,"value":895},{"type":412,"tag":620,"props":10331,"children":10332},{"class":622,"line":2057},[10333,10337,10342,10346,10350,10354],{"type":412,"tag":620,"props":10334,"children":10335},{"style":841},[10336],{"type":418,"value":6708},{"type":412,"tag":620,"props":10338,"children":10339},{"style":673},[10340],{"type":418,"value":10341}," reserveSeats",{"type":412,"tag":620,"props":10343,"children":10344},{"style":1958},[10345],{"type":418,"value":2145},{"type":412,"tag":620,"props":10347,"children":10348},{"style":853},[10349],{"type":418,"value":10287},{"type":412,"tag":620,"props":10351,"children":10352},{"style":1958},[10353],{"type":418,"value":1868},{"type":412,"tag":620,"props":10355,"children":10356},{"style":847},[10357],{"type":418,"value":886},{"type":412,"tag":620,"props":10359,"children":10360},{"class":622,"line":2112},[10361],{"type":412,"tag":620,"props":10362,"children":10363},{"emptyLinePlaceholder":892},[10364],{"type":418,"value":895},{"type":412,"tag":620,"props":10366,"children":10367},{"class":622,"line":2120},[10368,10372],{"type":412,"tag":620,"props":10369,"children":10370},{"style":841},[10371],{"type":418,"value":2501},{"type":412,"tag":620,"props":10373,"children":10374},{"style":847},[10375],{"type":418,"value":2195},{"type":412,"tag":620,"props":10377,"children":10378},{"class":622,"line":33},[10379,10383,10388,10392,10396,10400],{"type":412,"tag":620,"props":10380,"children":10381},{"style":841},[10382],{"type":418,"value":2514},{"type":412,"tag":620,"props":10384,"children":10385},{"style":673},[10386],{"type":418,"value":10387}," chargePayment",{"type":412,"tag":620,"props":10389,"children":10390},{"style":1958},[10391],{"type":418,"value":2145},{"type":412,"tag":620,"props":10393,"children":10394},{"style":853},[10395],{"type":418,"value":10287},{"type":412,"tag":620,"props":10397,"children":10398},{"style":1958},[10399],{"type":418,"value":1868},{"type":412,"tag":620,"props":10401,"children":10402},{"style":847},[10403],{"type":418,"value":886},{"type":412,"tag":620,"props":10405,"children":10406},{"class":622,"line":2218},[10407,10411,10415],{"type":412,"tag":620,"props":10408,"children":10409},{"style":847},[10410],{"type":418,"value":2754},{"type":412,"tag":620,"props":10412,"children":10413},{"style":841},[10414],{"type":418,"value":3996},{"type":412,"tag":620,"props":10416,"children":10417},{"style":847},[10418],{"type":418,"value":2195},{"type":412,"tag":620,"props":10420,"children":10421},{"class":622,"line":2226},[10422,10426,10431,10435,10439,10443,10447],{"type":412,"tag":620,"props":10423,"children":10424},{"style":841},[10425],{"type":418,"value":2514},{"type":412,"tag":620,"props":10427,"children":10428},{"style":673},[10429],{"type":418,"value":10430}," releaseSeats",{"type":412,"tag":620,"props":10432,"children":10433},{"style":1958},[10434],{"type":418,"value":2145},{"type":412,"tag":620,"props":10436,"children":10437},{"style":853},[10438],{"type":418,"value":10287},{"type":412,"tag":620,"props":10440,"children":10441},{"style":1958},[10442],{"type":418,"value":1868},{"type":412,"tag":620,"props":10444,"children":10445},{"style":847},[10446],{"type":418,"value":1982},{"type":412,"tag":620,"props":10448,"children":10449},{"style":1005},[10450],{"type":418,"value":10451},"  \u002F\u002F Compensate\n",{"type":412,"tag":620,"props":10453,"children":10454},{"class":622,"line":2271},[10455,10459,10463,10467,10471,10475,10480,10484,10488],{"type":412,"tag":620,"props":10456,"children":10457},{"style":841},[10458],{"type":418,"value":8414},{"type":412,"tag":620,"props":10460,"children":10461},{"style":847},[10462],{"type":418,"value":4252},{"type":412,"tag":620,"props":10464,"children":10465},{"style":673},[10466],{"type":418,"value":1272},{"type":412,"tag":620,"props":10468,"children":10469},{"style":1958},[10470],{"type":418,"value":2145},{"type":412,"tag":620,"props":10472,"children":10473},{"style":847},[10474],{"type":418,"value":881},{"type":412,"tag":620,"props":10476,"children":10477},{"style":633},[10478],{"type":418,"value":10479},"Payment failed",{"type":412,"tag":620,"props":10481,"children":10482},{"style":847},[10483],{"type":418,"value":881},{"type":412,"tag":620,"props":10485,"children":10486},{"style":1958},[10487],{"type":418,"value":1868},{"type":412,"tag":620,"props":10489,"children":10490},{"style":847},[10491],{"type":418,"value":886},{"type":412,"tag":620,"props":10493,"children":10494},{"class":622,"line":2313},[10495],{"type":412,"tag":620,"props":10496,"children":10497},{"style":847},[10498],{"type":418,"value":2798},{"type":412,"tag":620,"props":10500,"children":10501},{"class":622,"line":2321},[10502],{"type":412,"tag":620,"props":10503,"children":10504},{"emptyLinePlaceholder":892},[10505],{"type":418,"value":895},{"type":412,"tag":620,"props":10507,"children":10508},{"class":622,"line":2342},[10509,10513,10518,10522,10526,10530],{"type":412,"tag":620,"props":10510,"children":10511},{"style":841},[10512],{"type":418,"value":6708},{"type":412,"tag":620,"props":10514,"children":10515},{"style":673},[10516],{"type":418,"value":10517}," activatePlan",{"type":412,"tag":620,"props":10519,"children":10520},{"style":1958},[10521],{"type":418,"value":2145},{"type":412,"tag":620,"props":10523,"children":10524},{"style":853},[10525],{"type":418,"value":10287},{"type":412,"tag":620,"props":10527,"children":10528},{"style":1958},[10529],{"type":418,"value":1868},{"type":412,"tag":620,"props":10531,"children":10532},{"style":847},[10533],{"type":418,"value":886},{"type":412,"tag":620,"props":10535,"children":10536},{"class":622,"line":2351},[10537],{"type":412,"tag":620,"props":10538,"children":10539},{"style":847},[10540],{"type":418,"value":2348},{"type":412,"tag":513,"props":10542,"children":10544},{"id":10543},"debugging",[10545],{"type":418,"value":10546},"Debugging",{"type":412,"tag":609,"props":10548,"children":10550},{"className":611,"code":10549,"language":613,"meta":614,"style":614},"npx workflow health                    # Check endpoints\nnpx workflow web                       # Visual dashboard\nnpx workflow inspect runs              # List all runs\nnpx workflow inspect run \u003Crun_id>      # Inspect specific run\nnpx workflow cancel \u003Crun_id>           # Cancel execution\n",[10551],{"type":412,"tag":460,"props":10552,"children":10553},{"__ignoreMap":614},[10554,10576,10597,10623,10665],{"type":412,"tag":620,"props":10555,"children":10556},{"class":622,"line":623},[10557,10561,10566,10571],{"type":412,"tag":620,"props":10558,"children":10559},{"style":627},[10560],{"type":418,"value":630},{"type":412,"tag":620,"props":10562,"children":10563},{"style":633},[10564],{"type":418,"value":10565}," workflow",{"type":412,"tag":620,"props":10567,"children":10568},{"style":633},[10569],{"type":418,"value":10570}," health",{"type":412,"tag":620,"props":10572,"children":10573},{"style":1005},[10574],{"type":418,"value":10575},"                    # Check endpoints\n",{"type":412,"tag":620,"props":10577,"children":10578},{"class":622,"line":669},[10579,10583,10587,10592],{"type":412,"tag":620,"props":10580,"children":10581},{"style":627},[10582],{"type":418,"value":630},{"type":412,"tag":620,"props":10584,"children":10585},{"style":633},[10586],{"type":418,"value":10565},{"type":412,"tag":620,"props":10588,"children":10589},{"style":633},[10590],{"type":418,"value":10591}," web",{"type":412,"tag":620,"props":10593,"children":10594},{"style":1005},[10595],{"type":418,"value":10596},"                       # Visual dashboard\n",{"type":412,"tag":620,"props":10598,"children":10599},{"class":622,"line":684},[10600,10604,10608,10613,10618],{"type":412,"tag":620,"props":10601,"children":10602},{"style":627},[10603],{"type":418,"value":630},{"type":412,"tag":620,"props":10605,"children":10606},{"style":633},[10607],{"type":418,"value":10565},{"type":412,"tag":620,"props":10609,"children":10610},{"style":633},[10611],{"type":418,"value":10612}," inspect",{"type":412,"tag":620,"props":10614,"children":10615},{"style":633},[10616],{"type":418,"value":10617}," runs",{"type":412,"tag":620,"props":10619,"children":10620},{"style":1005},[10621],{"type":418,"value":10622},"              # List all runs\n",{"type":412,"tag":620,"props":10624,"children":10625},{"class":622,"line":407},[10626,10630,10634,10638,10642,10646,10651,10656,10660],{"type":412,"tag":620,"props":10627,"children":10628},{"style":627},[10629],{"type":418,"value":630},{"type":412,"tag":620,"props":10631,"children":10632},{"style":633},[10633],{"type":418,"value":10565},{"type":412,"tag":620,"props":10635,"children":10636},{"style":633},[10637],{"type":418,"value":10612},{"type":412,"tag":620,"props":10639,"children":10640},{"style":633},[10641],{"type":418,"value":3482},{"type":412,"tag":620,"props":10643,"children":10644},{"style":847},[10645],{"type":418,"value":6200},{"type":412,"tag":620,"props":10647,"children":10648},{"style":633},[10649],{"type":418,"value":10650},"run_i",{"type":412,"tag":620,"props":10652,"children":10653},{"style":853},[10654],{"type":418,"value":10655},"d",{"type":412,"tag":620,"props":10657,"children":10658},{"style":847},[10659],{"type":418,"value":2412},{"type":412,"tag":620,"props":10661,"children":10662},{"style":1005},[10663],{"type":418,"value":10664},"      # Inspect specific run\n",{"type":412,"tag":620,"props":10666,"children":10667},{"class":622,"line":2004},[10668,10672,10676,10681,10685,10689,10693,10697],{"type":412,"tag":620,"props":10669,"children":10670},{"style":627},[10671],{"type":418,"value":630},{"type":412,"tag":620,"props":10673,"children":10674},{"style":633},[10675],{"type":418,"value":10565},{"type":412,"tag":620,"props":10677,"children":10678},{"style":633},[10679],{"type":418,"value":10680}," cancel",{"type":412,"tag":620,"props":10682,"children":10683},{"style":847},[10684],{"type":418,"value":6200},{"type":412,"tag":620,"props":10686,"children":10687},{"style":633},[10688],{"type":418,"value":10650},{"type":412,"tag":620,"props":10690,"children":10691},{"style":853},[10692],{"type":418,"value":10655},{"type":412,"tag":620,"props":10694,"children":10695},{"style":847},[10696],{"type":418,"value":2412},{"type":412,"tag":620,"props":10698,"children":10699},{"style":1005},[10700],{"type":418,"value":10701},"           # Cancel execution\n",{"type":412,"tag":513,"props":10703,"children":10705},{"id":10704},"debug-stuck-workflow",[10706],{"type":418,"value":10707},"Debug Stuck Workflow",{"type":412,"tag":425,"props":10709,"children":10710},{},[10711],{"type":418,"value":10712},"When a workflow appears stuck, hanging, or not progressing, follow this escalation ladder:",{"type":412,"tag":800,"props":10714,"children":10716},{"id":10715},"_1-add-step-level-logging-required",[10717],{"type":418,"value":10718},"1. Add Step-Level Logging (Required)",{"type":412,"tag":425,"props":10720,"children":10721},{},[10722,10735],{"type":412,"tag":429,"props":10723,"children":10724},{},[10725,10727,10733],{"type":418,"value":10726},"Every step function MUST have ",{"type":412,"tag":460,"props":10728,"children":10730},{"className":10729},[],[10731],{"type":418,"value":10732},"console.log",{"type":418,"value":10734}," at entry and exit.",{"type":418,"value":10736}," This is the single most important debugging practice — without it, you cannot tell which step is hanging.",{"type":412,"tag":609,"props":10738,"children":10740},{"className":829,"code":10739,"language":831,"meta":614,"style":614},"async function processOrder(orderId: string): Promise\u003COrderResult> {\n  \"use step\";\n  console.log(`[processOrder] START orderId=${orderId} at=${new Date().toISOString()}`);\n  try {\n    const result = await doWork(orderId);\n    console.log(`[processOrder] DONE orderId=${orderId} result=${JSON.stringify(result)}`);\n    return result;\n  } catch (err) {\n    console.error(`[processOrder] FAIL orderId=${orderId} error=${err}`);\n    throw err;\n  }\n}\n",[10741],{"type":412,"tag":460,"props":10742,"children":10743},{"__ignoreMap":614},[10744,10801,10820,10907,10918,10957,11037,11052,11080,11145,11161,11168],{"type":412,"tag":620,"props":10745,"children":10746},{"class":622,"line":623},[10747,10751,10755,10760,10764,10768,10772,10776,10780,10784,10788,10793,10797],{"type":412,"tag":620,"props":10748,"children":10749},{"style":901},[10750],{"type":418,"value":2365},{"type":412,"tag":620,"props":10752,"children":10753},{"style":901},[10754],{"type":418,"value":2135},{"type":412,"tag":620,"props":10756,"children":10757},{"style":673},[10758],{"type":418,"value":10759}," processOrder",{"type":412,"tag":620,"props":10761,"children":10762},{"style":847},[10763],{"type":418,"value":2145},{"type":412,"tag":620,"props":10765,"children":10766},{"style":2148},[10767],{"type":418,"value":6530},{"type":412,"tag":620,"props":10769,"children":10770},{"style":847},[10771],{"type":418,"value":826},{"type":412,"tag":620,"props":10773,"children":10774},{"style":627},[10775],{"type":418,"value":1996},{"type":412,"tag":620,"props":10777,"children":10778},{"style":847},[10779],{"type":418,"value":1114},{"type":412,"tag":620,"props":10781,"children":10782},{"style":627},[10783],{"type":418,"value":2168},{"type":412,"tag":620,"props":10785,"children":10786},{"style":847},[10787],{"type":418,"value":2402},{"type":412,"tag":620,"props":10789,"children":10790},{"style":627},[10791],{"type":418,"value":10792},"OrderResult",{"type":412,"tag":620,"props":10794,"children":10795},{"style":847},[10796],{"type":418,"value":2412},{"type":412,"tag":620,"props":10798,"children":10799},{"style":847},[10800],{"type":418,"value":2195},{"type":412,"tag":620,"props":10802,"children":10803},{"class":622,"line":669},[10804,10808,10812,10816],{"type":412,"tag":620,"props":10805,"children":10806},{"style":847},[10807],{"type":418,"value":2203},{"type":412,"tag":620,"props":10809,"children":10810},{"style":633},[10811],{"type":418,"value":90},{"type":412,"tag":620,"props":10813,"children":10814},{"style":847},[10815],{"type":418,"value":881},{"type":412,"tag":620,"props":10817,"children":10818},{"style":847},[10819],{"type":418,"value":886},{"type":412,"tag":620,"props":10821,"children":10822},{"class":622,"line":684},[10823,10827,10831,10835,10839,10843,10848,10852,10856,10860,10865,10869,10874,10879,10883,10887,10891,10895,10899,10903],{"type":412,"tag":620,"props":10824,"children":10825},{"style":853},[10826],{"type":418,"value":8797},{"type":412,"tag":620,"props":10828,"children":10829},{"style":847},[10830],{"type":418,"value":1090},{"type":412,"tag":620,"props":10832,"children":10833},{"style":673},[10834],{"type":418,"value":8806},{"type":412,"tag":620,"props":10836,"children":10837},{"style":1958},[10838],{"type":418,"value":2145},{"type":412,"tag":620,"props":10840,"children":10841},{"style":847},[10842],{"type":418,"value":4133},{"type":412,"tag":620,"props":10844,"children":10845},{"style":633},[10846],{"type":418,"value":10847},"[processOrder] START orderId=",{"type":412,"tag":620,"props":10849,"children":10850},{"style":847},[10851],{"type":418,"value":4114},{"type":412,"tag":620,"props":10853,"children":10854},{"style":853},[10855],{"type":418,"value":6530},{"type":412,"tag":620,"props":10857,"children":10858},{"style":847},[10859],{"type":418,"value":4123},{"type":412,"tag":620,"props":10861,"children":10862},{"style":633},[10863],{"type":418,"value":10864}," at=",{"type":412,"tag":620,"props":10866,"children":10867},{"style":847},[10868],{"type":418,"value":4114},{"type":412,"tag":620,"props":10870,"children":10871},{"style":847},[10872],{"type":418,"value":10873},"new",{"type":412,"tag":620,"props":10875,"children":10876},{"style":673},[10877],{"type":418,"value":10878}," Date",{"type":412,"tag":620,"props":10880,"children":10881},{"style":853},[10882],{"type":418,"value":2475},{"type":412,"tag":620,"props":10884,"children":10885},{"style":847},[10886],{"type":418,"value":1090},{"type":412,"tag":620,"props":10888,"children":10889},{"style":673},[10890],{"type":418,"value":5629},{"type":412,"tag":620,"props":10892,"children":10893},{"style":853},[10894],{"type":418,"value":2475},{"type":412,"tag":620,"props":10896,"children":10897},{"style":847},[10898],{"type":418,"value":6673},{"type":412,"tag":620,"props":10900,"children":10901},{"style":1958},[10902],{"type":418,"value":1868},{"type":412,"tag":620,"props":10904,"children":10905},{"style":847},[10906],{"type":418,"value":886},{"type":412,"tag":620,"props":10908,"children":10909},{"class":622,"line":407},[10910,10914],{"type":412,"tag":620,"props":10911,"children":10912},{"style":841},[10913],{"type":418,"value":2501},{"type":412,"tag":620,"props":10915,"children":10916},{"style":847},[10917],{"type":418,"value":2195},{"type":412,"tag":620,"props":10919,"children":10920},{"class":622,"line":2004},[10921,10925,10929,10933,10937,10941,10945,10949,10953],{"type":412,"tag":620,"props":10922,"children":10923},{"style":901},[10924],{"type":418,"value":2611},{"type":412,"tag":620,"props":10926,"children":10927},{"style":853},[10928],{"type":418,"value":2096},{"type":412,"tag":620,"props":10930,"children":10931},{"style":847},[10932],{"type":418,"value":2242},{"type":412,"tag":620,"props":10934,"children":10935},{"style":841},[10936],{"type":418,"value":2247},{"type":412,"tag":620,"props":10938,"children":10939},{"style":673},[10940],{"type":418,"value":2628},{"type":412,"tag":620,"props":10942,"children":10943},{"style":1958},[10944],{"type":418,"value":2145},{"type":412,"tag":620,"props":10946,"children":10947},{"style":853},[10948],{"type":418,"value":6530},{"type":412,"tag":620,"props":10950,"children":10951},{"style":1958},[10952],{"type":418,"value":1868},{"type":412,"tag":620,"props":10954,"children":10955},{"style":847},[10956],{"type":418,"value":886},{"type":412,"tag":620,"props":10958,"children":10959},{"class":622,"line":2057},[10960,10965,10969,10973,10977,10981,10986,10990,10994,10998,11003,11007,11012,11016,11020,11025,11029,11033],{"type":412,"tag":620,"props":10961,"children":10962},{"style":853},[10963],{"type":418,"value":10964},"    console",{"type":412,"tag":620,"props":10966,"children":10967},{"style":847},[10968],{"type":418,"value":1090},{"type":412,"tag":620,"props":10970,"children":10971},{"style":673},[10972],{"type":418,"value":8806},{"type":412,"tag":620,"props":10974,"children":10975},{"style":1958},[10976],{"type":418,"value":2145},{"type":412,"tag":620,"props":10978,"children":10979},{"style":847},[10980],{"type":418,"value":4133},{"type":412,"tag":620,"props":10982,"children":10983},{"style":633},[10984],{"type":418,"value":10985},"[processOrder] DONE orderId=",{"type":412,"tag":620,"props":10987,"children":10988},{"style":847},[10989],{"type":418,"value":4114},{"type":412,"tag":620,"props":10991,"children":10992},{"style":853},[10993],{"type":418,"value":6530},{"type":412,"tag":620,"props":10995,"children":10996},{"style":847},[10997],{"type":418,"value":4123},{"type":412,"tag":620,"props":10999,"children":11000},{"style":633},[11001],{"type":418,"value":11002}," result=",{"type":412,"tag":620,"props":11004,"children":11005},{"style":847},[11006],{"type":418,"value":4114},{"type":412,"tag":620,"props":11008,"children":11009},{"style":853},[11010],{"type":418,"value":11011},"JSON",{"type":412,"tag":620,"props":11013,"children":11014},{"style":847},[11015],{"type":418,"value":1090},{"type":412,"tag":620,"props":11017,"children":11018},{"style":673},[11019],{"type":418,"value":4454},{"type":412,"tag":620,"props":11021,"children":11022},{"style":853},[11023],{"type":418,"value":11024},"(result)",{"type":412,"tag":620,"props":11026,"children":11027},{"style":847},[11028],{"type":418,"value":6673},{"type":412,"tag":620,"props":11030,"children":11031},{"style":1958},[11032],{"type":418,"value":1868},{"type":412,"tag":620,"props":11034,"children":11035},{"style":847},[11036],{"type":418,"value":886},{"type":412,"tag":620,"props":11038,"children":11039},{"class":622,"line":2112},[11040,11044,11048],{"type":412,"tag":620,"props":11041,"children":11042},{"style":841},[11043],{"type":418,"value":2737},{"type":412,"tag":620,"props":11045,"children":11046},{"style":853},[11047],{"type":418,"value":2096},{"type":412,"tag":620,"props":11049,"children":11050},{"style":847},[11051],{"type":418,"value":886},{"type":412,"tag":620,"props":11053,"children":11054},{"class":622,"line":2120},[11055,11059,11063,11067,11072,11076],{"type":412,"tag":620,"props":11056,"children":11057},{"style":847},[11058],{"type":418,"value":2754},{"type":412,"tag":620,"props":11060,"children":11061},{"style":841},[11062],{"type":418,"value":3996},{"type":412,"tag":620,"props":11064,"children":11065},{"style":1958},[11066],{"type":418,"value":4286},{"type":412,"tag":620,"props":11068,"children":11069},{"style":853},[11070],{"type":418,"value":11071},"err",{"type":412,"tag":620,"props":11073,"children":11074},{"style":1958},[11075],{"type":418,"value":7073},{"type":412,"tag":620,"props":11077,"children":11078},{"style":847},[11079],{"type":418,"value":4349},{"type":412,"tag":620,"props":11081,"children":11082},{"class":622,"line":33},[11083,11087,11091,11095,11099,11103,11108,11112,11116,11120,11125,11129,11133,11137,11141],{"type":412,"tag":620,"props":11084,"children":11085},{"style":853},[11086],{"type":418,"value":10964},{"type":412,"tag":620,"props":11088,"children":11089},{"style":847},[11090],{"type":418,"value":1090},{"type":412,"tag":620,"props":11092,"children":11093},{"style":673},[11094],{"type":418,"value":264},{"type":412,"tag":620,"props":11096,"children":11097},{"style":1958},[11098],{"type":418,"value":2145},{"type":412,"tag":620,"props":11100,"children":11101},{"style":847},[11102],{"type":418,"value":4133},{"type":412,"tag":620,"props":11104,"children":11105},{"style":633},[11106],{"type":418,"value":11107},"[processOrder] FAIL orderId=",{"type":412,"tag":620,"props":11109,"children":11110},{"style":847},[11111],{"type":418,"value":4114},{"type":412,"tag":620,"props":11113,"children":11114},{"style":853},[11115],{"type":418,"value":6530},{"type":412,"tag":620,"props":11117,"children":11118},{"style":847},[11119],{"type":418,"value":4123},{"type":412,"tag":620,"props":11121,"children":11122},{"style":633},[11123],{"type":418,"value":11124}," error=",{"type":412,"tag":620,"props":11126,"children":11127},{"style":847},[11128],{"type":418,"value":4114},{"type":412,"tag":620,"props":11130,"children":11131},{"style":853},[11132],{"type":418,"value":11071},{"type":412,"tag":620,"props":11134,"children":11135},{"style":847},[11136],{"type":418,"value":6673},{"type":412,"tag":620,"props":11138,"children":11139},{"style":1958},[11140],{"type":418,"value":1868},{"type":412,"tag":620,"props":11142,"children":11143},{"style":847},[11144],{"type":418,"value":886},{"type":412,"tag":620,"props":11146,"children":11147},{"class":622,"line":2218},[11148,11152,11157],{"type":412,"tag":620,"props":11149,"children":11150},{"style":841},[11151],{"type":418,"value":8414},{"type":412,"tag":620,"props":11153,"children":11154},{"style":853},[11155],{"type":418,"value":11156}," err",{"type":412,"tag":620,"props":11158,"children":11159},{"style":847},[11160],{"type":418,"value":886},{"type":412,"tag":620,"props":11162,"children":11163},{"class":622,"line":2226},[11164],{"type":412,"tag":620,"props":11165,"children":11166},{"style":847},[11167],{"type":418,"value":2798},{"type":412,"tag":620,"props":11169,"children":11170},{"class":622,"line":2271},[11171],{"type":412,"tag":620,"props":11172,"children":11173},{"style":847},[11174],{"type":418,"value":2348},{"type":412,"tag":425,"props":11176,"children":11177},{},[11178,11183],{"type":412,"tag":429,"props":11179,"children":11180},{},[11181],{"type":418,"value":11182},"Workflow-level logging",{"type":418,"value":11184}," — log at every orchestration point:",{"type":412,"tag":609,"props":11186,"children":11188},{"className":829,"code":11187,"language":831,"meta":614,"style":614},"export async function myWorkflow(input: string) {\n  \"use workflow\";\n  console.log(`[myWorkflow] START input=${input}`);\n\n  const data = await stepOne(input);\n  console.log(`[myWorkflow] stepOne complete, starting stepTwo`);\n\n  const result = await stepTwo(data);\n  console.log(`[myWorkflow] stepTwo complete, returning`);\n\n  return { result };\n}\n",[11189],{"type":412,"tag":460,"props":11190,"children":11191},{"__ignoreMap":614},[11192,11235,11254,11302,11309,11348,11388,11395,11434,11474,11481,11500],{"type":412,"tag":620,"props":11193,"children":11194},{"class":622,"line":623},[11195,11199,11203,11207,11211,11215,11219,11223,11227,11231],{"type":412,"tag":620,"props":11196,"children":11197},{"style":841},[11198],{"type":418,"value":927},{"type":412,"tag":620,"props":11200,"children":11201},{"style":901},[11202],{"type":418,"value":2130},{"type":412,"tag":620,"props":11204,"children":11205},{"style":901},[11206],{"type":418,"value":2135},{"type":412,"tag":620,"props":11208,"children":11209},{"style":673},[11210],{"type":418,"value":2140},{"type":412,"tag":620,"props":11212,"children":11213},{"style":847},[11214],{"type":418,"value":2145},{"type":412,"tag":620,"props":11216,"children":11217},{"style":2148},[11218],{"type":418,"value":2151},{"type":412,"tag":620,"props":11220,"children":11221},{"style":847},[11222],{"type":418,"value":826},{"type":412,"tag":620,"props":11224,"children":11225},{"style":627},[11226],{"type":418,"value":1996},{"type":412,"tag":620,"props":11228,"children":11229},{"style":847},[11230],{"type":418,"value":1868},{"type":412,"tag":620,"props":11232,"children":11233},{"style":847},[11234],{"type":418,"value":2195},{"type":412,"tag":620,"props":11236,"children":11237},{"class":622,"line":669},[11238,11242,11246,11250],{"type":412,"tag":620,"props":11239,"children":11240},{"style":847},[11241],{"type":418,"value":2203},{"type":412,"tag":620,"props":11243,"children":11244},{"style":633},[11245],{"type":418,"value":89},{"type":412,"tag":620,"props":11247,"children":11248},{"style":847},[11249],{"type":418,"value":881},{"type":412,"tag":620,"props":11251,"children":11252},{"style":847},[11253],{"type":418,"value":886},{"type":412,"tag":620,"props":11255,"children":11256},{"class":622,"line":684},[11257,11261,11265,11269,11273,11277,11282,11286,11290,11294,11298],{"type":412,"tag":620,"props":11258,"children":11259},{"style":853},[11260],{"type":418,"value":8797},{"type":412,"tag":620,"props":11262,"children":11263},{"style":847},[11264],{"type":418,"value":1090},{"type":412,"tag":620,"props":11266,"children":11267},{"style":673},[11268],{"type":418,"value":8806},{"type":412,"tag":620,"props":11270,"children":11271},{"style":1958},[11272],{"type":418,"value":2145},{"type":412,"tag":620,"props":11274,"children":11275},{"style":847},[11276],{"type":418,"value":4133},{"type":412,"tag":620,"props":11278,"children":11279},{"style":633},[11280],{"type":418,"value":11281},"[myWorkflow] START input=",{"type":412,"tag":620,"props":11283,"children":11284},{"style":847},[11285],{"type":418,"value":4114},{"type":412,"tag":620,"props":11287,"children":11288},{"style":853},[11289],{"type":418,"value":2151},{"type":412,"tag":620,"props":11291,"children":11292},{"style":847},[11293],{"type":418,"value":6673},{"type":412,"tag":620,"props":11295,"children":11296},{"style":1958},[11297],{"type":418,"value":1868},{"type":412,"tag":620,"props":11299,"children":11300},{"style":847},[11301],{"type":418,"value":886},{"type":412,"tag":620,"props":11303,"children":11304},{"class":622,"line":407},[11305],{"type":412,"tag":620,"props":11306,"children":11307},{"emptyLinePlaceholder":892},[11308],{"type":418,"value":895},{"type":412,"tag":620,"props":11310,"children":11311},{"class":622,"line":2004},[11312,11316,11320,11324,11328,11332,11336,11340,11344],{"type":412,"tag":620,"props":11313,"children":11314},{"style":901},[11315],{"type":418,"value":2232},{"type":412,"tag":620,"props":11317,"children":11318},{"style":853},[11319],{"type":418,"value":2237},{"type":412,"tag":620,"props":11321,"children":11322},{"style":847},[11323],{"type":418,"value":2242},{"type":412,"tag":620,"props":11325,"children":11326},{"style":841},[11327],{"type":418,"value":2247},{"type":412,"tag":620,"props":11329,"children":11330},{"style":673},[11331],{"type":418,"value":2252},{"type":412,"tag":620,"props":11333,"children":11334},{"style":1958},[11335],{"type":418,"value":2145},{"type":412,"tag":620,"props":11337,"children":11338},{"style":853},[11339],{"type":418,"value":2151},{"type":412,"tag":620,"props":11341,"children":11342},{"style":1958},[11343],{"type":418,"value":1868},{"type":412,"tag":620,"props":11345,"children":11346},{"style":847},[11347],{"type":418,"value":886},{"type":412,"tag":620,"props":11349,"children":11350},{"class":622,"line":2057},[11351,11355,11359,11363,11367,11371,11376,11380,11384],{"type":412,"tag":620,"props":11352,"children":11353},{"style":853},[11354],{"type":418,"value":8797},{"type":412,"tag":620,"props":11356,"children":11357},{"style":847},[11358],{"type":418,"value":1090},{"type":412,"tag":620,"props":11360,"children":11361},{"style":673},[11362],{"type":418,"value":8806},{"type":412,"tag":620,"props":11364,"children":11365},{"style":1958},[11366],{"type":418,"value":2145},{"type":412,"tag":620,"props":11368,"children":11369},{"style":847},[11370],{"type":418,"value":4133},{"type":412,"tag":620,"props":11372,"children":11373},{"style":633},[11374],{"type":418,"value":11375},"[myWorkflow] stepOne complete, starting stepTwo",{"type":412,"tag":620,"props":11377,"children":11378},{"style":847},[11379],{"type":418,"value":4133},{"type":412,"tag":620,"props":11381,"children":11382},{"style":1958},[11383],{"type":418,"value":1868},{"type":412,"tag":620,"props":11385,"children":11386},{"style":847},[11387],{"type":418,"value":886},{"type":412,"tag":620,"props":11389,"children":11390},{"class":622,"line":2112},[11391],{"type":412,"tag":620,"props":11392,"children":11393},{"emptyLinePlaceholder":892},[11394],{"type":418,"value":895},{"type":412,"tag":620,"props":11396,"children":11397},{"class":622,"line":2120},[11398,11402,11406,11410,11414,11418,11422,11426,11430],{"type":412,"tag":620,"props":11399,"children":11400},{"style":901},[11401],{"type":418,"value":2232},{"type":412,"tag":620,"props":11403,"children":11404},{"style":853},[11405],{"type":418,"value":2096},{"type":412,"tag":620,"props":11407,"children":11408},{"style":847},[11409],{"type":418,"value":2242},{"type":412,"tag":620,"props":11411,"children":11412},{"style":841},[11413],{"type":418,"value":2247},{"type":412,"tag":620,"props":11415,"children":11416},{"style":673},[11417],{"type":418,"value":2293},{"type":412,"tag":620,"props":11419,"children":11420},{"style":1958},[11421],{"type":418,"value":2145},{"type":412,"tag":620,"props":11423,"children":11424},{"style":853},[11425],{"type":418,"value":2302},{"type":412,"tag":620,"props":11427,"children":11428},{"style":1958},[11429],{"type":418,"value":1868},{"type":412,"tag":620,"props":11431,"children":11432},{"style":847},[11433],{"type":418,"value":886},{"type":412,"tag":620,"props":11435,"children":11436},{"class":622,"line":33},[11437,11441,11445,11449,11453,11457,11462,11466,11470],{"type":412,"tag":620,"props":11438,"children":11439},{"style":853},[11440],{"type":418,"value":8797},{"type":412,"tag":620,"props":11442,"children":11443},{"style":847},[11444],{"type":418,"value":1090},{"type":412,"tag":620,"props":11446,"children":11447},{"style":673},[11448],{"type":418,"value":8806},{"type":412,"tag":620,"props":11450,"children":11451},{"style":1958},[11452],{"type":418,"value":2145},{"type":412,"tag":620,"props":11454,"children":11455},{"style":847},[11456],{"type":418,"value":4133},{"type":412,"tag":620,"props":11458,"children":11459},{"style":633},[11460],{"type":418,"value":11461},"[myWorkflow] stepTwo complete, returning",{"type":412,"tag":620,"props":11463,"children":11464},{"style":847},[11465],{"type":418,"value":4133},{"type":412,"tag":620,"props":11467,"children":11468},{"style":1958},[11469],{"type":418,"value":1868},{"type":412,"tag":620,"props":11471,"children":11472},{"style":847},[11473],{"type":418,"value":886},{"type":412,"tag":620,"props":11475,"children":11476},{"class":622,"line":2218},[11477],{"type":412,"tag":620,"props":11478,"children":11479},{"emptyLinePlaceholder":892},[11480],{"type":418,"value":895},{"type":412,"tag":620,"props":11482,"children":11483},{"class":622,"line":2226},[11484,11488,11492,11496],{"type":412,"tag":620,"props":11485,"children":11486},{"style":841},[11487],{"type":418,"value":2327},{"type":412,"tag":620,"props":11489,"children":11490},{"style":847},[11491],{"type":418,"value":850},{"type":412,"tag":620,"props":11493,"children":11494},{"style":853},[11495],{"type":418,"value":2096},{"type":412,"tag":620,"props":11497,"children":11498},{"style":847},[11499],{"type":418,"value":2109},{"type":412,"tag":620,"props":11501,"children":11502},{"class":622,"line":2271},[11503],{"type":412,"tag":620,"props":11504,"children":11505},{"style":847},[11506],{"type":418,"value":2348},{"type":412,"tag":800,"props":11508,"children":11510},{"id":11509},"_2-check-run-status",[11511],{"type":418,"value":11512},"2. Check Run Status",{"type":412,"tag":609,"props":11514,"children":11516},{"className":611,"code":11515,"language":613,"meta":614,"style":614},"# List recent runs — look for \"running\" status that's been active too long\nnpx workflow inspect runs\n\n# Get detailed status for a specific run\nnpx workflow inspect run \u003Crun_id>\n\n# Check if the workflow endpoints are healthy\nnpx workflow health\n",[11517],{"type":412,"tag":460,"props":11518,"children":11519},{"__ignoreMap":614},[11520,11528,11548,11555,11563,11598,11605,11613],{"type":412,"tag":620,"props":11521,"children":11522},{"class":622,"line":623},[11523],{"type":412,"tag":620,"props":11524,"children":11525},{"style":1005},[11526],{"type":418,"value":11527},"# List recent runs — look for \"running\" status that's been active too long\n",{"type":412,"tag":620,"props":11529,"children":11530},{"class":622,"line":669},[11531,11535,11539,11543],{"type":412,"tag":620,"props":11532,"children":11533},{"style":627},[11534],{"type":418,"value":630},{"type":412,"tag":620,"props":11536,"children":11537},{"style":633},[11538],{"type":418,"value":10565},{"type":412,"tag":620,"props":11540,"children":11541},{"style":633},[11542],{"type":418,"value":10612},{"type":412,"tag":620,"props":11544,"children":11545},{"style":633},[11546],{"type":418,"value":11547}," runs\n",{"type":412,"tag":620,"props":11549,"children":11550},{"class":622,"line":684},[11551],{"type":412,"tag":620,"props":11552,"children":11553},{"emptyLinePlaceholder":892},[11554],{"type":418,"value":895},{"type":412,"tag":620,"props":11556,"children":11557},{"class":622,"line":407},[11558],{"type":412,"tag":620,"props":11559,"children":11560},{"style":1005},[11561],{"type":418,"value":11562},"# Get detailed status for a specific run\n",{"type":412,"tag":620,"props":11564,"children":11565},{"class":622,"line":2004},[11566,11570,11574,11578,11582,11586,11590,11594],{"type":412,"tag":620,"props":11567,"children":11568},{"style":627},[11569],{"type":418,"value":630},{"type":412,"tag":620,"props":11571,"children":11572},{"style":633},[11573],{"type":418,"value":10565},{"type":412,"tag":620,"props":11575,"children":11576},{"style":633},[11577],{"type":418,"value":10612},{"type":412,"tag":620,"props":11579,"children":11580},{"style":633},[11581],{"type":418,"value":3482},{"type":412,"tag":620,"props":11583,"children":11584},{"style":847},[11585],{"type":418,"value":6200},{"type":412,"tag":620,"props":11587,"children":11588},{"style":633},[11589],{"type":418,"value":10650},{"type":412,"tag":620,"props":11591,"children":11592},{"style":853},[11593],{"type":418,"value":10655},{"type":412,"tag":620,"props":11595,"children":11596},{"style":847},[11597],{"type":418,"value":6236},{"type":412,"tag":620,"props":11599,"children":11600},{"class":622,"line":2057},[11601],{"type":412,"tag":620,"props":11602,"children":11603},{"emptyLinePlaceholder":892},[11604],{"type":418,"value":895},{"type":412,"tag":620,"props":11606,"children":11607},{"class":622,"line":2112},[11608],{"type":412,"tag":620,"props":11609,"children":11610},{"style":1005},[11611],{"type":418,"value":11612},"# Check if the workflow endpoints are healthy\n",{"type":412,"tag":620,"props":11614,"children":11615},{"class":622,"line":2120},[11616,11620,11624],{"type":412,"tag":620,"props":11617,"children":11618},{"style":627},[11619],{"type":418,"value":630},{"type":412,"tag":620,"props":11621,"children":11622},{"style":633},[11623],{"type":418,"value":10565},{"type":412,"tag":620,"props":11625,"children":11626},{"style":633},[11627],{"type":418,"value":11628}," health\n",{"type":412,"tag":800,"props":11630,"children":11632},{"id":11631},"_3-check-vercel-runtime-logs",[11633],{"type":418,"value":11634},"3. Check Vercel Runtime Logs",{"type":412,"tag":609,"props":11636,"children":11638},{"className":611,"code":11637,"language":613,"meta":614,"style":614},"# Stream live logs from your deployment\nvercel logs --follow\n\n# Or check the Vercel dashboard: Project → Deployments → Functions tab\n",[11639],{"type":412,"tag":460,"props":11640,"children":11641},{"__ignoreMap":614},[11642,11650,11667,11674],{"type":412,"tag":620,"props":11643,"children":11644},{"class":622,"line":623},[11645],{"type":412,"tag":620,"props":11646,"children":11647},{"style":1005},[11648],{"type":418,"value":11649},"# Stream live logs from your deployment\n",{"type":412,"tag":620,"props":11651,"children":11652},{"class":622,"line":669},[11653,11657,11662],{"type":412,"tag":620,"props":11654,"children":11655},{"style":627},[11656],{"type":418,"value":14},{"type":412,"tag":620,"props":11658,"children":11659},{"style":633},[11660],{"type":418,"value":11661}," logs",{"type":412,"tag":620,"props":11663,"children":11664},{"style":633},[11665],{"type":418,"value":11666}," --follow\n",{"type":412,"tag":620,"props":11668,"children":11669},{"class":622,"line":684},[11670],{"type":412,"tag":620,"props":11671,"children":11672},{"emptyLinePlaceholder":892},[11673],{"type":418,"value":895},{"type":412,"tag":620,"props":11675,"children":11676},{"class":622,"line":407},[11677],{"type":412,"tag":620,"props":11678,"children":11679},{"style":1005},[11680],{"type":418,"value":11681},"# Or check the Vercel dashboard: Project → Deployments → Functions tab\n",{"type":412,"tag":425,"props":11683,"children":11684},{},[11685],{"type":418,"value":11686},"Look for:",{"type":412,"tag":11688,"props":11689,"children":11690},"ul",{},[11691,11702,11712,11734],{"type":412,"tag":11692,"props":11693,"children":11694},"li",{},[11695,11700],{"type":412,"tag":429,"props":11696,"children":11697},{},[11698],{"type":418,"value":11699},"Missing step entry logs",{"type":418,"value":11701}," — the step before the missing one is where execution stopped",{"type":412,"tag":11692,"props":11703,"children":11704},{},[11705,11710],{"type":412,"tag":429,"props":11706,"children":11707},{},[11708],{"type":418,"value":11709},"Timeout errors",{"type":418,"value":11711}," — Vercel function timeout (default 60s hobby, 300s pro)",{"type":412,"tag":11692,"props":11713,"children":11714},{},[11715,11720,11721,11726,11728],{"type":412,"tag":429,"props":11716,"children":11717},{},[11718],{"type":418,"value":11719},"OIDC\u002Fcredential errors",{"type":418,"value":1757},{"type":412,"tag":460,"props":11722,"children":11724},{"className":11723},[],[11725],{"type":418,"value":974},{"type":418,"value":11727}," calls fail silently without ",{"type":412,"tag":460,"props":11729,"children":11731},{"className":11730},[],[11732],{"type":418,"value":11733},"vercel env pull",{"type":412,"tag":11692,"props":11735,"children":11736},{},[11737,11742],{"type":412,"tag":429,"props":11738,"children":11739},{},[11740],{"type":418,"value":11741},"Memory errors",{"type":418,"value":11743}," — large payloads in steps can OOM the function",{"type":412,"tag":800,"props":11745,"children":11747},{"id":11746},"_4-common-stuck-scenarios",[11748],{"type":418,"value":11749},"4. Common Stuck Scenarios",{"type":412,"tag":8880,"props":11751,"children":11752},{},[11753,11774],{"type":412,"tag":8884,"props":11754,"children":11755},{},[11756],{"type":412,"tag":8888,"props":11757,"children":11758},{},[11759,11764,11769],{"type":412,"tag":8892,"props":11760,"children":11761},{},[11762],{"type":418,"value":11763},"Symptom",{"type":412,"tag":8892,"props":11765,"children":11766},{},[11767],{"type":418,"value":11768},"Likely Cause",{"type":412,"tag":8892,"props":11770,"children":11771},{},[11772],{"type":418,"value":11773},"Fix",{"type":412,"tag":8903,"props":11775,"children":11776},{},[11777,11807,11825,11864,11900,11923],{"type":412,"tag":8888,"props":11778,"children":11779},{},[11780,11785,11790],{"type":412,"tag":8910,"props":11781,"children":11782},{},[11783],{"type":418,"value":11784},"Run stays \"running\" forever",{"type":412,"tag":8910,"props":11786,"children":11787},{},[11788],{"type":418,"value":11789},"Step is awaiting an external call that never resolves",{"type":412,"tag":8910,"props":11791,"children":11792},{},[11793,11795,11800,11802],{"type":418,"value":11794},"Add timeout with ",{"type":412,"tag":460,"props":11796,"children":11798},{"className":11797},[],[11799],{"type":418,"value":1664},{"type":418,"value":11801}," + ",{"type":412,"tag":460,"props":11803,"children":11805},{"className":11804},[],[11806],{"type":418,"value":8971},{"type":412,"tag":8888,"props":11808,"children":11809},{},[11810,11815,11820],{"type":412,"tag":8910,"props":11811,"children":11812},{},[11813],{"type":418,"value":11814},"Hook never resumes",{"type":412,"tag":8910,"props":11816,"children":11817},{},[11818],{"type":418,"value":11819},"Missing resume API route or wrong token",{"type":412,"tag":8910,"props":11821,"children":11822},{},[11823],{"type":418,"value":11824},"Verify resume route exists and token matches",{"type":412,"tag":8888,"props":11826,"children":11827},{},[11828,11833,11846],{"type":412,"tag":8910,"props":11829,"children":11830},{},[11831],{"type":418,"value":11832},"Step retries endlessly",{"type":412,"tag":8910,"props":11834,"children":11835},{},[11836,11838,11844],{"type":418,"value":11837},"Throwing ",{"type":412,"tag":460,"props":11839,"children":11841},{"className":11840},[],[11842],{"type":418,"value":11843},"RetryableError",{"type":418,"value":11845}," without bounds",{"type":412,"tag":8910,"props":11847,"children":11848},{},[11849,11851,11857,11859],{"type":418,"value":11850},"Add ",{"type":412,"tag":460,"props":11852,"children":11854},{"className":11853},[],[11855],{"type":418,"value":11856},"FatalError",{"type":418,"value":11858}," after max retries via ",{"type":412,"tag":460,"props":11860,"children":11862},{"className":11861},[],[11863],{"type":418,"value":1064},{"type":412,"tag":8888,"props":11865,"children":11866},{},[11867,11872,11882],{"type":412,"tag":8910,"props":11868,"children":11869},{},[11870],{"type":418,"value":11871},"Workflow starts but no steps run",{"type":412,"tag":8910,"props":11873,"children":11874},{},[11875,11880],{"type":412,"tag":460,"props":11876,"children":11878},{"className":11877},[],[11879],{"type":418,"value":473},{"type":418,"value":11881}," called in workflow scope",{"type":412,"tag":8910,"props":11883,"children":11884},{},[11885,11887,11892,11894,11899],{"type":418,"value":11886},"Move ",{"type":412,"tag":460,"props":11888,"children":11890},{"className":11889},[],[11891],{"type":418,"value":473},{"type":418,"value":11893}," into a ",{"type":412,"tag":460,"props":11895,"children":11897},{"className":11896},[],[11898],{"type":418,"value":1641},{"type":418,"value":2135},{"type":412,"tag":8888,"props":11901,"children":11902},{},[11903,11908,11913],{"type":412,"tag":8910,"props":11904,"children":11905},{},[11906],{"type":418,"value":11907},"AI step hangs",{"type":412,"tag":8910,"props":11909,"children":11910},{},[11911],{"type":418,"value":11912},"Missing OIDC credentials for gateway",{"type":412,"tag":8910,"props":11914,"children":11915},{},[11916,11917],{"type":418,"value":750},{"type":412,"tag":460,"props":11918,"children":11920},{"className":11919},[],[11921],{"type":418,"value":11922},"vercel link && vercel env pull",{"type":412,"tag":8888,"props":11924,"children":11925},{},[11926,11931,11936],{"type":412,"tag":8910,"props":11927,"children":11928},{},[11929],{"type":418,"value":11930},"No logs appearing at all",{"type":412,"tag":8910,"props":11932,"children":11933},{},[11934],{"type":418,"value":11935},"Logging not added to steps",{"type":412,"tag":8910,"props":11937,"children":11938},{},[11939,11940,11945],{"type":418,"value":11850},{"type":412,"tag":460,"props":11941,"children":11943},{"className":11942},[],[11944],{"type":418,"value":10732},{"type":418,"value":11946}," at entry\u002Fexit of every step",{"type":412,"tag":800,"props":11948,"children":11950},{"id":11949},"_5-use-browser-verification",[11951],{"type":418,"value":11952},"5. Use Browser Verification",{"type":412,"tag":425,"props":11954,"children":11955},{},[11956,11958,11964],{"type":418,"value":11957},"If the workflow powers a UI, use ",{"type":412,"tag":460,"props":11959,"children":11961},{"className":11960},[],[11962],{"type":418,"value":11963},"agent-browser",{"type":418,"value":11965}," to check the frontend while inspecting backend logs — a hanging page often means a stuck workflow step. Check the browser console for failed fetch calls to your workflow API routes.",{"type":412,"tag":513,"props":11967,"children":11969},{"id":11968},"when-to-use-wdk-vs-regular-functions",[11970],{"type":418,"value":11971},"When to Use WDK vs Regular Functions",{"type":412,"tag":8880,"props":11973,"children":11974},{},[11975,11991],{"type":412,"tag":8884,"props":11976,"children":11977},{},[11978],{"type":412,"tag":8888,"props":11979,"children":11980},{},[11981,11986],{"type":412,"tag":8892,"props":11982,"children":11983},{},[11984],{"type":418,"value":11985},"Scenario",{"type":412,"tag":8892,"props":11987,"children":11988},{},[11989],{"type":418,"value":11990},"Use",{"type":412,"tag":8903,"props":11992,"children":11993},{},[11994,12007,12020,12033,12045,12057],{"type":412,"tag":8888,"props":11995,"children":11996},{},[11997,12002],{"type":412,"tag":8910,"props":11998,"children":11999},{},[12000],{"type":418,"value":12001},"Simple API endpoint, fast response",{"type":412,"tag":8910,"props":12003,"children":12004},{},[12005],{"type":418,"value":12006},"Regular Route Handler",{"type":412,"tag":8888,"props":12008,"children":12009},{},[12010,12015],{"type":412,"tag":8910,"props":12011,"children":12012},{},[12013],{"type":418,"value":12014},"Multi-step process, must complete all steps",{"type":412,"tag":8910,"props":12016,"children":12017},{},[12018],{"type":418,"value":12019},"WDK Workflow",{"type":412,"tag":8888,"props":12021,"children":12022},{},[12023,12028],{"type":412,"tag":8910,"props":12024,"children":12025},{},[12026],{"type":418,"value":12027},"AI agent in production, must not lose state",{"type":412,"tag":8910,"props":12029,"children":12030},{},[12031],{"type":418,"value":12032},"WDK DurableAgent",{"type":412,"tag":8888,"props":12034,"children":12035},{},[12036,12041],{"type":412,"tag":8910,"props":12037,"children":12038},{},[12039],{"type":418,"value":12040},"Background job that can take minutes\u002Fhours",{"type":412,"tag":8910,"props":12042,"children":12043},{},[12044],{"type":418,"value":12019},{"type":412,"tag":8888,"props":12046,"children":12047},{},[12048,12053],{"type":412,"tag":8910,"props":12049,"children":12050},{},[12051],{"type":418,"value":12052},"Process spanning multiple services",{"type":412,"tag":8910,"props":12054,"children":12055},{},[12056],{"type":418,"value":12019},{"type":412,"tag":8888,"props":12058,"children":12059},{},[12060,12065],{"type":412,"tag":8910,"props":12061,"children":12062},{},[12063],{"type":418,"value":12064},"Quick one-shot LLM call",{"type":412,"tag":8910,"props":12066,"children":12067},{},[12068],{"type":418,"value":12069},"AI SDK directly",{"type":412,"tag":513,"props":12071,"children":12073},{"id":12072},"framework-support",[12074],{"type":418,"value":12075},"Framework Support",{"type":412,"tag":425,"props":12077,"children":12078},{},[12079],{"type":418,"value":12080},"Next.js, Nitro, SvelteKit, Astro, Express, Hono (supported). TanStack Start, React Router (in development).",{"type":412,"tag":513,"props":12082,"children":12084},{"id":12083},"official-documentation",[12085],{"type":418,"value":12086},"Official Documentation",{"type":412,"tag":11688,"props":12088,"children":12089},{},[12090,12099,12108,12118],{"type":412,"tag":11692,"props":12091,"children":12092},{},[12093],{"type":412,"tag":444,"props":12094,"children":12096},{"href":35,"rel":12095},[447],[12097],{"type":418,"value":12098},"Workflow DevKit",{"type":412,"tag":11692,"props":12100,"children":12101},{},[12102],{"type":412,"tag":444,"props":12103,"children":12105},{"href":36,"rel":12104},[447],[12106],{"type":418,"value":12107},"Website",{"type":412,"tag":11692,"props":12109,"children":12110},{},[12111],{"type":412,"tag":444,"props":12112,"children":12115},{"href":12113,"rel":12114},"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fworkflow",[447],[12116],{"type":418,"value":12117},"GitHub",{"type":412,"tag":11692,"props":12119,"children":12120},{},[12121],{"type":412,"tag":444,"props":12122,"children":12125},{"href":12123,"rel":12124},"https:\u002F\u002Fvercel.com\u002Ftemplates\u002Fnext.js\u002Fworkflow-builder",[447],[12126],{"type":418,"value":12127},"Workflow Builder Template",{"type":412,"tag":12129,"props":12130,"children":12131},"style",{},[12132],{"type":418,"value":12133},"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);}",{"items":12135,"total":12340},[12136,12157,12180,12197,12213,12232,12251,12267,12283,12297,12309,12324],{"slug":12137,"name":12137,"fn":12138,"description":12139,"org":12140,"tags":12141,"stars":12154,"repoUrl":12155,"updatedAt":12156},"prior-auth-packet-builder","build healthcare prior authorization packets","Build a concise prior authorization packet from local case files and payer policy docs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12142,12145,12148,12151],{"name":12143,"slug":12144,"type":15},"Documents","documents",{"name":12146,"slug":12147,"type":15},"Healthcare","healthcare",{"name":12149,"slug":12150,"type":15},"Insurance","insurance",{"name":12152,"slug":12153,"type":15},"Regulatory Compliance","regulatory-compliance",28169,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-agents-python","2026-04-16T05:11:39.180399",{"slug":12158,"name":12158,"fn":12159,"description":12160,"org":12161,"tags":12162,"stars":12177,"repoUrl":12178,"updatedAt":12179},"aspnet-core","build ASP.NET Core web applications","Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12163,12166,12168,12171,12174],{"name":12164,"slug":12165,"type":15},".NET","dotnet",{"name":12167,"slug":12158,"type":15},"ASP.NET Core",{"name":12169,"slug":12170,"type":15},"Blazor","blazor",{"name":12172,"slug":12173,"type":15},"C#","csharp",{"name":12175,"slug":12176,"type":15},"Web Development","web-development",23787,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fskills","2026-04-12T05:07:02.819491",{"slug":12181,"name":12181,"fn":12182,"description":12183,"org":12184,"tags":12185,"stars":12177,"repoUrl":12178,"updatedAt":12196},"chatgpt-apps","build ChatGPT Apps SDK applications","Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12186,12189,12192,12195],{"name":12187,"slug":12188,"type":15},"Apps SDK","apps-sdk",{"name":12190,"slug":12191,"type":15},"ChatGPT","chatgpt",{"name":12193,"slug":12194,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},"2026-04-12T05:07:05.468097",{"slug":12198,"name":12198,"fn":12199,"description":12200,"org":12201,"tags":12202,"stars":12177,"repoUrl":12178,"updatedAt":12212},"cli-creator","build CLIs from API docs","Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read\u002Fwrite commands, return stable JSON, manage auth, and pair with a companion skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12203,12206,12209],{"name":12204,"slug":12205,"type":15},"API Development","api-development",{"name":12207,"slug":12208,"type":15},"CLI","cli",{"name":12210,"slug":12211,"type":15},"Codex","codex","2026-04-12T05:07:04.132762",{"slug":12214,"name":12214,"fn":12215,"description":12216,"org":12217,"tags":12218,"stars":12177,"repoUrl":12178,"updatedAt":12231},"cloudflare-deploy","deploy projects to Cloudflare","Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12219,12222,12225,12228],{"name":12220,"slug":12221,"type":15},"Cloudflare","cloudflare",{"name":12223,"slug":12224,"type":15},"Cloudflare Pages","cloudflare-pages",{"name":12226,"slug":12227,"type":15},"Cloudflare Workers","cloudflare-workers",{"name":12229,"slug":12230,"type":15},"Deployment","deployment","2026-04-12T05:07:14.275118",{"slug":12233,"name":12233,"fn":12234,"description":12235,"org":12236,"tags":12237,"stars":12177,"repoUrl":12178,"updatedAt":12250},"define-goal","define and set measurable project goals","Help the user define a concrete, measurable goal before starting work, especially when they ask to use the goal tool, create a goal, set an objective, clarify success criteria, or turn a fuzzy intention into a quantitative outcome. Use this skill for goal creation and goal refinement only; it does not manage durable snapshots, decision logs, or long-running execution artifacts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12238,12241,12244,12247],{"name":12239,"slug":12240,"type":15},"Productivity","productivity",{"name":12242,"slug":12243,"type":15},"Project Management","project-management",{"name":12245,"slug":12246,"type":15},"Strategy","strategy",{"name":12248,"slug":12249,"type":15},"Task Management","task-management","2026-05-23T06:17:16.870838",{"slug":12252,"name":12252,"fn":12253,"description":12254,"org":12255,"tags":12256,"stars":12177,"repoUrl":12178,"updatedAt":12266},"figma","translate Figma designs into code","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12257,12260,12262,12265],{"name":12258,"slug":12259,"type":15},"Design","design",{"name":12261,"slug":12252,"type":15},"Figma",{"name":12263,"slug":12264,"type":15},"Frontend","frontend",{"name":12193,"slug":12194,"type":15},"2026-04-12T05:06:47.939943",{"slug":12268,"name":12268,"fn":12269,"description":12270,"org":12271,"tags":12272,"stars":12177,"repoUrl":12178,"updatedAt":12282},"figma-code-connect-components","connect Figma designs to code components","Connects Figma design components to code components using Code Connect mapping tools. Use when user says \"code connect\", \"connect this component to code\", \"map this component\", \"link component to code\", \"create code connect mapping\", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12273,12274,12277,12278,12279],{"name":12258,"slug":12259,"type":15},{"name":12275,"slug":12276,"type":15},"Design System","design-system",{"name":12261,"slug":12252,"type":15},{"name":12263,"slug":12264,"type":15},{"name":12280,"slug":12281,"type":15},"UI Components","ui-components","2026-05-10T05:59:52.971881",{"slug":12284,"name":12284,"fn":12285,"description":12286,"org":12287,"tags":12288,"stars":12177,"repoUrl":12178,"updatedAt":12296},"figma-create-design-system-rules","generate design system rules from Figma","Generates custom design system rules for the user's codebase. Use when user says \"create design system rules\", \"generate rules for my project\", \"set up design rules\", \"customize design system guidelines\", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12289,12290,12291,12294,12295],{"name":12258,"slug":12259,"type":15},{"name":12275,"slug":12276,"type":15},{"name":12292,"slug":12293,"type":15},"Documentation","documentation",{"name":12261,"slug":12252,"type":15},{"name":12263,"slug":12264,"type":15},"2026-05-16T06:07:47.821474",{"slug":12298,"name":12298,"fn":12299,"description":12300,"org":12301,"tags":12302,"stars":12177,"repoUrl":12178,"updatedAt":12308},"figma-implement-design","translate Figma designs into application code","Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions \"implement design\", \"generate code\", \"implement component\", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12303,12304,12305,12306,12307],{"name":12258,"slug":12259,"type":15},{"name":12261,"slug":12252,"type":15},{"name":12263,"slug":12264,"type":15},{"name":12280,"slug":12281,"type":15},{"name":12175,"slug":12176,"type":15},"2026-05-16T06:07:40.583615",{"slug":12310,"name":12310,"fn":12311,"description":12312,"org":12313,"tags":12314,"stars":12177,"repoUrl":12178,"updatedAt":12323},"hatch-pet","create animated pets for Codex","Create, repair, validate, visually QA, and package Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual references. Use when a user wants a lightweight-worker Codex pet workflow, a non-pixel custom pet style, a prospect or company mascot pet, or a full 8x9 animated pet atlas with transparent unused cells, QA contact sheets, and pet.json packaging. This skill composes the installed $imagegen system skill for visual generation and uses bundled scripts for deterministic spritesheet assembly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12315,12318,12319,12322],{"name":12316,"slug":12317,"type":15},"Animation","animation",{"name":12210,"slug":12211,"type":15},{"name":12320,"slug":12321,"type":15},"Creative","creative",{"name":12258,"slug":12259,"type":15},"2026-05-02T05:31:48.48485",{"slug":12325,"name":12325,"fn":12326,"description":12327,"org":12328,"tags":12329,"stars":12177,"repoUrl":12178,"updatedAt":12339},"imagegen","generate and edit raster images","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12330,12331,12332,12335,12338],{"name":12320,"slug":12321,"type":15},{"name":12258,"slug":12259,"type":15},{"name":12333,"slug":12334,"type":15},"Image Generation","image-generation",{"name":12336,"slug":12337,"type":15},"Images","images",{"name":9,"slug":8,"type":15},"2026-05-15T06:23:24.312127",675,{"items":12342,"total":12453},[12343,12360,12375,12387,12405,12421,12441],{"slug":12344,"name":12344,"fn":12345,"description":12346,"org":12347,"tags":12348,"stars":19,"repoUrl":20,"updatedAt":12359},"accessibility-and-inclusive-visualization","make data visualizations accessible","Make data visualizations accessible and inclusive. Use when the user needs chart or diagram accessibility guidance, text alternatives for complex visuals, color and contrast review, keyboard support, reduced-motion behavior for animation or parallax, or an accessibility QA workflow for exported figures, UML-like diagrams, and dashboards.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12349,12352,12355,12358],{"name":12350,"slug":12351,"type":15},"Accessibility","accessibility",{"name":12353,"slug":12354,"type":15},"Charts","charts",{"name":12356,"slug":12357,"type":15},"Data Visualization","data-visualization",{"name":12258,"slug":12259,"type":15},"2026-06-30T19:00:57.102",{"slug":11963,"name":11963,"fn":12361,"description":12362,"org":12363,"tags":12364,"stars":19,"repoUrl":20,"updatedAt":12374},"automate browser interactions for agents","Browser automation CLI for AI agents. Use when the user needs to interact with websites, verify dev server output, test web apps, navigate pages, fill forms, click buttons, take screenshots, extract data, or automate any browser task. Also triggers when a dev server starts so you can verify it visually.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12365,12368,12371],{"name":12366,"slug":12367,"type":15},"Agents","agents",{"name":12369,"slug":12370,"type":15},"Browser Automation","browser-automation",{"name":12372,"slug":12373,"type":15},"Testing","testing","2026-04-06T18:41:03.44016",{"slug":12376,"name":12376,"fn":12377,"description":12378,"org":12379,"tags":12380,"stars":19,"repoUrl":20,"updatedAt":12386},"agent-browser-verify","verify dev server output with automated browser","Automated browser verification for dev servers. Triggers when a dev server starts to run a visual gut-check with agent-browser — verifies the page loads, checks for console errors, validates key UI elements, and reports pass\u002Ffail before continuing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12381,12382,12385],{"name":12369,"slug":12370,"type":15},{"name":12383,"slug":12384,"type":15},"Local Development","local-development",{"name":12372,"slug":12373,"type":15},"2026-04-06T18:41:17.526867",{"slug":12388,"name":12388,"fn":12389,"description":12390,"org":12391,"tags":12392,"stars":19,"repoUrl":20,"updatedAt":12404},"agents-sdk","build AI agents on Cloudflare Workers","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12393,12394,12395,12398,12401],{"name":12366,"slug":12367,"type":15},{"name":12226,"slug":12227,"type":15},{"name":12396,"slug":12397,"type":15},"SDK","sdk",{"name":12399,"slug":12400,"type":15},"Serverless","serverless",{"name":12402,"slug":12403,"type":15},"WebSockets","websockets","2026-04-06T18:39:51.717063",{"slug":12406,"name":12406,"fn":12407,"description":12408,"org":12409,"tags":12410,"stars":19,"repoUrl":20,"updatedAt":12420},"ai-elements","build chat UIs with AI Elements","AI Elements component library guidance — pre-built React components for AI interfaces built on shadcn\u002Fui. Use when building chat UIs, message displays, tool call rendering, streaming responses, reasoning panels, or any AI-native interface with the AI SDK.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12411,12412,12415,12418,12419],{"name":12263,"slug":12264,"type":15},{"name":12413,"slug":12414,"type":15},"React","react",{"name":12416,"slug":12417,"type":15},"shadcn\u002Fui","shadcn-ui",{"name":12280,"slug":12281,"type":15},{"name":13,"slug":14,"type":15},"2026-04-06T18:40:59.619419",{"slug":12422,"name":12422,"fn":12423,"description":12424,"org":12425,"tags":12426,"stars":19,"repoUrl":20,"updatedAt":12440},"ai-gateway","configure Vercel AI Gateway","Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12427,12430,12433,12436,12439],{"name":12428,"slug":12429,"type":15},"AI Infrastructure","ai-infrastructure",{"name":12431,"slug":12432,"type":15},"Cost Optimization","cost-optimization",{"name":12434,"slug":12435,"type":15},"LLM","llm",{"name":12437,"slug":12438,"type":15},"Performance","performance",{"name":13,"slug":14,"type":15},"2026-04-06T18:40:44.377464",{"slug":12442,"name":12442,"fn":12443,"description":12444,"org":12445,"tags":12446,"stars":19,"repoUrl":20,"updatedAt":12452},"ai-generation-persistence","implement persistence patterns for AI generations","AI generation persistence patterns — unique IDs, addressable URLs, database storage, and cost tracking for every LLM generation",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[12447,12448,12451],{"name":12431,"slug":12432,"type":15},{"name":12449,"slug":12450,"type":15},"Database","database",{"name":12434,"slug":12435,"type":15},"2026-04-06T18:41:08.513425",600]