Batch Processing
Batch operations let you generate hundreds or thousands of images efficiently from a single API call. Perfect for bulk social cards, certificates, personalized content, and data-driven graphics.
When to Use Batch
Basic Batch Workflow
1. Prepare Your Data
Structure your data as an array of variable objects:
2. Start the Batch Job
Batch rendering is asynchronous — renderBatch returns immediately (HTTP 202) with a batchId.
3. Monitor Progress
4. Collect Results
The poll endpoint does not return rendered URLs. getBatchResults reports per-item { index, success, variables } (plus error on failures). Final image URLs are delivered via the render.completed webhook — subscribe to webhooks to collect batch output (see below).
Webhook Integration
Webhooks are how you collect the rendered image URLs from a batch. Configure a webhook subscription in the dashboard (Settings > Webhooks) or via the webhook API, then handle two event types:
render.completed — fired once per rendered image, and carries the url. This is where you collect output.
batch.completed — fired once when the whole job finishes, with success/failure counts.
Setup Webhook Handler
render.completed Payload
The render events deliver the URLs (the batch poll does not):
batch.completed Payload
Real-World Examples
Social Cards for Blog Posts
Event Certificates
Product Images
Handling Failures
Identify Failed Items
Retry Failed Items
Common Failure Reasons
Optimize Template
- Simplify CSS - Avoid complex gradients and shadows
- Preload fonts - Use web-safe fonts or inline font data
- Optimize images - Use appropriately sized source images
- Reduce elements - Fewer DOM elements = faster render
Batch Size
A single batch accepts up to 100 variable sets. Split larger datasets across multiple batches.
Parallel Processing
Pictify processes batch items in parallel. Larger batches are more efficient than multiple small batches.
Monitoring
Track Batch Progress
Set Up Alerts