Node.js
1
Create the flow server
startFlowServer from @genkit-ai/express starts an Express server on the port Cloud Run expects ($PORT, defaulting to 8080).2
Write the Dockerfile
3
Deploy
PORT environment variable automatically. The service account attached to the revision provides Application Default Credentials, so Vertex AI works without any additional configuration.Python
1
Create the Flask or FastAPI app
2
Write the Dockerfile
3
Deploy
--source . triggers Cloud Build to build and push the image automatically. Alternatively build the image manually and use --image.Go
1
Create the HTTP server
Use
genkit.Handler to register each flow and server.Start (from the server plugin) to manage the HTTP server lifecycle with graceful shutdown.2
Write the Dockerfile
3
Deploy
Authentication with Workload Identity
When you use Vertex AI (rather than the Gemini API key) on Cloud Run, no API key is required. The Cloud Run service account provides Application Default Credentials (ADC) automatically. Grant the service account theroles/aiplatform.user role:
Disable the dev reflection server
Set it in your Dockerfile or as a Cloud Run environment variable:Context providers and auth
For flows that should only be called by authenticated clients, add acontextProvider (Node.js/Python) or WithContextProviders (Go):
Next steps
Observability
Enable Cloud Trace and Cloud Monitoring for your Cloud Run service.
Firebase
Deploy Node.js flows as Firebase Cloud Functions.
