| name | ideogram-webhooks-events |
| description | Build event-driven workflows around Ideogram's synchronous API.
Use when implementing async generation queues, batch processing,
callback patterns, or image processing pipelines.
Trigger with phrases like "ideogram webhook", "ideogram events",
"ideogram async", "ideogram queue", "ideogram batch pipeline".
|
| allowed-tools | Read, Write, Edit, Bash(curl:*) |
| version | 1.10.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ideogram","webhooks","async","queue"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Ideogram Events & Async Patterns
Overview
Ideogram's API is synchronous -- each call blocks until the image is generated (5-15 seconds). For production applications, wrap it in async patterns: job queues for batch generation, callbacks for downstream processing, and pipelines for image post-processing. This skill covers BullMQ queue patterns, callback handlers, and asset processing pipelines.
Prerequisites
IDEOGRAM_API_KEY configured
- Redis for BullMQ job queue
- Storage for generated images (S3, GCS, or R2)
- Understanding of Ideogram models and style types
Instructions
Step 1: Job Queue for Async Generation
import { Queue, Worker } from "bullmq";
import { writeFileSync, mkdirSync } from "fs";
import { join } from "path";
interface GenerationJob {
prompt: string;
style: string;
aspectRatio: string;
model: string;
callbackUrl?: string;
metadata?: Record<string, string>;
}
const connection = { host: "localhost", port: 6379 };
const imageQueue = new Queue("ideogram-generation", { connection });
async function () {
imageQueue.(, job, {
: ,
: { : , : },
: ,
: ,
});
}
worker = (, (job) => {
{ prompt, style, aspectRatio, model, callbackUrl, metadata } = job.;
response = (, {
: ,
: {
: process..!,
: ,
},
: .({
: {
prompt,
: model || ,
: style || ,
: aspectRatio || ,
: ,
},
}),
});
(response. === ) {
();
}
(!response.) {
();
}
result = response.();
image = result.[];
imgResp = (image.);
buffer = .( imgResp.());
outputDir = ;
(outputDir, { : });
filePath = (outputDir, );
(filePath, buffer);
(callbackUrl) {
(callbackUrl, {
: ,
: { : },
: .({
: ,
: job.,
prompt,
: image.,
: image.,
filePath,
metadata,
}),
});
}
{ : image., filePath, : image. };
}, {
connection,
: ,
});
worker.(, {
.(, err.);
});