How To
Start a Run
You’ve defined your workflow, and the final step is to trigger the endpoint!
There are three main ways to start your workflow:
1. Using client.trigger
(Recommended)
We recommend using client.trigger
to start your workflow as it returns the workflow run ID in its result and results in one less QStash publish per workflow.
2. Publishing a message with QStash
3. Sending an HTTP Request
Secured Endpoints
If you’ve secured your endpoint with signing keys, only the first two methods (trigger
and publish
) will work. Direct calls to the endpoint (e.g., via curl
or fetch
) will not be accepted.
Accessing Payload and Headers
When you call the endpoint, the payload and headers you send will be accessible in the context:
- The payload is available in the
context.requestPayload
field. - The headers are available in the
context.headers
field.
For more details, refer to the documentation on the Context object.
Was this page helpful?