Skip to content
Upstash Workflow (TypeScript)

Upstash Workflow (TypeScript)

MIT
Repository Docs
markdown Development
upstashworkflowserverlesstypescriptqstash

Summary

Upstash's official skill for the Workflow TypeScript SDK - define serverless workflow endpoints, run durable steps, and trigger and manage runs from the client.

Features

  • Define workflow endpoints with serve() from @upstash/workflow
  • Structure durable, checkpointed steps with context.run()
  • Trigger and manage workflow runs from the client
  • Progressive references so context stays small
  • Works as an Agent Skills repo, Claude Code plugin and Codex plugin

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: upstash-workflow-js
description: Skills for the Upstash Workflow TypeScript/JavaScript SDK to define, trigger, and manage workflows. Use this Skill whenever a user wants to create workflow endpoints, run steps, or interact with the Upstash Workflow client.
---

# 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:

```bash
npm install @upstash/workflow
```

Define a simple workflow endpoint:

```ts
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:

```ts
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 for workflow `context` (steps, waits, webhooks, events, invoke, etc.).
  - **basics/client** – Using the Workflow client to trigger, cancel, inspect, and notify runs.
- features:
  - **features/invoke** – Cross‑workflow invocation.
  - **features/reliability** – Retries, failure callbacks, and DLQ.
  - **features/flow-control** – Rate limits, concurrency, and parallelism.
  - **features/wait-for-event** – Notify and wait-for-event patterns.
  - **features/webhooks** – Webhook creation and consumption.
- how to:
  - **how-to/local-dev** – Local QStash dev server (auto via `QSTASH_DEV=true`) and tunneling.
  - **how-to/realtime** – Realtime and human‑in‑the‑loop workflows.
  - **how-to/migrations** – Migrating workflows safely.
  - **how-to/middleware** – Adding middleware to workflows.
- other files:
  - **rest-api** – Low-level REST endpoints for interacting with QStash/Workflow.
  - **troubleshooting** – Common debugging and environment issues.
  - **agents** – Using Workflow with agents, orchestrators, and automation patterns.

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions

Install with npx skills add upstash/skills, or add the marketplace in Claude Code (/plugin marketplace add upstash/skills then /plugin install upstash@upstash). Add @upstash/workflow to the project and configure your QStash credentials.

Example Usage

Create an Upstash Workflow endpoint that enriches a signup, waits for email verification, then provisions the account.

Description

Upstash Workflow lets you expose an HTTP endpoint that runs a multi-step process durably, with QStash handling delivery and retries underneath. This skill gives an agent the SDK's actual shape so it writes working endpoints instead of approximations.

What it covers

Installing @upstash/workflow, defining a workflow endpoint with serve(), and structuring work as context.run() steps - the unit that makes a workflow resumable, because each completed step is checkpointed rather than replayed. From there it moves to triggering workflows and managing runs through the client.

The skill points on to companion files for deeper areas of the SDK, so the loaded context stays small until a task needs more.

Use it when

Creating workflow endpoints, breaking a long-running process into durable steps, or interacting with the Upstash Workflow client - in any TypeScript or JavaScript runtime where Upstash Workflow runs, including serverless platforms where a single request cannot stay open long enough to finish the job.

Where it fits

One of the upstash/skills collection, which also covers Upstash Redis, Vector, Search, QStash, Rate Limit and Box (sandboxed cloud containers), plus a combined skill spanning every SDK. The repo doubles as an Agent Skills repo, a Claude Code plugin and an OpenAI Codex plugin.

Install with npx skills add upstash/skills, /plugin marketplace add upstash/skills in Claude Code, codex plugin marketplace add upstash/skills, or npx ctx7 skills install upstash/skills. For operations that call the Upstash API directly - creating databases, publishing messages, querying vectors - Upstash also publishes an MCP server, @upstash/mcp-server.

Related Skills

Skill: Redis Search

by Redis, Inc.

New

Redis' own guidance for FT.CREATE schema design, FT.SEARCH / FT.AGGREGATE / FT.HYBRID, HNSW vector similarity and RAG retrieval pipelines.

Development

Skill: Supabase

by Supabase

New

Supabase's official skill covering Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron and Queues — with a hard rule to verify against the live changelog before writing code.

Development
New

GreenSock's official ScrollTrigger skill — scroll-linked animation, pinning, scrub and trigger positioning, with the exact start/end syntax agents get wrong.

DevelopmentDesign & Creative
1 views

Microsoft's official skill that turns an agent into an Azure solution architect — 10 design principles, 6 architecture styles, 44 design patterns and a Well-Architected review workflow.

Development
Browse all skills →