New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate scheduled LLM enrichment of BigQuery rows with Gemini on Vertex AI. Concurrency-limited fan-out, write-back, and email alerts in Kestra.
Run scheduled LLM enrichment of BigQuery rows with a Gemini model on Vertex AI, without writing a one-off Python notebook or babysitting a loop. This Kestra blueprint pulls the rows that still need a label, fans them out to io.kestra.plugin.gcp.vertexai.ChatCompletion under a concurrency cap, writes the model response back to BigQuery, and emails the team on success or failure. It turns ad-hoc LLM batch jobs into a governed, retryable, observable pipeline that respects Vertex AI quotas and keeps costs predictable.
io.kestra.plugin.core.trigger.Schedule trigger (nightly, cron 0 2 * * *, disabled by default) launches the batch on a cadence you control.select_rows runs io.kestra.plugin.gcp.bigquery.Query with fetchType: FETCH to pull rows from analytics.reviews where sentiment IS NULL, limited to 50.enrich is a io.kestra.plugin.core.flow.ForEach over outputs.select_rows.rows with concurrencyLimit: 4, capping parallel calls to Vertex AI.classify calls io.kestra.plugin.gcp.vertexai.ChatCompletion with region: us-central1 and modelId: gemini-1.5-flash, asking Gemini for a one-word sentiment.store runs another io.kestra.plugin.gcp.bigquery.Query that updates the row with outputs.classify.predictions[0].notify sends an io.kestra.plugin.email.MailSend summary with the batch size and execution id.errors handler (alert_on_failure) emails the team if any step fails.pluginDefaults injects projectId and serviceAccount into every io.kestra.plugin.gcp task from secrets.pluginDefaults.Vertex AI gives you the model, BigQuery gives you the table, but neither schedules a row-by-row enrichment loop with concurrency control, retries, write-back, and alerting. Kestra adds the missing layer: declarative YAML, event or cron triggers, concurrencyLimit to stay under model quotas, automatic retries on transient errors, lineage across BigQuery and Vertex AI, and a dedicated error handler. You get one place to see what ran, what it cost, and what failed, instead of stitching together Cloud Scheduler, Cloud Functions, and ad-hoc Python.
analytics.reviews) with id, review, and a nullable sentiment column.us-central1, gemini-1.5-flash).GCP_PROJECT_ID: GCP project hosting BigQuery and Vertex AI.GCP_SERVICE_ACCOUNT: service account key JSON with BigQuery and Vertex AI access.SMTP_HOST: SMTP server hostname.SMTP_USERNAME: SMTP user.SMTP_PASSWORD: SMTP password.select_rows SQL at your own table and filter, and update the store UPDATE statement to match.region and modelId in classify to the Gemini model you have enabled.from, to, and the email subjects in notify and alert_on_failure.nightly trigger (set disabled: false) or run the flow manually from the UI.concurrencyLimit for higher throughput, or lower it to stay safely under Vertex AI quotas.Slack notification next to MailSend for richer alerting.Schedule trigger with a Pub/Sub or BigQuery event trigger to enrich rows as they arrive.If on emitted token-count metrics to stop a batch when a cost threshold is crossed.