upstash-workflow-js — скилл для Claude Code: durable-воркфлоу
Учит агента писать долгие воркфлоу на @upstash/workflow, которые переживают таймауты, ретраи и перезапуски serverless-функций.
npx skills add upstash/skills --skill upstash-workflow-js -a claude-codeЧто делает upstash-workflow-js
Скилл даёт агенту документацию по TypeScript/JavaScript SDK @upstash/workflow, работающему поверх QStash. Внутри — разбор serve() для эндпоинта воркфлоу, context.run для шагов, context.call для внешних API, ожидание события или вебхука, вызов других воркфлоу. Отдельные файлы описывают ретраи, failure callbacks и DLQ, лимиты по частоте, конкурентности и параллелизму, а также клиент Client для запуска, отмены и просмотра прогонов.
Есть разделы про локальную разработку с dev-сервером QStash (включается через QSTASH_DEV=true), realtime-обновления, human-in-the-loop, middleware и безопасные миграции. Плюс низкоуровневые REST-эндпоинты и разбор частых проблем окружения. По сути это справочник, который агент подтягивает, когда вы просите durable execution, saga-паттерн или фоновые задачи с чекпоинтами на Vercel, Next.js и Cloudflare Workers.
Сам пакет ставится через npm install @upstash/workflow, а для запуска воркфлоу нужен QSTASH_TOKEN в переменных окружения. Без токена клиент не заработает — это первое, что стоит проверить перед тем, как просить агента генерировать код триггера.
Какие задачи решает
- описать эндпоинт воркфлоу через
serve() - разбить длинный процесс на шаги с
context.run - поставить паузу на минуты или дни, не держа функцию открытой
- настроить ретраи, failure callback и DLQ
- ограничить конкурентность и частоту запусков
Примеры запросов агенту
- Опиши эндпоинт воркфлоу на
@upstash/workflowс тремя шагами и вызовом внешнего API черезcontext.call. - Добавь ретраи и failure callback для воркфлоу, который дёргает платёжный сервис.
- Как поднять локальный dev-сервер QStash для отладки воркфлоу?
Как установить upstash-workflow-js
1Через Skills CLI (Vercel)
npx skills add upstash/skills --skill upstash-workflow-js -a claude-code2Вручную: положить файлы
~/.claude/skills/upstash-workflow-js/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/upstash-workflow-js/
1Через Skills CLI (Vercel)
npx skills add upstash/skills --skill upstash-workflow-js -a codex2Вручную: положить файлы
.agents/skills/upstash-workflow-js/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add upstash/skills --skill upstash-workflow-js -a cursor2Вручную: положить файлы
.cursor/skills/upstash-workflow-js/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install upstash/skills upstash-workflow-js2Вручную: положить файлы
.github/skills/upstash-workflow-js/SKILL.md1Через Skills CLI (Vercel)
npx skills add upstash/skills --skill upstash-workflow-js -a gemini-cli2Командой платформы
gemini skills install https://github.com/upstash/skills --path skills/upstash-workflow-jsВручную: положить файлы
.devin/skills/upstash-workflow-js/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add upstash/skills --skill upstash-workflow-js -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора10
Похожие
Рядом в теме «Бэкенд и API»
Всё по теме «Бэкенд и API» →Вопросы о upstash-workflow-js
Как установить upstash-workflow-js в Claude?
Выполните npx skills add upstash/skills --skill upstash-workflow-js -a claude-code. Файл скилла появится по пути ~/.claude/skills/upstash-workflow-js/SKILL.md.
Что делает upstash-workflow-js?
Даёт агенту полную документацию по SDK @upstash/workflow: эндпоинты, шаги, ожидания, вебхуки, ретраи, flow control и клиент для управления прогонами.
Что нужно, чтобы воркфлоу заработал?
Пакет @upstash/workflow и токен QSTASH_TOKEN в переменных окружения. Локально можно включить dev-сервер QStash через QSTASH_DEV=true.
Исходный текст
SKILL.md · MIT
---
name: upstash-workflow-js
description: Work with the @upstash/workflow TypeScript/JavaScript SDK for durable, long-running workflows in serverless functions, multi-step processes that survive timeouts, retries, and restarts (built on QStash). Use when defining a workflow endpoint with serve(), running steps with context.run, sleeping for minutes to days without holding a function open, calling external APIs with context.call, waiting for an external event or webhook, invoking other workflows, configuring retries, failure callbacks, and a DLQ, controlling concurrency, rate, and parallelism, triggering, cancelling, or inspecting runs with the Workflow client, building AI agents and orchestrators, human-in-the-loop approvals, realtime updates, local development with the QStash dev server, adding middleware, or migrating workflows safely. Also use when the user asks for durable execution, step functions, saga or orchestration patterns, background jobs with checkpoints, or long-running tasks on Vercel, Next.js, Cloudflare Workers, or other serverless platforms.
license: MIT
metadata:
author: Upstash
homepage: https://upstash.com
---
# 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.
© Upstash · MIT · upstash/skills