# Vertex Agent
The Vertex Agent executes flow runs as Vertex Custom Jobs. Vertex describes these as "training" jobs, but they can be used to run any kind of flow.
The required dependencies for the Vertex Agent aren't installed by
need to add the
gcp extra via
pip install prefect[gcp]
In order to use this agent with Prefect Server the server's GraphQL API endpoint must be accessible. This may require changes to your Prefect Server deployment and/or configuring the Prefect API address on the agent.
# Flow Configuration
The Vertex Agent will deploy flows using either a
default) or VertexRun
run_config. Using a
VertexRun object lets you customize the deployment
environment for a flow (exposing
from prefect.run_configs import VertexRun
# Configure extra environment variables for this flow,
# and set a custom image and machine type
flow.run_config = VertexRun(
See the VertexRun documentation for more information.
# Agent Configuration
The Vertex agent can be started from the Prefect CLI as
prefect agent vertex start
API Keys Cloud
When using Prefect Cloud, this will require a service account API key, see here for more information.
Below we cover a few common configuration options, see the CLI docs for a full list of options.
By default the agent will deploy flow run tasks into the current project (as defined by google.auth.default)
You can specify a different project using the
prefect agent vertex start --project my-project
This can be a different project than the agent is running in, as long as the account has permissions to start Vertex Custom Jobs in the specified project.
Vertex requires a region in which to run the flow, and will default to
You can specify a different region using the
prefect agent vertex start --region-name us-east1
# Service Account
Vertex jobs can run as a specified service account. Vertex provides a default, but specifying a specific
account can give you more control over what resources the flow runs are allowed to access.
You can specify a non-default account using the
prefect agent vertex start --service-account email@example.com