New to Kestra?
Use blueprints to kickstart your first workflows.
Fan out a nightly review queue to Gemini for toxicity and spam classification, cap concurrency, write back verdicts, and post one completion notification.
A queue of unmoderated reviews needs a verdict on every item, not just the first hundred before a rate limit hits. This blueprint pulls the pending review queue, fans out to Gemini for a per-item toxicity and spam classification under a concurrency cap, writes each verdict back to the source system, and posts a single completion notification instead of one message per review. It solves the throughput problem of batch LLM classification: getting through the whole queue without hammering the provider or losing track of which items were already handled.
fetch_pending_reviews (io.kestra.plugin.core.http.Request) pulls up to 200 pending reviews from the moderation queue API.moderate (io.kestra.plugin.core.flow.ForEach) iterates the returned reviews with concurrencyLimit: 5, so at most five reviews are classified at once regardless of queue size.classify_review (io.kestra.plugin.gemini.StructuredOutputCompletion) asks gemini-3.5-flash-lite for a verdict (approve, flag, or reject) plus a reason, constrained by a jsonResponseSchema.write_back (io.kestra.plugin.core.http.Request) posts the verdict to the review's own record in the source system, so the queue does not re-offer already-moderated items on the next run.notify_batch_complete (io.kestra.plugin.discord.DiscordIncomingWebhook) posts one message when the whole batch finishes.nightly_moderation Schedule trigger (io.kestra.plugin.core.trigger.Schedule) shows the cron pattern for running the batch unattended every night.Gemini can classify one review at a time, but it has no queue, no concurrency limiter, and no way to track which items were already written back. Kestra's ForEach with concurrencyLimit throttles the fan-out declaratively, execution history shows exactly which reviews got which verdict, and a failed run can be retried without reprocessing the whole queue from scratch. That bookkeeping is what turns a batch LLM script into an operable pipeline.
GEMINI_API_KEY: API key for the classification calls.DISCORD_WEBHOOK: incoming webhook URL for the batch completion message.fetch_pending_reviews and write_back at your own moderation queue API.nightly_moderation trigger to run the batch automatically every night.If guardrail that pages the team when the reject rate crosses a threshold, instead of relying on a human to notice.concurrencyLimit to match your Gemini quota and queue size.