Overview

Upstash Workflow lets you write durable, reliable and performant serverless functions. Get delivery guarantees, automatic retries on failure, scheduling and more without managing any infrastructure.

Key Features

Failure Resilience

If your platform experiences a temporary outage, your workflow can pick up right where it left off, ensuring stability even in unstable environments.

Long-Running Executions

Run long-running REST endpoints, such as complex AI models or video processing tools, even on serverless platforms with strict time limits.

Events with Wait/Notify Mechanism

Create workflows that wait for external events before proceeding. Ideal for user confirmations and asynchronous notifications.

Scheduled Jobs

Run jobs at regular intervals with support for cron expressions. Perfect for recurring tasks like reminders, reports, or newsletters.

Parallel Runs

Start independent tasks in parallel and wait for them to finish simultaneously, reducing latency.

Long Delays

Need your code to “sleep” for days, weeks, or even months? Supports long delays beyond serverless time limits.

Delivery Guarantees

Ensures at-least-once delivery. Failed requests are logged in a Dead Letter Queue to prevent data loss.

Rate Limiting (Coming Soon)

Prevent overwhelming external services by configuring rate limits, controlling operations per second, and managing burst traffic.

Observability

Monitor workflow steps with insights. Filter events to track successes, failures, retries, and stalls.

Quickstarts

Workflow supports Next.js, Cloudflare Workers and many more frameworks in TypeScript and Python.

Example Use Cases

Here are some example real world use-cases for Upstash Workflow:

How it works

Upstash Workflow builds on the principle of steps. Instead of defining a single, complex piece of business logic, workflows contain multiple individual steps.

In case of an error, a failed step is retried individually without needing to re-run any previous steps. Instead of the entire business logic, each step can take up your serverless function execution duration, and many more benefits.

Code example

Let’s see a practical implementation of Upstash Workflow using customer onboarding as an example. See our Next.js Quickstart or FastAPI Quickstart for a complete guide.

Any HTTP request using context.call, like the AI-generation above, does not count towards your function’s execution time and does not increase your serverless bill. It can also run for up to 2 hours, completely bypassing any platform-specific function timeouts.

Once your endpoint is ready, you can trigger the workflow via our SDKs or using plain REST. See here for details.

The above example should give you a rough idea of how a workflow looks in code. For step-by-step instructions on setting up your first workflow with images along the way, see our Next.js Quickstart or FastAPI Quickstart.


Here are more details about what the context object does:

See caveats for more complex API usage and best-practices when using Upstash Workflow.


Guides on common workflow topics:

If you’re curious about the behind-the-scenes about how we ensure separate step execution or prevent serverless timeouts, we wrote about it here! :)

Here is our Upstash Workflow roadmap to see what we planned for the future.