We created Upstash Workflow to help you ship reliable code with minimal changes to your existing infrastructure:
Upstash Workflow is built on top of QStash, our serverless messaging and scheduling solution, to achieve these features. Here’s a simplified breakdown of how it works:
Call your workflow endpoint to trigger the workflow
The Workflow SDK sends a request to QStash with an automatically generated workflow run ID, headers, and the initial data as the request body
QStash calls your workflow endpoint with the current step to execute and the results of the previous steps:
In serverless environments, an API route is normally limited by a maximum function execution time (i.e. 10 seconds). By using context.run
, each step can now take up to the maximum duration, as each step is a separate HTTP request containing data from previous steps.
As Upstash Workflow is built on top of QStash, the context
methods map to QStash features:
context.run
-> regular QStash callcontext.sleep
and context.sleepUntil
-> QStash’s delay featurecontext.call
-> QStash’s callback featureRetries, for example, are built into all QStash calls by default and, therefore, apply to every step in your workflow. For step-by-step resumability, QStash keeps a copy of your workflow state until the run is complete.
This architecture makes your serverless functions durable, reliable, and optimized for performance, even during runtime errors or temporarily unavailable services.
We created Upstash Workflow to help you ship reliable code with minimal changes to your existing infrastructure:
Upstash Workflow is built on top of QStash, our serverless messaging and scheduling solution, to achieve these features. Here’s a simplified breakdown of how it works:
Call your workflow endpoint to trigger the workflow
The Workflow SDK sends a request to QStash with an automatically generated workflow run ID, headers, and the initial data as the request body
QStash calls your workflow endpoint with the current step to execute and the results of the previous steps:
In serverless environments, an API route is normally limited by a maximum function execution time (i.e. 10 seconds). By using context.run
, each step can now take up to the maximum duration, as each step is a separate HTTP request containing data from previous steps.
As Upstash Workflow is built on top of QStash, the context
methods map to QStash features:
context.run
-> regular QStash callcontext.sleep
and context.sleepUntil
-> QStash’s delay featurecontext.call
-> QStash’s callback featureRetries, for example, are built into all QStash calls by default and, therefore, apply to every step in your workflow. For step-by-step resumability, QStash keeps a copy of your workflow state until the run is complete.
This architecture makes your serverless functions durable, reliable, and optimized for performance, even during runtime errors or temporarily unavailable services.