resonate-http-service-design-typescript

Design TypeScript HTTP services that map routes to durable Resonate workflows.

6|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-http-service-design-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resonate-http-service-design-typescript
Source: https://github.com/resonatehq/resonate-skills/tree/main/resonate-http-service-design-typescript
Command: npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-http-service-design-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HTTP route handlers are ephemeral and cannot safely perform long-running or replay-sensitive work; this Skill helps map HTTP requests to durable Resonate workflows so APIs remain responsive, idempotent, and crash-safe.

Core Features & Use Cases

  • Async job orchestration: Patterns to submit jobs, poll status, or await callbacks and webhooks while workflows perform the work.
  • Service decomposition & RPC: Best practices for separating API, worker, and DB services and invoking durable RPC between groups.
  • Determinism & idempotency: Promise ID strategies, deterministic APIs (ctx.date.now, ctx.math.random), and guidance on detaching side effects and handling retries.
  • Error handling & concurrency: Structured concurrency examples, timeout and retry controls, and treating promise-exists errors as idempotent outcomes.
  • Use Case: Build a TypeScript Express/Fastify API where POST /jobs begins a durable "process-job" workflow, workers call db RPC methods, and external webhooks resolve approval promises.

Quick Start

Create a POST /jobs endpoint that begins a durable workflow named process-job, returns 202 with a jobId, and uses stable promise IDs for idempotency.

Frequently Asked Questions about resonate-http-service-design-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle long-running HTTP requests in TypeScript without blocking the API server?

Map ephemeral route handlers to durable Resonate workflows so long-running HTTP requests in TypeScript execute asynchronously in the background. This returns a 202 immediately while the workflow runs, ensuring the API server remains responsive and crash-safe.

How do I make HTTP API job submissions idempotent in TypeScript?

Make HTTP API job submissions idempotent by using stable promise IDs for each workflow. Even if a client retries a request, the workflow executes only once, and any promise-exists errors are safely treated as idempotent outcomes rather than failures.

What is the best way to structure RPC calls between API, worker, and database services?

Structure RPC calls between services by decomposing your architecture into API, worker, and database groups. Invoke durable RPC methods between these groups to coordinate tasks securely, ensuring stable RPC targeting and consistent communication across the workflow lifecycle.

How do webhook callbacks work with durable workflows for async job completion?

Webhook callbacks resolve approval promises within durable workflows to signal async job completion. External systems send webhooks to your API, which forwards the callback to the Resonate workflow, allowing the suspended promise to resume and complete the job lifecycle.

How do I ensure deterministic results when using dates and random numbers in durable workflows?

Ensure deterministic results in durable workflows by using ctx.date.now and ctx.math.random instead of native JavaScript functions. These deterministic APIs guarantee consistent execution during replays, preventing side effects from breaking workflow state during retries.

Can I use this durable workflow pattern with Express or Fastify TypeScript servers?

Yes, you can use this durable workflow pattern with Express or Fastify TypeScript servers. The pattern maps standard HTTP route handlers to Resonate workflows, fitting naturally into existing API server setups without requiring a complete framework rewrite.