New to Kestra?
Use blueprints to kickstart your first workflows.
Run a Python script in a Docker container pulled from a private Google Artifact Registry repository, authenticated with a short-lived GCP OAuth token in Kestra.
Run a Python data analysis script inside a Docker container whose image lives in a private Google Artifact Registry repository, with authentication handled automatically by a short-lived OAuth token. This blueprint solves a common GCP pain point: how to let an orchestrator pull a custom container image from Artifact Registry without hardcoding long-lived Docker credentials. It downloads a CSV dataset, runs pandas analysis in your own image, and captures metrics back into Kestra.
wdir task (io.kestra.plugin.core.flow.WorkingDirectory) groups the steps so files are shared in a single working directory.download_csv (io.kestra.plugin.core.http.Download) fetches a public orders.csv dataset over HTTP.fetch_auth_token (io.kestra.plugin.gcp.auth.OauthAccessToken) exchanges your GCP service account for a short-lived OAuth access token used to authenticate against Artifact Registry.analyze_sales (io.kestra.plugin.scripts.python.Script) runs pandas on the CSV, computes total sales and median quantity, prints the top orders, and emits values with Kestra.outputs(...). It runs on the io.kestra.plugin.scripts.runner.docker.Docker task runner, whose config.auths injects the OAuth token as the Docker password so the private containerImage pulls cleanly.total_sales, median_quantity) available to downstream tasks.Artifact Registry stores and serves images, but it cannot schedule work, retry failed runs, react to events, or track data lineage across tasks. Kestra fills that gap: declarative YAML defines the pipeline, event and schedule triggers can launch it, retries handle transient registry or network errors, and outputs flow between tasks with full execution lineage. The OAuth token is fetched fresh per run, so credentials stay short-lived and never sit in the image.
Artifact Registry Reader (or Writer to push) role.GCP_CREDS: the JSON service account key, used by fetch_auth_token to mint the OAuth access token.GCP_CREDS secret with your service account JSON key.projectId, the containerImage path, and the registry region in config.auths.docker build -t yourGcpRegion-docker.pkg.dev/PROJECT/REPO/python:latest . then docker push ....