mcpField
U
upstash-workflow-js

upstash-workflow-js

github.com/upstashDevelopment342.2k installsUpdated 1d ago
Repository

About upstash-workflow-js

upstash-workflow-js is a documentation skill for developers using the Upstash Workflow TypeScript SDK. It guides implementation and debugging, with references to bundled docs and source plus workflow patterns.

Key features

  1. 01Guidance for checking bundled docs and source
  2. 02Workflow endpoint setup
  3. 03Triggering runs with the client
  4. 04Retries and failure handling
  5. 05Flow control and event patterns

Use cases

  1. 01Implementing a serverless workflow endpoint
  2. 02Triggering, inspecting, or cancelling workflow runs
  3. 03Building workflows with waits, webhooks, or events

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/upstash/skills --skill upstash-workflow-js

After installing, type/upstash-workflow-jsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents.md
rest-api.md
troubleshooting.md
basics/
client.md
context.md
serve.md
features/
flow-control.md
invoke.md
retries-failures-reliability.md
wait-for-event.md
webhooks.md
how-to/
local-dev.md
middleware.md
migrations.md
realtime.md

Details

From the project README

Upstash Workflow SDK

Bundled docs and source

Before writing or debugging SDK code, check node_modules/@upstash/workflow/docs/ for bundled docs and node_modules/@upstash/workflow/src/ for readable TypeScript source. Read and search the relevant files when present; otherwise use the references in this skill.

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 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.

Comments

Markdown supported