client.trigger
import { Client } from "@upstash/workflow"; const client = new Client({ token: "<QSTASH_TOKEN>" }) const { workflowRunId } = await client.trigger({ url: "https://<YOUR_WORKFLOW_ENDPOINT>/<YOUR-WORKFLOW-ROUTE>", body: "hello there!", // optional body headers: { ... }, // optional headers workflowRunId: "my-workflow", // optional workflow run id retries: 3 // optional retries in the initial request delay: "10s" // optional delay value failureUrl: "https://<YOUR_FAILURE_URL>", // optional failure url useFailureFunction: true, // whether a failure function is defined in the endpoint flowControl: { ... } // optional flow control }) console.log(workflowRunId) // prints wfr_my-workflow
trigger
curl
fetch
curl -X POST https://<YOUR_WORKFLOW_ENDPOINT>/<YOUR-WORKFLOW-ROUTE> \ -H "my-header: foo" \ -d '{"foo": "bar"}'
context.requestPayload
context.headers
Was this page helpful?