upstash-workflow-js
Build reliable serverless workflows with Upstash Workflow SDK for TypeScript/JavaScript. Define workflow endpoints, execute steps sequentially, and trigger runs from your backend using the Workflow client. Includes patterns for retries, webhooks, cross-workflow invocation, and local development.
Upstash Workflow JS lets you create and expose serverless workflow endpoints that run reliably using QStash.
AI-generated summary based on this skill's SKILL.md
Install
upstash/skills/upstash-workflow-js · repository language: JavaScript
git clone https://github.com/upstash/skills
cp -r skills/skills/upstash-workflow-js ~/.claude/skills/upstash-workflow-jsnpx skillfed install upstash/skills/upstash-workflow-jsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is upstash-workflow-js and how do I create serverless workflow endpoints?
upstash-workflow-js is a TypeScript/JavaScript SDK for building reliable serverless workflows with Upstash. It lets you create and expose workflow endpoints that execute multi-step processes with built-in retry logic and error handling. You define workflows as functions, deploy them as serverless endpoints, and trigger runs from your backend code using the Workflow client.
How do I define workflow steps with reliable execution in upstash-workflow-js?
upstash-workflow-js provides a context API to define reliable multi-step workflows. Each step is executed sequentially with automatic retry and failure handling. You use the workflow context to call steps, manage state between steps, and handle errors. The SDK ensures steps are retried on failure and executed exactly once, making workflows resilient to transient failures.
How can I trigger and manage workflow runs from backend code?
upstash-workflow-js includes a Workflow client library that lets you trigger and manage runs from your backend. You instantiate the client with your Upstash credentials, then call methods to start new workflow runs, check status, and retrieve results. The client handles communication with QStash to queue and execute your workflow steps reliably.
Does upstash-workflow-js support advanced patterns like parallelism and events?
Yes, upstash-workflow-js supports advanced workflow patterns including parallelism for concurrent step execution and event-driven workflows. You can implement cross-workflow invocation to chain workflows together, use wait-for-event patterns for human-in-the-loop workflows, and integrate webhooks to trigger workflows from external services.
What webhook integration and local development options does upstash-workflow-js offer?
upstash-workflow-js supports webhook integration to trigger workflows from external services and includes local development tools for testing workflows before deployment. You can set up middleware for request handling, debug workflows locally, and migrate existing workflows to the SDK. Rate limiting and middleware setup are configurable for production deployments.
Is upstash-workflow-js open source and what license does it use?
Yes, upstash-workflow-js is open source and released under the MIT license, allowing free use, modification, and distribution in both personal and commercial projects.
SKILL.md
rendered from the published skill — quoted content, verbatim
Upstash Workflow SDK
Quick Start
The Upstash Workflow SDK lets you expose serverless workflow endpoints and run them reliably using QStash under the hood.
Install:
npm install @upstash/workflow
Define a simple workflow endpoint:
import { serve } from "@upstash/workflow";
export const { POST } = serve(async (context) => {
await context.run("step-1", () => console.log("step 1"));
await context.run("step-2", () => console.log("step 2"));
});
Trigger it from your backend:
import { Client } from "@upstash/workflow";
const client = new Client({ token: process.env.QSTASH_TOKEN! });
await client.trigger({ url: "https://your-app.com/api/workflow" });
Other Skill Files
These files contain the full documentation. Use them for details, patterns, and advanced behavior.
- basics:
- basics/serve – How to expose workflow endpoints.
- basics/context – Full API
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 15 files
skills/upstash-workflow-js/SKILL.md
skills/upstash-workflow-js/agents.md
skills/upstash-workflow-js/basics/client.md
skills/upstash-workflow-js/basics/context.md
skills/upstash-workflow-js/basics/serve.md
skills/upstash-workflow-js/features/flow-control.md
skills/upstash-workflow-js/features/invoke.md
skills/upstash-workflow-js/features/retries-failures-reliability.md
skills/upstash-workflow-js/features/wait-for-event.md
skills/upstash-workflow-js/features/webhooks.md
skills/upstash-workflow-js/how-to/local-dev.md
skills/upstash-workflow-js/how-to/middleware.md
skills/upstash-workflow-js/how-to/migrations.md
skills/upstash-workflow-js/how-to/realtime.md
skills/upstash-workflow-js/rest-api.md