Using WorkflowNonRetryableError
WorkflowNonRetryableError
lets you explicitly fail a workflow without entering the retry cycle.
When thrown, the workflow run is marked as failed, which:
- Triggers the failure function (if defined)
- Sends the workflow run to the DLQ
TypeScript
Using context.cancel()
You can cancel a workflow run explicitly from inside the workflow.
When canceled, the run is labeled as canceled instead of failed. This means:
- The failure handler will NOT be triggered
- The workflow will NOT be sent to the DLQ