Terminal
Terminal/Skill
Guides the @upstash/workflow SDK for durable multi-step background jobs that survive timeouts and retries, built on QStash.
By Upstash
Works with
npx skills add upstash/skills --skill upstash-workflow-jsThe 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" });
These files contain the full documentation. Use them for details, patterns, and advanced behavior.
context (steps, waits, webhooks, events, invoke, etc.).QSTASH_DEV=true) and tunneling.