Overview
This example shows how to use Hookdeck as your webhook infrastructure to trigger Trigger.dev tasks. Hookdeck receives webhooks from external services, and forwards them directly to the Trigger.dev API. This gives you the best of both worlds: Hookdeck’s webhook management, logging, and replay capabilities, combined with Trigger.dev’s reliable task execution.Key features
- Use Hookdeck as your webhook endpoint for external services
- Hookdeck forwards webhooks directly to Trigger.dev tasks via the API
- All webhooks are logged and replayable in Hookdeck
Setting up Hookdeck
You’ll configure everything in the Hookdeck dashboard. No code changes needed in your app.1. Create a destination
In Hookdeck, create a new destination with the following settings:- URL:
https://api.trigger.dev/api/v1/tasks/<task-id>/trigger(replace<task-id>with your task ID) - Method: POST
- Authentication: Bearer token (use your
TRIGGER_SECRET_KEYfrom Trigger.dev)
2. Add a transformation
Create a transformation to wrap the webhook body in thepayload field that Trigger.dev expects:
3. Create a connection
Create a connection that links your source (where webhooks come from) to the destination and transformation you created above.Task code
This task will be triggered when Hookdeck forwards a webhook to the Trigger.dev API.trigger/webhook-handler.ts
Testing your setup
To test everything is working:- Set up your destination, transformation, and connection in Hookdeck
- Send a test webhook to your Hookdeck source URL (use the Hookdeck Console or cURL)
- Check the Hookdeck dashboard to verify the webhook was received and forwarded
- Check the Trigger.dev dashboard to see the successful run of your task

