Getting Started
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.
- No more function timeouts on serverless platforms
- Automatic error recovery, continue a workflow run from any step
- Integrates perfectly with your existing infrastructure; all code runs on your servers
- Delivery guarantees, batching, schedules and more
Quickstarts
Workflow supports Next.js, Cloudflare Workers and many more frameworks.
Next.js
Build a Next.js application with QStash Workflow
Cloudflare Workers
Use and deploy Upstash Workflow on Cloudflare Workers
Example Use Cases
Here are some example real world use-cases for Upstash Workflow:
AI Data Processing
Download a large dataset without timeouts, process the data in chunks and generate a report.
Authorization Webhook
Start a workflow from a webhook. Handle user creation, trial management, email reminders and notifications.
Customer Onboarding
Register a new user, send welcome emails, and periodically check and respond to the user’s activity state with emails.
E-Commerce Order Fulfillment
Receive an order request, verify the stock, process the payment, and handle order dispatch and customer notifications.
Image Processing
Manage uploading images to the data store. Apply filters and resize the images to different resolutions in parallel.
Retry Payments
Retry payments with a day of delay, send emails, and suspend account if payment fails after the retries.
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.
Next.js code example
Let’s see a practical implementation of Upstash Workflow using Next.js and customer onboarding as an example. See our Next.js 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.
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.
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:
- Cancel a running workflow
- Handle failed workflow runs
- Monitor active workflows in real-time
- Schedule repeated workflow runs
- Secure a workflow endpoint
- Handle workflow route code changes
- Develop your workflows locally
- Pricing
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.
Was this page helpful?