Engineering
upstash-workflow-js avatar

upstash-workflow-js

Build durable, reliable serverless workflows using the Upstash Workflow SDK. Define endpoints, manage complex execution steps, and integrate with QStash for automatic retries and state management.

Introduction

The Upstash Workflow SDK is a powerful tool for developers building serverless applications that require durable execution. By leveraging QStash as the underlying engine, it enables developers to define long-running workflows that automatically handle retries, failure callbacks, and state persistence without managing infrastructure. It is designed to work seamlessly with various serverless runtimes including Next.js, Cloudflare Workers, and Hono. Whether you are building event-driven architectures, orchestrating multiple microservices, or implementing human-in-the-loop processes, this SDK provides the primitives necessary to ensure your code executes reliably.

  • Define workflow endpoints using the serve method for simplified integration.

  • Support for granular step execution via context.run, allowing for stateful processing within serverless environments.

  • Native support for asynchronous patterns such as context.sleep, context.sleepUntil, and context.waitForEvent.

  • Advanced control flow including concurrency limits, rate limiting, and cross-workflow invocation using context.call.

  • Integrated telemetry for monitoring SDK usage, with simple opt-out capabilities.

  • Built-in support for distributed systems requirements like dead-letter queues (DLQ), failure callbacks, and custom middleware.

  • Ideal for developers who need to implement complex, multi-step backend logic without the overhead of managing queues or state databases.

  • Input requirements include a valid QSTASH_TOKEN for authentication with the Upstash console.

  • Compatible with popular frameworks; refer to the relevant documentation for specific platform quickstarts (Next.js, Astro, Cloudflare).

  • Practical constraints: Designed for event-driven environments; ensure your environment variables (QSTASH_URL, QSTASH_TOKEN) are correctly configured in your deployment platform.

  • Use the Workflow Client to programmatically trigger, cancel, or notify active workflow runs from any backend service.

  • Highly recommended for automation tasks, data processing pipelines, and agent orchestration where reliability across network partitions is critical.

Repository Stats

Stars
148
Forks
25
Open Issues
15
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 03:45 PM
View on GitHub