Agent skill · software engineering · lobehub

upstash-workflow

Use for Upstash Workflow/QStash handlers, triggers, durable steps and async fan-out.

Why this skill is useful

Provides specific implementation patterns and code examples for managing async workflows in Upstash that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 81,352 stars on the source repository.

What this skill does

Upstash Workflow Implementation Guide Standard patterns for implementing Upstash Workflow + QStash async workflows in the LobeHub codebase. 🎯 The Three Core Patterns Every workflow in LobeHub combines these three patterns. They exist because the platform constrains you in three ways: rate limits make blind fan-out dangerous, step limits cap a single workflow's size, and idempotency demands that retries don't double-process. 1. 🔍 Dry-Run Mode — get statistics without triggering actual execution 2. 🌟 Fan-Out Pattern — split large batches into smaller chunks for parallel processing 3. 🎯 Single Task Execution — each workflow execution processes exactly ONE item --- Architecture Overview All workflows follow the same 3-layer architecture: Real examples in this codebase: topicAutoSummary, agentEvalRun — see references/examples.md. --- The Three Patterns in 60 Seconds 1. Dry-Run Mode Short-circuit Layer 1 before any side effects so callers can preview what would happen: Use case: check how many items will be processed before committing. 2. Fan-Out Pattern Layer 2 splits oversized batches into chunks and recursively re-triggers itself with each chunk. This avoids hitting workflow step limits when one page contains too many items: Defaults: PAGESIZE = 50 (items per page), CHUNKSIZE = 20 (items per fan-out chunk). 3. Single Task Execution Layer 3 always processes exactly one item per invocation. Parallelism comes from Layer 2 fanning out to many Layer 3 invocations, controlled by flowControl: --- File Structure Every layer is a handler mounted on a per-workflow Hono app under apps/server/src/router-hono/workflows/; the Next.js route under src/app only dispatches into it. --- Where to Go Next Pick the reference that matches what you're doing: You want to... …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills lobehub/upstash-workflow

View the source on GitHub

Browse the @skills marketplace