Overview
OpenAI API calls can be slow or occasionally fail. This task configures custom retry options at the task level (overriding the project defaults) and explicitly throws an error when OpenAI returns an empty response — which triggers a retry without needing any extra tooling.Task code
trigger/openai.ts
How retrying works
Theretry config on the task controls how Trigger.dev retries the entire run if it throws:
Testing your task
To test this task in the Trigger.dev dashboard, use the following payload on the Test page:Related examples
Resend email sequence
Use retry.onThrow for partial retries within a multi-step task
FFmpeg video processing
Process video files using FFmpeg in a background task