QStash is an HTTP based messaging and scheduling solution for the serverless and edge runtimes.
Go to siteQStash API offers a secure, scalable, and simple way to manage message queues and defer tasks. Using this API, you can enqueue messages, schedule tasks to run after a delay, and ensure that tasks are executed exactly once, leveraging the power of serverless architecture. With Pipedream's ability to connect to a multitude of services, you can build complex workflows that trigger actions in other apps based on events in QStash, allowing you to automate cross-application business processes with ease.
import { axios } from '@pipedream/platform';
export default defineComponent({
props: {
qstash: {
type: "app",
app: "qstash",
},
callback_url: {
type: "string",
label: "Callback URL",
description: "A URL that will be called by QStash with the body given",
},
delay: {
type: "string",
label: "Delay",
default: 0,
description: "Delay the HTTP request to the callback URL (seconds)"
}
},
async run({steps, $}) {
return axios($, {
url: `https://qstash.upstash.io/v1/publish/${this.callback_url}`,
method: 'POST',
headers: {
'Authorization': `Bearer ${this.qstash.auth.qstash_token}`,
'Upstash-Delay': `${this.qstash.delay}s`
},
data: {
hello: 'world'
}
});
}
})
Delayed Order Processing: Automate the handling of orders that require a delayed processing step. For instance, after an order is received, you can use QStash to delay notification for manual review, and after the set delay, trigger a workflow in Pipedream that checks the order for fraud, and then proceeds with shipping confirmation.
Scheduled Content Publishing: Perfect for managing social media or blog content schedules. When a content piece is ready, push it to QStash with a scheduled release time. Pipedream can then listen for the message to be dequeued and automatically publish the content to platforms like Twitter or WordPress.
Distributed Task Coordination: In a microservices architecture, coordinating tasks across services can be challenging. Use QStash to queue tasks that are dependent on the completion of other services' tasks. Pipedream workflows can then act on task completion events, such as updating a database in Airtable or triggering a new deployment in Heroku, ensuring smooth inter-service operation.
QStash uses API keys for authentication. When you connect your QStash account, Pipedream securely stores the keys so you can easily authenticate to QStash APIs in both code and no-code steps.
QSTASH_TOKEN
from the Request BuilderThen paste it in the field below.