Note: The Hedra v3 API is now available. This guide covers the legacy API and is maintained for existing integrations. For new projects, get started with the Developer Platform →
Authentication setup
Before building workflows, create a reusable credential for the Hedra API:- Go to Credentials in n8n
- Click Add Credential → Header Auth
- Set Name to
X-API-Keyand Value to your Hedra API key - Save as “Hedra API Key”
Example: Generate an image on a schedule
This workflow generates a daily image from a prompt.Node 1: Schedule Trigger
- Type: Schedule Trigger
- Interval: Every day at 9:00 AM
Node 2: Generate Image
- Type: HTTP Request
- Method:
POST - URL:
https://api.hedra.com/web-app/public/generations - Authentication: Header Auth → Hedra API Key
- Body (JSON):
Node 3: Wait
- Type: Wait
- Duration: 30 seconds
Node 4: Check Status
- Type: HTTP Request
- Method:
GET - URL:
https://api.hedra.com/web-app/public/generations/{{ $('Generate Image').item.json.id }}/status - Authentication: Header Auth → Hedra API Key
Node 5: Check if Complete
- Type: If
- Condition:
{{ $json.status }}equalscomplete - True: Continue to next node
- False: Loop back to Wait node
Example: Avatar video from text input
This workflow takes a text input, generates speech, and creates an avatar video.Node 1: Manual Trigger / Webhook
Start the workflow manually or via a webhook with atext field in the body.
Node 2: Upload Portrait Image
If you have a fixed portrait, upload it once and reuse the asset ID. Otherwise, create and upload:- Type: HTTP Request
- Method:
POST - URL:
https://api.hedra.com/web-app/public/assets - Body (JSON):
Node 3: Upload File
- Type: HTTP Request
- Method:
POST - URL:
https://api.hedra.com/web-app/public/assets/{{ $json.id }}/upload - Authentication: Header Auth → Hedra API Key
- Body: Form-Data, attach your portrait image file
Node 4: Generate Avatar Video with Inline TTS
Useaudio_generation to skip a separate TTS step:
- Type: HTTP Request
- Method:
POST - URL:
https://api.hedra.com/web-app/public/generations - Body (JSON):
Node 5: Poll Until Complete
Use a Wait + HTTP Request + If loop (same pattern as the image example above) to pollGET /generations/{id}/status until status is "complete".
Polling pattern
Most Hedra generations are asynchronous. Use this reusable polling pattern in your n8n workflows:Tips
- Reuse asset IDs. If you use the same portrait or audio across runs, upload once and store the
asset_idfor reuse. - Use n8n variables. Store your Hedra model IDs and voice IDs as n8n workflow variables for easy updates.
- Error handling. Add an If node to check for
statusequal to"error"and branch to a notification or retry path.