WorkflowAbort
error is thrown by the Workflow SDK when a step executes successfully. When you run a step inside a try/catch block, you have two primary options:
WorkflowAbort
error:
context.run
inside try/catch, you can try putting the try/catch inside the context.run.
context.requestPayload
Becoming UndefinedrequestPayload
:
Content-type: text/plain
or Content-type: application/json
headers when starting the workflow.publishJSON
can only publish Content-type: application/json
.context.call
Executioncontext.call
, the endpoint is called at least twice, with the SDK attempting to run the route function until the first step for custom authorization.
Accessing context.requestPayload
before any step can result in it becoming undefined:
context.call
, and resolving this specific interaction is on our roadmap. Note that if you are passing context.requestPayload
as a parameter to context.call
, the payload remains intact. However, during the actual execution of context.call
, the context.requestPayload
becomes undefined due to the SDK’s internal workflow processing steps.
To fix this issue, you can try adding a step which returns the payload:
client.trigger
or by publishing to QStash.QSTASH_CURRENT_SIGNING_KEY
and QSTASH_NEXT_SIGNING_KEY
environment variables are correct.Content-type
headers when starting the workflow.Failed to authenticate Workflow request.
someCondition()
is non-deterministic, the recommended approach is to transform this condition into an explicit workflow step. Here’s the recommended pattern for handling such non-deterministic conditions:
200
status code and log one of the following three warnings: