Type object
File match prefect.toml
Schema URL https://catalog.lintel.tools/schemas/schemastore/prefect-toml/latest.json
Source https://raw.githubusercontent.com/PrefectHQ/prefect/refs/heads/main/schemas/settings.schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Settings for Prefect using Pydantic settings.

See https://docs.pydantic.dev/latest/concepts/pydantic_settings

Properties

home string

The path to the Prefect home directory. Defaults to ~/.prefect

Default: "~/.prefect"
format=path
profiles_path string

The path to a profiles configuration file. Supports $PREFECT_HOME templating. Defaults to $PREFECT_HOME/profiles.toml.

format=path
debug_mode boolean

If True, enables debug mode which may provide additional logging and debugging features.

Default: false
api object

Settings for interacting with the Prefect API

7 nested properties
url string | null

The URL of the Prefect API. If not set, the client will attempt to infer it.

Default: null
auth_string string | null

The auth string used for basic authentication with a self-hosted Prefect API. Should be kept secret.

Default: null
key string | null

The API key used for authentication with the Prefect API. Should be kept secret.

Default: null
tls_insecure_skip_verify boolean

If True, disables SSL checking to allow insecure requests. Setting to False is recommended only during development. For example, when using self-signed certificates.

Default: false
ssl_cert_file string | null

This configuration settings option specifies the path to an SSL certificate file.

Default: null
enable_http2 boolean

If true, enable support for HTTP/2 for communicating with an API. If the API does not support HTTP/2, this will have no effect and connections will be made via HTTP/1.1.

Default: false
request_timeout number

The default timeout for requests to the API

Default: 60.0
cli object

Settings for controlling CLI behavior

3 nested properties
colors boolean

If True, use colors in CLI output. If False, output will not include colors codes.

Default: true
prompt boolean | null

If True, use interactive prompts in CLI commands. If False, no interactive prompts will be used. If None, the value will be dynamically determined based on the presence of an interactive-enabled terminal.

Default: null
wrap_lines boolean

If True, wrap text by inserting new lines in long lines in CLI output. If False, output will not be wrapped.

Default: true
client object

Settings for controlling API client behavior

7 nested properties
max_retries integer
    The maximum number of retries to perform on failed HTTP requests.
    Defaults to 5. Set to 0 to disable retries.
    See `PREFECT_CLIENT_RETRY_EXTRA_CODES` for details on which HTTP status codes are
    retried.
Default: 5
min=0
retry_jitter_factor number
    A value greater than or equal to zero to control the amount of jitter added to retried
    client requests. Higher values introduce larger amounts of jitter.
    Set to 0 to disable jitter. See `clamped_poisson_interval` for details on the how jitter
    can affect retry lengths.
Default: 0.2
min=0.0
retry_extra_codes string | integer | integer[] | null
    A list of extra HTTP status codes to retry on. Defaults to an empty list.
    429, 502 and 503 are always retried. Please note that not all routes are idempotent and retrying
    may result in unexpected behavior.
Examples: "404,429,503", "429", [404,429,503]
csrf_support_enabled boolean
    Determines if CSRF token handling is active in the Prefect client for API
    requests.

    When enabled (`True`), the client automatically manages CSRF tokens by
    retrieving, storing, and including them in applicable state-changing requests
Default: true
custom_headers Record<string, string>
    Custom HTTP headers to include with every API request to the Prefect server.
    Headers are specified as key-value pairs. Note that headers like 'User-Agent'
    and CSRF-related headers are managed by Prefect and cannot be overridden.
Examples: {"X-Custom-Header":"value"}, {"Authorization":"Bearer token"}
server_version_check_enabled boolean
    Whether the client should check the server's API version on startup.
    When disabled, the client will skip the call to /admin/version that
    normally runs once per client context entry.  This is useful for worker
    subprocesses that inherit a known-compatible server configuration and
    do not need to repeat the version handshake.
Default: true
metrics object

Settings for controlling metrics reporting from the client

2 nested properties
enabled boolean

Whether or not to enable Prometheus metrics in the client.

Default: false
port integer

The port to expose the client Prometheus metrics on.

Default: 4201
cloud object

Settings for interacting with Prefect Cloud

4 nested properties
api_url string

API URL for Prefect Cloud. Used for authentication with Prefect Cloud.

Default: "https://api.prefect.cloud/api"
enable_orchestration_telemetry boolean

Whether or not to enable orchestration telemetry.

Default: true
max_log_size integer

Maximum size in characters for a single log when sending logs to Prefect Cloud.

Default: 25000
ui_url string | null

The URL of the Prefect Cloud UI. If not set, the client will attempt to infer it.

Default: null
deployments object

Settings for configuring deployments defaults

2 nested properties
default_work_pool_name string | null

The default work pool to use when creating deployments.

Default: null
default_docker_build_namespace string | null

The default Docker namespace to use when building images.

Default: null
Examples: "my-dockerhub-registry", "4999999999999.dkr.ecr.us-east-2.amazonaws.com/my-ecr-repo"
events object

Settings for controlling events behavior

1 nested properties
worker_max_queue_size integer
    Maximum number of events that can be queued for delivery to the
    Prefect server. When the queue is full, new events are dropped with
    a warning. Set to 0 for unbounded (the default).

    Warning: setting this value too low may result in data loss as events
    will be silently dropped when the queue is full.
Default: 0
min=0
experiments object

Settings for configuring experimental features

2 nested properties
warn boolean

If True, warn on usage of experimental features.

Default: true
plugins object

Settings for configuring the experimental plugin system

6 nested properties
enabled boolean

Enable the experimental plugin system.

Default: false
allow string[] | null

Comma-separated list of plugin names to allow. If set, only these plugins will be loaded.

Default: null
deny string[] | null

Comma-separated list of plugin names to deny. These plugins will not be loaded.

Default: null
setup_timeout_seconds number

Maximum time in seconds for all plugins to complete their setup hooks.

Default: 20.0
strict boolean

If True, exit if a required plugin fails during setup.

Default: false
safe_mode boolean

If True, load plugins but do not execute their hooks. Useful for testing.

Default: false
flows object

Settings for controlling flow behavior

3 nested properties
heartbeat_frequency integer | null

Number of seconds between flow run heartbeats. Heartbeats are used to detect crashed flow runs.

Default: 180
default_retries integer

This value sets the default number of retries for all flows.

Default: 0
min=0
default_retry_delay_seconds integer | number | number[]

This value sets the default retry delay seconds for all flows.

Default: 0
internal object
1 nested properties
logging_level string

The default logging level for Prefect's internal machinery loggers.

Default: "ERROR"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
logging object

Settings for controlling logging behavior

7 nested properties
level string

The default logging level for Prefect loggers.

Default: "INFO"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
config_path string

A path to a logging configuration file. Defaults to $PREFECT_HOME/logging.yml

format=path
extra_loggers string | string[] | null

Additional loggers to attach to Prefect logging at runtime.

Default: null
log_prints boolean

If True, print statements in flows and tasks will be redirected to the Prefect logger for the given run.

Default: false
colors boolean

If True, use colors in CLI output. If False, output will not include colors codes.

Default: true
markup boolean
    Whether to interpret strings wrapped in square brackets as a style.
    This allows styles to be conveniently added to log messages, e.g.
    `[red]This is a red message.[/red]`. However, the downside is, if enabled,
    strings that contain square brackets may be inaccurately interpreted and
    lead to incomplete output, e.g.
    `[red]This is a red message.[/red]` may be interpreted as
    `[red]This is a red message.[/red]`.
Default: false
to_api object

Settings for controlling logging to the API

5 nested properties
enabled boolean

If True, logs will be sent to the API.

Default: true
batch_interval number

The number of seconds between batched writes of logs to the API.

Default: 2.0
batch_size integer

The number of logs to batch before sending to the API.

Default: 4000000
max_log_size integer

The maximum size in characters for a single log. When connected to Prefect Cloud, this value is capped at PREFECT_CLOUD_MAX_LOG_SIZE (default 25,000).

Default: 1000000
when_missing_flow string
    Controls the behavior when loggers attempt to send logs to the API handler from outside of a flow.
    
    All logs sent to the API must be associated with a flow run. The API log handler can
    only be used outside of a flow by manually providing a flow run identifier. Logs
    that are not associated with a flow run will not be sent to the API. This setting can
    be used to determine if a warning or error is displayed when the identifier is missing.

    The following options are available:

    - "warn": Log a warning message.
    - "error": Raise an error.
    - "ignore": Do not log a warning message or raise an error.
Default: "warn"
Values: "warn" "error" "ignore"
results object

Settings for controlling result storage behavior

4 nested properties
default_serializer string

The default serializer to use when not otherwise specified.

Default: "pickle"
persist_by_default boolean

The default setting for persisting results when not otherwise specified.

Default: false
default_storage_block string | null

The block-type/block-document slug of a block to use as the default result storage.

Default: null
local_storage_path string

The default location for locally persisted results. Defaults to $PREFECT_HOME/storage.

format=path
runner object

Settings for controlling runner behavior

4 nested properties
process_limit integer

Maximum number of processes a runner will execute in parallel.

Default: 5
poll_frequency integer

Number of seconds a runner should wait between queries for scheduled work.

Default: 10
crash_on_cancellation_failure boolean

Whether to crash flow runs and shut down the runner when cancellation observing fails. When enabled, if both websocket and polling mechanisms for detecting cancellation events fail, all in-flight flow runs will be marked as crashed and the runner will shut down. When disabled (default), the runner will log an error but continue executing flow runs.

Default: false
server object

Settings for controlling runner server behavior

5 nested properties
enable boolean

Whether or not to enable the runner's webserver.

Default: false
host string

The host address the runner's webserver should bind to.

Default: "localhost"
port integer

The port the runner's webserver should bind to.

Default: 8080
log_level string

The log level of the runner's webserver.

Default: "ERROR"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
missed_polls_tolerance integer

Number of missed polls before a runner is considered unhealthy by its webserver.

Default: 2
server object

Settings for controlling server behavior

20 nested properties
logging_level string

The default logging level for the Prefect API server.

Default: "WARNING"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
analytics_enabled boolean
    When enabled, Prefect sends anonymous data (e.g. count of flow runs, package version)
    on server startup to help us improve our product.
Default: true
metrics_enabled boolean

Whether or not to enable Prometheus metrics in the API.

Default: false
log_retryable_errors boolean

If True, log retryable errors in the API and it's services.

Default: false
register_blocks_on_start boolean

If set, any block types that have been imported will be registered with the backend on application startup. If not set, block types must be manually registered.

Default: true
memoize_block_auto_registration boolean

Controls whether or not block auto-registration on start

Default: true
memo_store_path string

Path to the memo store file. Defaults to $PREFECT_HOME/memo_store.toml

format=path
deployment_schedule_max_scheduled_runs integer

The maximum number of scheduled runs to create for a deployment.

Default: 50
api object

Settings for controlling API server behavior

12 nested properties
auth_string string | null

A string to use for basic authentication with the API in the form 'user:password'.

Default: null
host string

The API's host address (defaults to 127.0.0.1).

Default: "127.0.0.1"
port integer

The API's port address (defaults to 4200).

Default: 4200
base_path string | null

The base URL path to serve the API under.

Default: null
Examples: "/v2/api"
default_limit integer

The default limit applied to queries that can return multiple objects, such as POST /flow_runs/filter.

Default: 200
keepalive_timeout integer
    The API's keep alive timeout (defaults to `5`).
    Refer to <https://www.uvicorn.org/settings/#timeouts> for details.

    When the API is hosted behind a load balancer, you may want to set this to a value
    greater than the load balancer's idle timeout.

    Note this setting only applies when calling `prefect server start`; if hosting the
    API with another tool you will need to configure this there instead.
Default: 5
csrf_protection_enabled boolean
    Controls the activation of CSRF protection for the Prefect server API.

    When enabled (`True`), the server enforces CSRF validation checks on incoming
    state-changing requests (POST, PUT, PATCH, DELETE), requiring a valid CSRF
    token to be included in the request headers or body. This adds a layer of
    security by preventing unauthorized or malicious sites from making requests on
    behalf of authenticated users.

    It is recommended to enable this setting in production environments where the
    API is exposed to web clients to safeguard against CSRF attacks.

    Note: Enabling this setting requires corresponding support in the client for
    CSRF token management. See PREFECT_CLIENT_CSRF_SUPPORT_ENABLED for more.
Default: false
csrf_token_expiration string
    Specifies the duration for which a CSRF token remains valid after being issued
    by the server.

    The default expiration time is set to 1 hour, which offers a reasonable
    compromise. Adjust this setting based on your specific security requirements
    and usage patterns.
Default: "PT1H"
format=duration
cors_allowed_origins string
    A comma-separated list of origins that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all origins.
Default: "*"
cors_allowed_methods string
    A comma-separated list of methods that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all methods.
Default: "*"
cors_allowed_headers string
    A comma-separated list of headers that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all headers.
Default: "*"
max_parameter_size integer

The maximum size of parameters (in bytes, JSON-serialized) that can be stored on a flow run or deployment. Set to 0 to disable the limit.

Default: 524288
min=0
concurrency object
3 nested properties
lease_storage string

The module to use for storing concurrency limit leases.

Default: "prefect.server.concurrency.lease_storage.memory"
initial_deployment_lease_duration number

Initial duration for deployment concurrency lease in seconds.

Default: 300.0
min=30.0max=3600.0
maximum_concurrency_slot_wait_seconds number

The maximum number of seconds to wait before retrying when a concurrency slot cannot be acquired.

Default: 30
min=0
database object

Settings for controlling server database behavior

12 nested properties
sqlalchemy object

Settings for controlling SQLAlchemy behavior; note that these settings only take effect when using a PostgreSQL database.

5 nested properties
connect_args object

Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when using a PostgreSQL database.

pool_size integer

Controls connection pool size of database connection pools from the Prefect backend.

Default: 5
pool_recycle integer

This setting causes the pool to recycle connections after the given number of seconds has passed; set it to -1 to avoid recycling entirely.

Default: 3600
pool_timeout number | null

Number of seconds to wait before giving up on getting a connection from the pool. Defaults to 30 seconds.

Default: 30.0
max_overflow integer

Controls maximum overflow of the connection pool. To prevent overflow, set to -1.

Default: 10
connection_url string | null
    A database connection URL in a SQLAlchemy-compatible
    format. Prefect currently supports SQLite and Postgres. Note that all
    Prefect database engines must use an async driver - for SQLite, use
    `sqlite+aiosqlite` and for Postgres use `postgresql+asyncpg`.

    SQLite in-memory databases can be used by providing the url
    `sqlite+aiosqlite:///file::memory:?cache=shared&uri=true&check_same_thread=false`,
    which will allow the database to be accessed by multiple threads. Note
    that in-memory databases can not be accessed from multiple processes and
    should only be used for simple tests.
Default: null
driver string | null

The database driver to use when connecting to the database. If not set, the driver will be inferred from the connection URL.

Default: null
host string | null

The database server host.

Default: null
port integer | null

The database server port.

Default: null
user string | null

The user to use when connecting to the database.

Default: null
name string | null

The name of the Prefect database on the remote server, or the path to the database file for SQLite.

Default: null
password string | null

The password to use when connecting to the database. Should be kept secret.

Default: null
echo boolean

If True, SQLAlchemy will log all SQL issued to the database. Defaults to False.

Default: false
migrate_on_start boolean

If True, the database will be migrated on application startup.

Default: true
timeout number | null

A statement timeout, in seconds, applied to all database interactions made by the Prefect backend. Defaults to 10 seconds.

Default: 10.0
connection_timeout number | null

A connection timeout, in seconds, applied to database connections. Defaults to 5.

Default: 5.0
deployments object
1 nested properties
concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a deployment flow run cannot secure a concurrency slot from the server.

Default: 30.0
min=0.0
docket object

Settings for controlling Docket behavior

2 nested properties
name string

The name of the Docket instance.

Default: "prefect-server"
url string

The URL of the Redis server to use for Docket.

Default: "memory://"
ephemeral object

Settings for controlling ephemeral server behavior

2 nested properties
enabled boolean
    Controls whether or not a subprocess server can be started when no API URL is provided.
Default: false
startup_timeout_seconds integer
    The number of seconds to wait for the server to start when ephemeral mode is enabled.
    Defaults to `20`.
Default: 20
events object

Settings for controlling behavior of the events subsystem

14 nested properties
stream_out_enabled boolean

Whether or not to stream events out to the API via websockets.

Default: true
related_resource_cache_ttl string

The number of seconds to cache related resources for in the API.

Default: "PT5M"
format=duration
maximum_labels_per_resource integer

The maximum number of labels a resource may have.

Default: 500
maximum_related_resources integer

The maximum number of related resources an Event may have.

Default: 100
maximum_size_bytes integer

The maximum size of an Event when serialized to JSON

Default: 1500000
expired_bucket_buffer string

The amount of time to retain expired automation buckets

Default: "PT1M"
format=duration
proactive_granularity string

How frequently proactive automations are evaluated

Default: "PT5S"
format=duration
retention_period string

The amount of time to retain events in the database.

Default: "P7D"
format=duration
maximum_websocket_backfill string

The maximum range to look back for backfilling events for a websocket subscriber.

Default: "PT15M"
format=duration
websocket_backfill_page_size integer

The page size for the queries to backfill events for websocket subscribers.

Default: 250
exclusiveMin=0
messaging_broker string

Which message broker implementation to use for the messaging system, should point to a module that exports a Publisher and Consumer class.

Default: "prefect.server.utilities.messaging.memory"
messaging_cache string

Which cache implementation to use for the events system. Should point to a module that exports a Cache class.

Default: "prefect.server.utilities.messaging.memory"
causal_ordering string

Which causal ordering implementation to use for the events system. Should point to a module that exports a CausalOrdering class.

Default: "prefect.server.events.ordering.memory"
maximum_event_name_length integer

The maximum length of an event name.

Default: 1024
exclusiveMin=0
flow_run_graph object

Settings for controlling behavior of the flow run graph

2 nested properties
max_nodes integer

The maximum size of a flow run graph on the v2 API

Default: 10000
max_artifacts integer

The maximum number of artifacts to show on a flow run graph on the v2 API

Default: 10000
logs object

Settings for controlling behavior of the logs subsystem

2 nested properties
stream_out_enabled boolean

Whether or not to stream logs out to the API via websockets.

Default: false
stream_publishing_enabled boolean

Whether or not to publish logs to the streaming system.

Default: false
services object

Settings for controlling server services

11 nested properties
cancellation_cleanup object

Settings for controlling the cancellation cleanup service

2 nested properties
enabled boolean

Whether or not to start the cancellation cleanup service in the server application.

Default: true
loop_seconds number

The cancellation cleanup service will look for non-terminal tasks and subflows this often. Defaults to 20.

Default: 20
db_vacuum object

Settings for controlling the database vacuum service

5 nested properties
enabled string[] | boolean | null

Comma-separated set of vacuum types to enable. Valid values: 'events', 'flow_runs'. Defaults to 'events'. For backward compatibility, 'true' maps to 'events,flow_runs' and 'false' maps to 'events'. Event vacuum also requires event_persister.enabled (the default).

Default:
[
  "events"
]
loop_seconds number

The database vacuum service will run this often, in seconds. Defaults to 3600 (1 hour).

Default: 3600
exclusiveMin=0
retention_period string

How old a flow run must be (based on end_time) before it is eligible for deletion. Accepts seconds. Minimum 1 hour. Defaults to 90 days.

Default: "P90D"
format=duration
batch_size integer

The number of records to delete per database transaction. Defaults to 200.

Default: 200
exclusiveMin=0
event_retention_overrides Record<string, string>

Per-event-type retention period overrides. Keys are event type strings (e.g. 'prefect.flow-run.heartbeat'), values are retention periods in seconds. Event types not listed fall back to server.events.retention_period. Each override is capped by the global events retention period.

Default:
{
  "prefect.flow-run.heartbeat": "P7D"
}
event_persister object

Settings for controlling the event persister service

6 nested properties
enabled boolean

Whether or not to start the event persister service in the server application.

Default: true
batch_size integer

The number of events the event persister will attempt to insert in one batch.

Default: 20
exclusiveMin=0
read_batch_size integer

The number of events the event persister will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the event persister.

Default: 5
exclusiveMin=0.0
queue_max_size integer

The maximum number of events that can be queued in memory for persistence. When the queue is full, new events will be dropped.

Default: 50000
exclusiveMin=0
max_flush_retries integer

The maximum number of consecutive flush failures before events are dropped instead of being re-queued.

Default: 5
exclusiveMin=0
event_logger object

Settings for controlling the event logger service

1 nested properties
enabled boolean

Whether or not to start the event logger service in the server application.

Default: false
foreman object

Settings for controlling the foreman service

6 nested properties
enabled boolean

Whether or not to start the foreman service in the server application.

Default: true
loop_seconds number

The foreman service will check for offline workers this often. Defaults to 15.

Default: 15
inactivity_heartbeat_multiple integer
    The number of heartbeats that must be missed before a worker is marked as offline. Defaults to `3`.
Default: 3
fallback_heartbeat_interval_seconds integer
    The number of seconds to use for online/offline evaluation if a worker's heartbeat
    interval is not set. Defaults to `30`.
Default: 30
deployment_last_polled_timeout_seconds integer
    The number of seconds before a deployment is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
work_queue_last_polled_timeout_seconds integer
    The number of seconds before a work queue is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
late_runs object

Settings for controlling the late runs service

3 nested properties
enabled boolean

Whether or not to start the late runs service in the server application.

Default: true
loop_seconds number
    The late runs service will look for runs to mark as late this often. Defaults to `5`.
Default: 5
after_seconds string
    The late runs service will mark runs as late after they have exceeded their scheduled start time by this many seconds. Defaults to `5` seconds.
Default: "PT15S"
format=duration
scheduler object

Settings for controlling the scheduler service

9 nested properties
enabled boolean

Whether or not to start the scheduler service in the server application.

Default: true
loop_seconds number
    The scheduler loop interval, in seconds. This determines
    how often the scheduler will attempt to schedule new flow runs, but has no
    impact on how quickly either flow runs or task runs are actually executed.
    Defaults to `60`.
Default: 60
deployment_batch_size integer
    The number of deployments the scheduler will attempt to
    schedule in a single batch. If there are more deployments than the batch
    size, the scheduler immediately attempts to schedule the next batch; it
    does not sleep for `scheduler_loop_seconds` until it has visited every
    deployment once. Defaults to `100`.
Default: 100
max_runs integer
    The scheduler will attempt to schedule up to this many
    auto-scheduled runs in the future. Note that runs may have fewer than
    this many scheduled runs, depending on the value of
    `scheduler_max_scheduled_time`.  Defaults to `100`.
Default: 100
min_runs integer
    The scheduler will attempt to schedule at least this many
    auto-scheduled runs in the future. Note that runs may have more than
    this many scheduled runs, depending on the value of
    `scheduler_min_scheduled_time`.  Defaults to `3`.
Default: 3
max_scheduled_time string
    The scheduler will create new runs up to this far in the
    future. Note that this setting will take precedence over
    `scheduler_max_runs`: if a flow runs once a month and
    `scheduler_max_scheduled_time` is three months, then only three runs will be
    scheduled. Defaults to 100 days (`8640000` seconds).
Default: "P100D"
format=duration
min_scheduled_time string
    The scheduler will create new runs at least this far in the
    future. Note that this setting will take precedence over `scheduler_min_runs`:
    if a flow runs every hour and `scheduler_min_scheduled_time` is three hours,
    then three runs will be scheduled even if `scheduler_min_runs` is 1. Defaults to
Default: "PT1H"
format=duration
insert_batch_size integer
    The number of runs the scheduler will attempt to insert in a single batch.
    Defaults to `500`.
Default: 500
recent_deployments_loop_seconds number
    The number of seconds the recent deployments scheduler will wait between checking for recently updated deployments. Defaults to `5`.
Default: 5
pause_expirations object

Settings for controlling the pause expiration service

2 nested properties
enabled boolean
    Whether or not to start the paused flow run expiration service in the server
    application. If disabled, paused flows that have timed out will remain in a Paused state
    until a resume attempt.
Default: true
loop_seconds number
    The pause expiration service will look for runs to mark as failed this often. Defaults to `5`.
Default: 5
repossessor object

Settings for controlling the repossessor service

2 nested properties
enabled boolean

Whether or not to start the repossessor service in the server application.

Default: true
loop_seconds number

The repossessor service will look for expired leases this often. Defaults to 15.

Default: 15
task_run_recorder object

Settings for controlling the task run recorder service

4 nested properties
enabled boolean

Whether or not to start the task run recorder service in the server application.

Default: true
read_batch_size integer

The number of task runs the task run recorder will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
batch_size integer

The number of task runs the task run recorder will attempt to insert in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the task run recorder.

Default: 5
exclusiveMin=0.0
triggers object

Settings for controlling the triggers service

4 nested properties
enabled boolean

Whether or not to start the triggers service in the server application.

Default: true
read_batch_size integer

The number of events the triggers service will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
pg_notify_reconnect_interval_seconds integer
    The number of seconds to wait before reconnecting to the PostgreSQL NOTIFY/LISTEN 
    connection after an error. Only used when using PostgreSQL as the database.
    Defaults to `10`.
Default: 10
pg_notify_heartbeat_interval_seconds integer
    The number of seconds between heartbeat checks for the PostgreSQL NOTIFY/LISTEN 
    connection to ensure it's still alive. Only used when using PostgreSQL as the database.
    Defaults to `5`.
Default: 5
tasks object

Settings for controlling server-side behavior related to tasks

3 nested properties
tag_concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a task run cannot secure a concurrency slot from the server.

Default: 10
min=0
max_cache_key_length integer

The maximum number of characters allowed for a task run cache key.

Default: 2000
scheduling object

Settings for controlling server-side behavior related to task scheduling

3 nested properties
max_scheduled_queue_size integer

The maximum number of scheduled tasks to queue for submission.

Default: 1000
max_retry_queue_size integer

The maximum number of retries to queue for submission.

Default: 100
pending_task_timeout string

How long before a PENDING task are made available to another task worker.

Default: "PT0S"
format=duration
ui object
6 nested properties
enabled boolean

Whether or not to serve the Prefect UI.

Default: true
v2_enabled boolean

Whether to serve the experimental V2 UI instead of the default V1 UI.

Default: false
api_url string | null

The connection url for communication from the UI to the API. Defaults to PREFECT_API_URL if set. Otherwise, the default URL is generated from PREFECT_SERVER_API_HOST and PREFECT_SERVER_API_PORT.

Default: null
serve_base string

The base URL path to serve the Prefect UI from.

Default: "/"
static_directory string | null

The directory to serve static files from. This should be used when running into permissions issues when attempting to serve the UI from the default directory (for example when running in a Docker container).

Default: null
show_promotional_content boolean

Whether or not to display promotional content in the UI, including upgrade prompts and marketing banners.

Default: true
tasks object
8 nested properties
refresh_cache boolean

If True, enables a refresh of cached results: re-executing the task will refresh the cached results.

Default: false
default_no_cache boolean

If True, sets the default cache policy on all tasks to NO_CACHE.

Default: false
disable_caching boolean

If True, disables caching on all tasks regardless of cache policy.

Default: false
default_retries integer

This value sets the default number of retries for all tasks.

Default: 0
min=0
default_retry_delay_seconds string | integer | number | number[] | null

This value sets the default retry delay seconds for all tasks.

Default: 0
default_persist_result boolean | null

If True, results will be persisted by default for all tasks. Set to False to disable persistence by default. Note that setting to False will override the behavior set by a parent flow or task.

Default: null
runner object
2 nested properties
thread_pool_max_workers integer | null

The maximum number of workers for ThreadPoolTaskRunner.

Default: null
process_pool_max_workers integer | null

The maximum number of workers for ProcessPoolTaskRunner.

Default: null
scheduling object
2 nested properties
default_storage_block string | null

The block-type/block-document slug of a block to use as the default storage for autonomous tasks.

Default: null
delete_failed_submissions boolean

Whether or not to delete failed task submissions from the database.

Default: true
telemetry object

Settings for configuring Prefect telemetry

2 nested properties
enable_resource_metrics boolean

Whether to enable OS-level resource metric collection in flow run subprocesses.

Default: true
resource_metrics_interval_seconds integer

Interval in seconds between resource metric collections.

Default: 10
min=1
testing object
4 nested properties
test_mode boolean

If True, places the API in test mode. This may modify behavior to facilitate testing.

Default: false
unit_test_mode boolean

This setting only exists to facilitate unit testing. If True, code is executing in a unit test context. Defaults to False.

Default: false
unit_test_loop_debug boolean

If True turns on debug mode for the unit testing event loop.

Default: true
test_setting null

This setting only exists to facilitate unit testing. If in test mode, this setting will return its value. Otherwise, it returns None.

Default: "FOO"
worker object
7 nested properties
debug_mode boolean

If True, enables debug mode for the worker only. Unlike PREFECT_DEBUG_MODE, this setting does not propagate to flow runs executed by the worker.

Default: false
heartbeat_seconds number

Number of seconds a worker should wait between sending a heartbeat.

Default: 30
query_seconds number

Number of seconds a worker should wait between queries for scheduled work.

Default: 10
prefetch_seconds number

The number of seconds into the future a worker should query for scheduled work.

Default: 10
enable_cancellation boolean

Enable worker-side flow run cancellation for pending flow runs. When enabled, the worker will terminate infrastructure for flow runs that are cancelled while still in PENDING state (before the runner starts).

Default: false
cancellation_poll_seconds number

Number of seconds between polls for cancelling flow runs. Used as a fallback when the WebSocket connection for real-time cancellation events is unavailable.

Default: 120
webserver object
2 nested properties
host string

The host address the worker's webserver should bind to.

Default: "0.0.0.0"
port integer

The port the worker's webserver should bind to.

Default: 8080
ui_url string | null

The URL of the Prefect UI. If not set, the client will attempt to infer it.

Default: null
silence_api_url_misconfiguration boolean
    If `True`, disable the warning when a user accidentally misconfigure its `PREFECT_API_URL`
    Sometimes when a user manually set `PREFECT_API_URL` to a custom url,reverse-proxy for example,
    we would like to silence this warning so we will set it to `FALSE`.
Default: false

Definitions

APISettings object

Settings for interacting with the Prefect API

url string | null

The URL of the Prefect API. If not set, the client will attempt to infer it.

Default: null
auth_string string | null

The auth string used for basic authentication with a self-hosted Prefect API. Should be kept secret.

Default: null
key string | null

The API key used for authentication with the Prefect API. Should be kept secret.

Default: null
tls_insecure_skip_verify boolean

If True, disables SSL checking to allow insecure requests. Setting to False is recommended only during development. For example, when using self-signed certificates.

Default: false
ssl_cert_file string | null

This configuration settings option specifies the path to an SSL certificate file.

Default: null
enable_http2 boolean

If true, enable support for HTTP/2 for communicating with an API. If the API does not support HTTP/2, this will have no effect and connections will be made via HTTP/1.1.

Default: false
request_timeout number

The default timeout for requests to the API

Default: 60.0
CLISettings object

Settings for controlling CLI behavior

colors boolean

If True, use colors in CLI output. If False, output will not include colors codes.

Default: true
prompt boolean | null

If True, use interactive prompts in CLI commands. If False, no interactive prompts will be used. If None, the value will be dynamically determined based on the presence of an interactive-enabled terminal.

Default: null
wrap_lines boolean

If True, wrap text by inserting new lines in long lines in CLI output. If False, output will not be wrapped.

Default: true
ClientMetricsSettings object

Settings for controlling metrics reporting from the client

enabled boolean

Whether or not to enable Prometheus metrics in the client.

Default: false
port integer

The port to expose the client Prometheus metrics on.

Default: 4201
ClientSettings object

Settings for controlling API client behavior

max_retries integer
    The maximum number of retries to perform on failed HTTP requests.
    Defaults to 5. Set to 0 to disable retries.
    See `PREFECT_CLIENT_RETRY_EXTRA_CODES` for details on which HTTP status codes are
    retried.
Default: 5
min=0
retry_jitter_factor number
    A value greater than or equal to zero to control the amount of jitter added to retried
    client requests. Higher values introduce larger amounts of jitter.
    Set to 0 to disable jitter. See `clamped_poisson_interval` for details on the how jitter
    can affect retry lengths.
Default: 0.2
min=0.0
retry_extra_codes string | integer | integer[] | null
    A list of extra HTTP status codes to retry on. Defaults to an empty list.
    429, 502 and 503 are always retried. Please note that not all routes are idempotent and retrying
    may result in unexpected behavior.
Examples: "404,429,503", "429", [404,429,503]
csrf_support_enabled boolean
    Determines if CSRF token handling is active in the Prefect client for API
    requests.

    When enabled (`True`), the client automatically manages CSRF tokens by
    retrieving, storing, and including them in applicable state-changing requests
Default: true
custom_headers Record<string, string>
    Custom HTTP headers to include with every API request to the Prefect server.
    Headers are specified as key-value pairs. Note that headers like 'User-Agent'
    and CSRF-related headers are managed by Prefect and cannot be overridden.
Examples: {"X-Custom-Header":"value"}, {"Authorization":"Bearer token"}
server_version_check_enabled boolean
    Whether the client should check the server's API version on startup.
    When disabled, the client will skip the call to /admin/version that
    normally runs once per client context entry.  This is useful for worker
    subprocesses that inherit a known-compatible server configuration and
    do not need to repeat the version handshake.
Default: true
metrics object

Settings for controlling metrics reporting from the client

2 nested properties
enabled boolean

Whether or not to enable Prometheus metrics in the client.

Default: false
port integer

The port to expose the client Prometheus metrics on.

Default: 4201
CloudSettings object

Settings for interacting with Prefect Cloud

api_url string

API URL for Prefect Cloud. Used for authentication with Prefect Cloud.

Default: "https://api.prefect.cloud/api"
enable_orchestration_telemetry boolean

Whether or not to enable orchestration telemetry.

Default: true
max_log_size integer

Maximum size in characters for a single log when sending logs to Prefect Cloud.

Default: 25000
ui_url string | null

The URL of the Prefect Cloud UI. If not set, the client will attempt to infer it.

Default: null
DeploymentsSettings object

Settings for configuring deployments defaults

default_work_pool_name string | null

The default work pool to use when creating deployments.

Default: null
default_docker_build_namespace string | null

The default Docker namespace to use when building images.

Default: null
Examples: "my-dockerhub-registry", "4999999999999.dkr.ecr.us-east-2.amazonaws.com/my-ecr-repo"
EventsSettings object

Settings for controlling events behavior

worker_max_queue_size integer
    Maximum number of events that can be queued for delivery to the
    Prefect server. When the queue is full, new events are dropped with
    a warning. Set to 0 for unbounded (the default).

    Warning: setting this value too low may result in data loss as events
    will be silently dropped when the queue is full.
Default: 0
min=0
ExperimentsSettings object

Settings for configuring experimental features

warn boolean

If True, warn on usage of experimental features.

Default: true
plugins object

Settings for configuring the experimental plugin system

6 nested properties
enabled boolean

Enable the experimental plugin system.

Default: false
allow string[] | null

Comma-separated list of plugin names to allow. If set, only these plugins will be loaded.

Default: null
deny string[] | null

Comma-separated list of plugin names to deny. These plugins will not be loaded.

Default: null
setup_timeout_seconds number

Maximum time in seconds for all plugins to complete their setup hooks.

Default: 20.0
strict boolean

If True, exit if a required plugin fails during setup.

Default: false
safe_mode boolean

If True, load plugins but do not execute their hooks. Useful for testing.

Default: false
FlowsSettings object

Settings for controlling flow behavior

heartbeat_frequency integer | null

Number of seconds between flow run heartbeats. Heartbeats are used to detect crashed flow runs.

Default: 180
default_retries integer

This value sets the default number of retries for all flows.

Default: 0
min=0
default_retry_delay_seconds integer | number | number[]

This value sets the default retry delay seconds for all flows.

Default: 0
InternalSettings object
logging_level string

The default logging level for Prefect's internal machinery loggers.

Default: "ERROR"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
LoggingSettings object

Settings for controlling logging behavior

level string

The default logging level for Prefect loggers.

Default: "INFO"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
config_path string

A path to a logging configuration file. Defaults to $PREFECT_HOME/logging.yml

format=path
extra_loggers string | string[] | null

Additional loggers to attach to Prefect logging at runtime.

Default: null
log_prints boolean

If True, print statements in flows and tasks will be redirected to the Prefect logger for the given run.

Default: false
colors boolean

If True, use colors in CLI output. If False, output will not include colors codes.

Default: true
markup boolean
    Whether to interpret strings wrapped in square brackets as a style.
    This allows styles to be conveniently added to log messages, e.g.
    `[red]This is a red message.[/red]`. However, the downside is, if enabled,
    strings that contain square brackets may be inaccurately interpreted and
    lead to incomplete output, e.g.
    `[red]This is a red message.[/red]` may be interpreted as
    `[red]This is a red message.[/red]`.
Default: false
to_api object

Settings for controlling logging to the API

5 nested properties
enabled boolean

If True, logs will be sent to the API.

Default: true
batch_interval number

The number of seconds between batched writes of logs to the API.

Default: 2.0
batch_size integer

The number of logs to batch before sending to the API.

Default: 4000000
max_log_size integer

The maximum size in characters for a single log. When connected to Prefect Cloud, this value is capped at PREFECT_CLOUD_MAX_LOG_SIZE (default 25,000).

Default: 1000000
when_missing_flow string
    Controls the behavior when loggers attempt to send logs to the API handler from outside of a flow.
    
    All logs sent to the API must be associated with a flow run. The API log handler can
    only be used outside of a flow by manually providing a flow run identifier. Logs
    that are not associated with a flow run will not be sent to the API. This setting can
    be used to determine if a warning or error is displayed when the identifier is missing.

    The following options are available:

    - "warn": Log a warning message.
    - "error": Raise an error.
    - "ignore": Do not log a warning message or raise an error.
Default: "warn"
Values: "warn" "error" "ignore"
LoggingToAPISettings object

Settings for controlling logging to the API

enabled boolean

If True, logs will be sent to the API.

Default: true
batch_interval number

The number of seconds between batched writes of logs to the API.

Default: 2.0
batch_size integer

The number of logs to batch before sending to the API.

Default: 4000000
max_log_size integer

The maximum size in characters for a single log. When connected to Prefect Cloud, this value is capped at PREFECT_CLOUD_MAX_LOG_SIZE (default 25,000).

Default: 1000000
when_missing_flow string
    Controls the behavior when loggers attempt to send logs to the API handler from outside of a flow.
    
    All logs sent to the API must be associated with a flow run. The API log handler can
    only be used outside of a flow by manually providing a flow run identifier. Logs
    that are not associated with a flow run will not be sent to the API. This setting can
    be used to determine if a warning or error is displayed when the identifier is missing.

    The following options are available:

    - "warn": Log a warning message.
    - "error": Raise an error.
    - "ignore": Do not log a warning message or raise an error.
Default: "warn"
Values: "warn" "error" "ignore"
PluginsSettings object

Settings for configuring the experimental plugin system

enabled boolean

Enable the experimental plugin system.

Default: false
allow string[] | null

Comma-separated list of plugin names to allow. If set, only these plugins will be loaded.

Default: null
deny string[] | null

Comma-separated list of plugin names to deny. These plugins will not be loaded.

Default: null
setup_timeout_seconds number

Maximum time in seconds for all plugins to complete their setup hooks.

Default: 20.0
strict boolean

If True, exit if a required plugin fails during setup.

Default: false
safe_mode boolean

If True, load plugins but do not execute their hooks. Useful for testing.

Default: false
ResultsSettings object

Settings for controlling result storage behavior

default_serializer string

The default serializer to use when not otherwise specified.

Default: "pickle"
persist_by_default boolean

The default setting for persisting results when not otherwise specified.

Default: false
default_storage_block string | null

The block-type/block-document slug of a block to use as the default result storage.

Default: null
local_storage_path string

The default location for locally persisted results. Defaults to $PREFECT_HOME/storage.

format=path
RunnerServerSettings object

Settings for controlling runner server behavior

enable boolean

Whether or not to enable the runner's webserver.

Default: false
host string

The host address the runner's webserver should bind to.

Default: "localhost"
port integer

The port the runner's webserver should bind to.

Default: 8080
log_level string

The log level of the runner's webserver.

Default: "ERROR"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
missed_polls_tolerance integer

Number of missed polls before a runner is considered unhealthy by its webserver.

Default: 2
RunnerSettings object

Settings for controlling runner behavior

process_limit integer

Maximum number of processes a runner will execute in parallel.

Default: 5
poll_frequency integer

Number of seconds a runner should wait between queries for scheduled work.

Default: 10
crash_on_cancellation_failure boolean

Whether to crash flow runs and shut down the runner when cancellation observing fails. When enabled, if both websocket and polling mechanisms for detecting cancellation events fail, all in-flight flow runs will be marked as crashed and the runner will shut down. When disabled (default), the runner will log an error but continue executing flow runs.

Default: false
server object

Settings for controlling runner server behavior

5 nested properties
enable boolean

Whether or not to enable the runner's webserver.

Default: false
host string

The host address the runner's webserver should bind to.

Default: "localhost"
port integer

The port the runner's webserver should bind to.

Default: 8080
log_level string

The log level of the runner's webserver.

Default: "ERROR"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
missed_polls_tolerance integer

Number of missed polls before a runner is considered unhealthy by its webserver.

Default: 2
SQLAlchemyConnectArgsSettings object

Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when using a PostgreSQL database.

application_name string | null

Controls the application_name field for connections opened from the connection pool when using a PostgreSQL database with the Prefect backend.

Default: null
search_path string | null

PostgreSQL schema name to set in search_path when using a PostgreSQL database with the Prefect backend. Note: The public schema should be included in the search path (e.g. 'myschema, public') to ensure that pg_trgm and other extensions remain available.

Default: null
statement_cache_size integer | null

Controls statement cache size for PostgreSQL connections. Setting this to 0 is required when using PgBouncer in transaction mode. Defaults to None.

Default: null
prepared_statement_cache_size integer | null

Controls the size of the statement cache for PostgreSQL connections. When set to 0, statement caching is disabled. Defaults to None to use SQLAlchemy's default behavior.

Default: null
tls object

Settings for controlling SQLAlchemy mTLS context when using a PostgreSQL database.

5 nested properties
enabled boolean

Controls whether connected to mTLS enabled PostgreSQL when using a PostgreSQL database with the Prefect backend.

Default: false
ca_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate authority file.

Default: null
cert_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate file.

Default: null
key_file string | null

This configuration settings option specifies the path to PostgreSQL client key file.

Default: null
check_hostname boolean

This configuration settings option specifies whether to verify PostgreSQL server hostname.

Default: true
SQLAlchemySettings object

Settings for controlling SQLAlchemy behavior; note that these settings only take effect when using a PostgreSQL database.

connect_args object

Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when using a PostgreSQL database.

5 nested properties
application_name string | null

Controls the application_name field for connections opened from the connection pool when using a PostgreSQL database with the Prefect backend.

Default: null
search_path string | null

PostgreSQL schema name to set in search_path when using a PostgreSQL database with the Prefect backend. Note: The public schema should be included in the search path (e.g. 'myschema, public') to ensure that pg_trgm and other extensions remain available.

Default: null
statement_cache_size integer | null

Controls statement cache size for PostgreSQL connections. Setting this to 0 is required when using PgBouncer in transaction mode. Defaults to None.

Default: null
prepared_statement_cache_size integer | null

Controls the size of the statement cache for PostgreSQL connections. When set to 0, statement caching is disabled. Defaults to None to use SQLAlchemy's default behavior.

Default: null
tls object

Settings for controlling SQLAlchemy mTLS context when using a PostgreSQL database.

5 nested properties
enabled boolean

Controls whether connected to mTLS enabled PostgreSQL when using a PostgreSQL database with the Prefect backend.

Default: false
ca_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate authority file.

Default: null
cert_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate file.

Default: null
key_file string | null

This configuration settings option specifies the path to PostgreSQL client key file.

Default: null
check_hostname boolean

This configuration settings option specifies whether to verify PostgreSQL server hostname.

Default: true
pool_size integer

Controls connection pool size of database connection pools from the Prefect backend.

Default: 5
pool_recycle integer

This setting causes the pool to recycle connections after the given number of seconds has passed; set it to -1 to avoid recycling entirely.

Default: 3600
pool_timeout number | null

Number of seconds to wait before giving up on getting a connection from the pool. Defaults to 30 seconds.

Default: 30.0
max_overflow integer

Controls maximum overflow of the connection pool. To prevent overflow, set to -1.

Default: 10
SQLAlchemyTLSSettings object

Settings for controlling SQLAlchemy mTLS context when using a PostgreSQL database.

enabled boolean

Controls whether connected to mTLS enabled PostgreSQL when using a PostgreSQL database with the Prefect backend.

Default: false
ca_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate authority file.

Default: null
cert_file string | null

This configuration settings option specifies the path to PostgreSQL client certificate file.

Default: null
key_file string | null

This configuration settings option specifies the path to PostgreSQL client key file.

Default: null
check_hostname boolean

This configuration settings option specifies whether to verify PostgreSQL server hostname.

Default: true
ServerAPISettings object

Settings for controlling API server behavior

auth_string string | null

A string to use for basic authentication with the API in the form 'user:password'.

Default: null
host string

The API's host address (defaults to 127.0.0.1).

Default: "127.0.0.1"
port integer

The API's port address (defaults to 4200).

Default: 4200
base_path string | null

The base URL path to serve the API under.

Default: null
Examples: "/v2/api"
default_limit integer

The default limit applied to queries that can return multiple objects, such as POST /flow_runs/filter.

Default: 200
keepalive_timeout integer
    The API's keep alive timeout (defaults to `5`).
    Refer to <https://www.uvicorn.org/settings/#timeouts> for details.

    When the API is hosted behind a load balancer, you may want to set this to a value
    greater than the load balancer's idle timeout.

    Note this setting only applies when calling `prefect server start`; if hosting the
    API with another tool you will need to configure this there instead.
Default: 5
csrf_protection_enabled boolean
    Controls the activation of CSRF protection for the Prefect server API.

    When enabled (`True`), the server enforces CSRF validation checks on incoming
    state-changing requests (POST, PUT, PATCH, DELETE), requiring a valid CSRF
    token to be included in the request headers or body. This adds a layer of
    security by preventing unauthorized or malicious sites from making requests on
    behalf of authenticated users.

    It is recommended to enable this setting in production environments where the
    API is exposed to web clients to safeguard against CSRF attacks.

    Note: Enabling this setting requires corresponding support in the client for
    CSRF token management. See PREFECT_CLIENT_CSRF_SUPPORT_ENABLED for more.
Default: false
csrf_token_expiration string
    Specifies the duration for which a CSRF token remains valid after being issued
    by the server.

    The default expiration time is set to 1 hour, which offers a reasonable
    compromise. Adjust this setting based on your specific security requirements
    and usage patterns.
Default: "PT1H"
format=duration
cors_allowed_origins string
    A comma-separated list of origins that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all origins.
Default: "*"
cors_allowed_methods string
    A comma-separated list of methods that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all methods.
Default: "*"
cors_allowed_headers string
    A comma-separated list of headers that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all headers.
Default: "*"
max_parameter_size integer

The maximum size of parameters (in bytes, JSON-serialized) that can be stored on a flow run or deployment. Set to 0 to disable the limit.

Default: 524288
min=0
ServerConcurrencySettings object
lease_storage string

The module to use for storing concurrency limit leases.

Default: "prefect.server.concurrency.lease_storage.memory"
initial_deployment_lease_duration number

Initial duration for deployment concurrency lease in seconds.

Default: 300.0
min=30.0max=3600.0
maximum_concurrency_slot_wait_seconds number

The maximum number of seconds to wait before retrying when a concurrency slot cannot be acquired.

Default: 30
min=0
ServerDatabaseSettings object

Settings for controlling server database behavior

sqlalchemy object

Settings for controlling SQLAlchemy behavior; note that these settings only take effect when using a PostgreSQL database.

5 nested properties
connect_args object

Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when using a PostgreSQL database.

5 nested properties
application_name string | null

Controls the application_name field for connections opened from the connection pool when using a PostgreSQL database with the Prefect backend.

Default: null
search_path string | null

PostgreSQL schema name to set in search_path when using a PostgreSQL database with the Prefect backend. Note: The public schema should be included in the search path (e.g. 'myschema, public') to ensure that pg_trgm and other extensions remain available.

Default: null
statement_cache_size integer | null

Controls statement cache size for PostgreSQL connections. Setting this to 0 is required when using PgBouncer in transaction mode. Defaults to None.

Default: null
prepared_statement_cache_size integer | null

Controls the size of the statement cache for PostgreSQL connections. When set to 0, statement caching is disabled. Defaults to None to use SQLAlchemy's default behavior.

Default: null
tls object

Settings for controlling SQLAlchemy mTLS context when using a PostgreSQL database.

pool_size integer

Controls connection pool size of database connection pools from the Prefect backend.

Default: 5
pool_recycle integer

This setting causes the pool to recycle connections after the given number of seconds has passed; set it to -1 to avoid recycling entirely.

Default: 3600
pool_timeout number | null

Number of seconds to wait before giving up on getting a connection from the pool. Defaults to 30 seconds.

Default: 30.0
max_overflow integer

Controls maximum overflow of the connection pool. To prevent overflow, set to -1.

Default: 10
connection_url string | null
    A database connection URL in a SQLAlchemy-compatible
    format. Prefect currently supports SQLite and Postgres. Note that all
    Prefect database engines must use an async driver - for SQLite, use
    `sqlite+aiosqlite` and for Postgres use `postgresql+asyncpg`.

    SQLite in-memory databases can be used by providing the url
    `sqlite+aiosqlite:///file::memory:?cache=shared&uri=true&check_same_thread=false`,
    which will allow the database to be accessed by multiple threads. Note
    that in-memory databases can not be accessed from multiple processes and
    should only be used for simple tests.
Default: null
driver string | null

The database driver to use when connecting to the database. If not set, the driver will be inferred from the connection URL.

Default: null
host string | null

The database server host.

Default: null
port integer | null

The database server port.

Default: null
user string | null

The user to use when connecting to the database.

Default: null
name string | null

The name of the Prefect database on the remote server, or the path to the database file for SQLite.

Default: null
password string | null

The password to use when connecting to the database. Should be kept secret.

Default: null
echo boolean

If True, SQLAlchemy will log all SQL issued to the database. Defaults to False.

Default: false
migrate_on_start boolean

If True, the database will be migrated on application startup.

Default: true
timeout number | null

A statement timeout, in seconds, applied to all database interactions made by the Prefect backend. Defaults to 10 seconds.

Default: 10.0
connection_timeout number | null

A connection timeout, in seconds, applied to database connections. Defaults to 5.

Default: 5.0
ServerDeploymentsSettings object
concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a deployment flow run cannot secure a concurrency slot from the server.

Default: 30.0
min=0.0
ServerDocketSettings object

Settings for controlling Docket behavior

name string

The name of the Docket instance.

Default: "prefect-server"
url string

The URL of the Redis server to use for Docket.

Default: "memory://"
ServerEphemeralSettings object

Settings for controlling ephemeral server behavior

enabled boolean
    Controls whether or not a subprocess server can be started when no API URL is provided.
Default: false
startup_timeout_seconds integer
    The number of seconds to wait for the server to start when ephemeral mode is enabled.
    Defaults to `20`.
Default: 20
ServerEventsSettings object

Settings for controlling behavior of the events subsystem

stream_out_enabled boolean

Whether or not to stream events out to the API via websockets.

Default: true
related_resource_cache_ttl string

The number of seconds to cache related resources for in the API.

Default: "PT5M"
format=duration
maximum_labels_per_resource integer

The maximum number of labels a resource may have.

Default: 500
maximum_related_resources integer

The maximum number of related resources an Event may have.

Default: 100
maximum_size_bytes integer

The maximum size of an Event when serialized to JSON

Default: 1500000
expired_bucket_buffer string

The amount of time to retain expired automation buckets

Default: "PT1M"
format=duration
proactive_granularity string

How frequently proactive automations are evaluated

Default: "PT5S"
format=duration
retention_period string

The amount of time to retain events in the database.

Default: "P7D"
format=duration
maximum_websocket_backfill string

The maximum range to look back for backfilling events for a websocket subscriber.

Default: "PT15M"
format=duration
websocket_backfill_page_size integer

The page size for the queries to backfill events for websocket subscribers.

Default: 250
exclusiveMin=0
messaging_broker string

Which message broker implementation to use for the messaging system, should point to a module that exports a Publisher and Consumer class.

Default: "prefect.server.utilities.messaging.memory"
messaging_cache string

Which cache implementation to use for the events system. Should point to a module that exports a Cache class.

Default: "prefect.server.utilities.messaging.memory"
causal_ordering string

Which causal ordering implementation to use for the events system. Should point to a module that exports a CausalOrdering class.

Default: "prefect.server.events.ordering.memory"
maximum_event_name_length integer

The maximum length of an event name.

Default: 1024
exclusiveMin=0
ServerFlowRunGraphSettings object

Settings for controlling behavior of the flow run graph

max_nodes integer

The maximum size of a flow run graph on the v2 API

Default: 10000
max_artifacts integer

The maximum number of artifacts to show on a flow run graph on the v2 API

Default: 10000
ServerLogsSettings object

Settings for controlling behavior of the logs subsystem

stream_out_enabled boolean

Whether or not to stream logs out to the API via websockets.

Default: false
stream_publishing_enabled boolean

Whether or not to publish logs to the streaming system.

Default: false
ServerServicesCancellationCleanupSettings object

Settings for controlling the cancellation cleanup service

enabled boolean

Whether or not to start the cancellation cleanup service in the server application.

Default: true
loop_seconds number

The cancellation cleanup service will look for non-terminal tasks and subflows this often. Defaults to 20.

Default: 20
ServerServicesDBVacuumSettings object

Settings for controlling the database vacuum service

enabled string[] | boolean | null

Comma-separated set of vacuum types to enable. Valid values: 'events', 'flow_runs'. Defaults to 'events'. For backward compatibility, 'true' maps to 'events,flow_runs' and 'false' maps to 'events'. Event vacuum also requires event_persister.enabled (the default).

Default:
[
  "events"
]
loop_seconds number

The database vacuum service will run this often, in seconds. Defaults to 3600 (1 hour).

Default: 3600
exclusiveMin=0
retention_period string

How old a flow run must be (based on end_time) before it is eligible for deletion. Accepts seconds. Minimum 1 hour. Defaults to 90 days.

Default: "P90D"
format=duration
batch_size integer

The number of records to delete per database transaction. Defaults to 200.

Default: 200
exclusiveMin=0
event_retention_overrides Record<string, string>

Per-event-type retention period overrides. Keys are event type strings (e.g. 'prefect.flow-run.heartbeat'), values are retention periods in seconds. Event types not listed fall back to server.events.retention_period. Each override is capped by the global events retention period.

Default:
{
  "prefect.flow-run.heartbeat": "P7D"
}
ServerServicesEventLoggerSettings object

Settings for controlling the event logger service

enabled boolean

Whether or not to start the event logger service in the server application.

Default: false
ServerServicesEventPersisterSettings object

Settings for controlling the event persister service

enabled boolean

Whether or not to start the event persister service in the server application.

Default: true
batch_size integer

The number of events the event persister will attempt to insert in one batch.

Default: 20
exclusiveMin=0
read_batch_size integer

The number of events the event persister will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the event persister.

Default: 5
exclusiveMin=0.0
queue_max_size integer

The maximum number of events that can be queued in memory for persistence. When the queue is full, new events will be dropped.

Default: 50000
exclusiveMin=0
max_flush_retries integer

The maximum number of consecutive flush failures before events are dropped instead of being re-queued.

Default: 5
exclusiveMin=0
ServerServicesForemanSettings object

Settings for controlling the foreman service

enabled boolean

Whether or not to start the foreman service in the server application.

Default: true
loop_seconds number

The foreman service will check for offline workers this often. Defaults to 15.

Default: 15
inactivity_heartbeat_multiple integer
    The number of heartbeats that must be missed before a worker is marked as offline. Defaults to `3`.
Default: 3
fallback_heartbeat_interval_seconds integer
    The number of seconds to use for online/offline evaluation if a worker's heartbeat
    interval is not set. Defaults to `30`.
Default: 30
deployment_last_polled_timeout_seconds integer
    The number of seconds before a deployment is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
work_queue_last_polled_timeout_seconds integer
    The number of seconds before a work queue is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
ServerServicesLateRunsSettings object

Settings for controlling the late runs service

enabled boolean

Whether or not to start the late runs service in the server application.

Default: true
loop_seconds number
    The late runs service will look for runs to mark as late this often. Defaults to `5`.
Default: 5
after_seconds string
    The late runs service will mark runs as late after they have exceeded their scheduled start time by this many seconds. Defaults to `5` seconds.
Default: "PT15S"
format=duration
ServerServicesPauseExpirationsSettings object

Settings for controlling the pause expiration service

enabled boolean
    Whether or not to start the paused flow run expiration service in the server
    application. If disabled, paused flows that have timed out will remain in a Paused state
    until a resume attempt.
Default: true
loop_seconds number
    The pause expiration service will look for runs to mark as failed this often. Defaults to `5`.
Default: 5
ServerServicesRepossessorSettings object

Settings for controlling the repossessor service

enabled boolean

Whether or not to start the repossessor service in the server application.

Default: true
loop_seconds number

The repossessor service will look for expired leases this often. Defaults to 15.

Default: 15
ServerServicesSchedulerSettings object

Settings for controlling the scheduler service

enabled boolean

Whether or not to start the scheduler service in the server application.

Default: true
loop_seconds number
    The scheduler loop interval, in seconds. This determines
    how often the scheduler will attempt to schedule new flow runs, but has no
    impact on how quickly either flow runs or task runs are actually executed.
    Defaults to `60`.
Default: 60
deployment_batch_size integer
    The number of deployments the scheduler will attempt to
    schedule in a single batch. If there are more deployments than the batch
    size, the scheduler immediately attempts to schedule the next batch; it
    does not sleep for `scheduler_loop_seconds` until it has visited every
    deployment once. Defaults to `100`.
Default: 100
max_runs integer
    The scheduler will attempt to schedule up to this many
    auto-scheduled runs in the future. Note that runs may have fewer than
    this many scheduled runs, depending on the value of
    `scheduler_max_scheduled_time`.  Defaults to `100`.
Default: 100
min_runs integer
    The scheduler will attempt to schedule at least this many
    auto-scheduled runs in the future. Note that runs may have more than
    this many scheduled runs, depending on the value of
    `scheduler_min_scheduled_time`.  Defaults to `3`.
Default: 3
max_scheduled_time string
    The scheduler will create new runs up to this far in the
    future. Note that this setting will take precedence over
    `scheduler_max_runs`: if a flow runs once a month and
    `scheduler_max_scheduled_time` is three months, then only three runs will be
    scheduled. Defaults to 100 days (`8640000` seconds).
Default: "P100D"
format=duration
min_scheduled_time string
    The scheduler will create new runs at least this far in the
    future. Note that this setting will take precedence over `scheduler_min_runs`:
    if a flow runs every hour and `scheduler_min_scheduled_time` is three hours,
    then three runs will be scheduled even if `scheduler_min_runs` is 1. Defaults to
Default: "PT1H"
format=duration
insert_batch_size integer
    The number of runs the scheduler will attempt to insert in a single batch.
    Defaults to `500`.
Default: 500
recent_deployments_loop_seconds number
    The number of seconds the recent deployments scheduler will wait between checking for recently updated deployments. Defaults to `5`.
Default: 5
ServerServicesSettings object

Settings for controlling server services

cancellation_cleanup object

Settings for controlling the cancellation cleanup service

2 nested properties
enabled boolean

Whether or not to start the cancellation cleanup service in the server application.

Default: true
loop_seconds number

The cancellation cleanup service will look for non-terminal tasks and subflows this often. Defaults to 20.

Default: 20
db_vacuum object

Settings for controlling the database vacuum service

5 nested properties
enabled string[] | boolean | null

Comma-separated set of vacuum types to enable. Valid values: 'events', 'flow_runs'. Defaults to 'events'. For backward compatibility, 'true' maps to 'events,flow_runs' and 'false' maps to 'events'. Event vacuum also requires event_persister.enabled (the default).

Default:
[
  "events"
]
loop_seconds number

The database vacuum service will run this often, in seconds. Defaults to 3600 (1 hour).

Default: 3600
exclusiveMin=0
retention_period string

How old a flow run must be (based on end_time) before it is eligible for deletion. Accepts seconds. Minimum 1 hour. Defaults to 90 days.

Default: "P90D"
format=duration
batch_size integer

The number of records to delete per database transaction. Defaults to 200.

Default: 200
exclusiveMin=0
event_retention_overrides Record<string, string>

Per-event-type retention period overrides. Keys are event type strings (e.g. 'prefect.flow-run.heartbeat'), values are retention periods in seconds. Event types not listed fall back to server.events.retention_period. Each override is capped by the global events retention period.

Default:
{
  "prefect.flow-run.heartbeat": "P7D"
}
event_persister object

Settings for controlling the event persister service

6 nested properties
enabled boolean

Whether or not to start the event persister service in the server application.

Default: true
batch_size integer

The number of events the event persister will attempt to insert in one batch.

Default: 20
exclusiveMin=0
read_batch_size integer

The number of events the event persister will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the event persister.

Default: 5
exclusiveMin=0.0
queue_max_size integer

The maximum number of events that can be queued in memory for persistence. When the queue is full, new events will be dropped.

Default: 50000
exclusiveMin=0
max_flush_retries integer

The maximum number of consecutive flush failures before events are dropped instead of being re-queued.

Default: 5
exclusiveMin=0
event_logger object

Settings for controlling the event logger service

1 nested properties
enabled boolean

Whether or not to start the event logger service in the server application.

Default: false
foreman object

Settings for controlling the foreman service

6 nested properties
enabled boolean

Whether or not to start the foreman service in the server application.

Default: true
loop_seconds number

The foreman service will check for offline workers this often. Defaults to 15.

Default: 15
inactivity_heartbeat_multiple integer
    The number of heartbeats that must be missed before a worker is marked as offline. Defaults to `3`.
Default: 3
fallback_heartbeat_interval_seconds integer
    The number of seconds to use for online/offline evaluation if a worker's heartbeat
    interval is not set. Defaults to `30`.
Default: 30
deployment_last_polled_timeout_seconds integer
    The number of seconds before a deployment is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
work_queue_last_polled_timeout_seconds integer
    The number of seconds before a work queue is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
late_runs object

Settings for controlling the late runs service

3 nested properties
enabled boolean

Whether or not to start the late runs service in the server application.

Default: true
loop_seconds number
    The late runs service will look for runs to mark as late this often. Defaults to `5`.
Default: 5
after_seconds string
    The late runs service will mark runs as late after they have exceeded their scheduled start time by this many seconds. Defaults to `5` seconds.
Default: "PT15S"
format=duration
scheduler object

Settings for controlling the scheduler service

9 nested properties
enabled boolean

Whether or not to start the scheduler service in the server application.

Default: true
loop_seconds number
    The scheduler loop interval, in seconds. This determines
    how often the scheduler will attempt to schedule new flow runs, but has no
    impact on how quickly either flow runs or task runs are actually executed.
    Defaults to `60`.
Default: 60
deployment_batch_size integer
    The number of deployments the scheduler will attempt to
    schedule in a single batch. If there are more deployments than the batch
    size, the scheduler immediately attempts to schedule the next batch; it
    does not sleep for `scheduler_loop_seconds` until it has visited every
    deployment once. Defaults to `100`.
Default: 100
max_runs integer
    The scheduler will attempt to schedule up to this many
    auto-scheduled runs in the future. Note that runs may have fewer than
    this many scheduled runs, depending on the value of
    `scheduler_max_scheduled_time`.  Defaults to `100`.
Default: 100
min_runs integer
    The scheduler will attempt to schedule at least this many
    auto-scheduled runs in the future. Note that runs may have more than
    this many scheduled runs, depending on the value of
    `scheduler_min_scheduled_time`.  Defaults to `3`.
Default: 3
max_scheduled_time string
    The scheduler will create new runs up to this far in the
    future. Note that this setting will take precedence over
    `scheduler_max_runs`: if a flow runs once a month and
    `scheduler_max_scheduled_time` is three months, then only three runs will be
    scheduled. Defaults to 100 days (`8640000` seconds).
Default: "P100D"
format=duration
min_scheduled_time string
    The scheduler will create new runs at least this far in the
    future. Note that this setting will take precedence over `scheduler_min_runs`:
    if a flow runs every hour and `scheduler_min_scheduled_time` is three hours,
    then three runs will be scheduled even if `scheduler_min_runs` is 1. Defaults to
Default: "PT1H"
format=duration
insert_batch_size integer
    The number of runs the scheduler will attempt to insert in a single batch.
    Defaults to `500`.
Default: 500
recent_deployments_loop_seconds number
    The number of seconds the recent deployments scheduler will wait between checking for recently updated deployments. Defaults to `5`.
Default: 5
pause_expirations object

Settings for controlling the pause expiration service

2 nested properties
enabled boolean
    Whether or not to start the paused flow run expiration service in the server
    application. If disabled, paused flows that have timed out will remain in a Paused state
    until a resume attempt.
Default: true
loop_seconds number
    The pause expiration service will look for runs to mark as failed this often. Defaults to `5`.
Default: 5
repossessor object

Settings for controlling the repossessor service

2 nested properties
enabled boolean

Whether or not to start the repossessor service in the server application.

Default: true
loop_seconds number

The repossessor service will look for expired leases this often. Defaults to 15.

Default: 15
task_run_recorder object

Settings for controlling the task run recorder service

4 nested properties
enabled boolean

Whether or not to start the task run recorder service in the server application.

Default: true
read_batch_size integer

The number of task runs the task run recorder will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
batch_size integer

The number of task runs the task run recorder will attempt to insert in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the task run recorder.

Default: 5
exclusiveMin=0.0
triggers object

Settings for controlling the triggers service

4 nested properties
enabled boolean

Whether or not to start the triggers service in the server application.

Default: true
read_batch_size integer

The number of events the triggers service will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
pg_notify_reconnect_interval_seconds integer
    The number of seconds to wait before reconnecting to the PostgreSQL NOTIFY/LISTEN 
    connection after an error. Only used when using PostgreSQL as the database.
    Defaults to `10`.
Default: 10
pg_notify_heartbeat_interval_seconds integer
    The number of seconds between heartbeat checks for the PostgreSQL NOTIFY/LISTEN 
    connection to ensure it's still alive. Only used when using PostgreSQL as the database.
    Defaults to `5`.
Default: 5
ServerServicesTaskRunRecorderSettings object

Settings for controlling the task run recorder service

enabled boolean

Whether or not to start the task run recorder service in the server application.

Default: true
read_batch_size integer

The number of task runs the task run recorder will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
batch_size integer

The number of task runs the task run recorder will attempt to insert in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the task run recorder.

Default: 5
exclusiveMin=0.0
ServerServicesTriggersSettings object

Settings for controlling the triggers service

enabled boolean

Whether or not to start the triggers service in the server application.

Default: true
read_batch_size integer

The number of events the triggers service will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
pg_notify_reconnect_interval_seconds integer
    The number of seconds to wait before reconnecting to the PostgreSQL NOTIFY/LISTEN 
    connection after an error. Only used when using PostgreSQL as the database.
    Defaults to `10`.
Default: 10
pg_notify_heartbeat_interval_seconds integer
    The number of seconds between heartbeat checks for the PostgreSQL NOTIFY/LISTEN 
    connection to ensure it's still alive. Only used when using PostgreSQL as the database.
    Defaults to `5`.
Default: 5
ServerSettings object

Settings for controlling server behavior

logging_level string

The default logging level for the Prefect API server.

Default: "WARNING"
Values: "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL"
analytics_enabled boolean
    When enabled, Prefect sends anonymous data (e.g. count of flow runs, package version)
    on server startup to help us improve our product.
Default: true
metrics_enabled boolean

Whether or not to enable Prometheus metrics in the API.

Default: false
log_retryable_errors boolean

If True, log retryable errors in the API and it's services.

Default: false
register_blocks_on_start boolean

If set, any block types that have been imported will be registered with the backend on application startup. If not set, block types must be manually registered.

Default: true
memoize_block_auto_registration boolean

Controls whether or not block auto-registration on start

Default: true
memo_store_path string

Path to the memo store file. Defaults to $PREFECT_HOME/memo_store.toml

format=path
deployment_schedule_max_scheduled_runs integer

The maximum number of scheduled runs to create for a deployment.

Default: 50
api object

Settings for controlling API server behavior

12 nested properties
auth_string string | null

A string to use for basic authentication with the API in the form 'user:password'.

Default: null
host string

The API's host address (defaults to 127.0.0.1).

Default: "127.0.0.1"
port integer

The API's port address (defaults to 4200).

Default: 4200
base_path string | null

The base URL path to serve the API under.

Default: null
Examples: "/v2/api"
default_limit integer

The default limit applied to queries that can return multiple objects, such as POST /flow_runs/filter.

Default: 200
keepalive_timeout integer
    The API's keep alive timeout (defaults to `5`).
    Refer to <https://www.uvicorn.org/settings/#timeouts> for details.

    When the API is hosted behind a load balancer, you may want to set this to a value
    greater than the load balancer's idle timeout.

    Note this setting only applies when calling `prefect server start`; if hosting the
    API with another tool you will need to configure this there instead.
Default: 5
csrf_protection_enabled boolean
    Controls the activation of CSRF protection for the Prefect server API.

    When enabled (`True`), the server enforces CSRF validation checks on incoming
    state-changing requests (POST, PUT, PATCH, DELETE), requiring a valid CSRF
    token to be included in the request headers or body. This adds a layer of
    security by preventing unauthorized or malicious sites from making requests on
    behalf of authenticated users.

    It is recommended to enable this setting in production environments where the
    API is exposed to web clients to safeguard against CSRF attacks.

    Note: Enabling this setting requires corresponding support in the client for
    CSRF token management. See PREFECT_CLIENT_CSRF_SUPPORT_ENABLED for more.
Default: false
csrf_token_expiration string
    Specifies the duration for which a CSRF token remains valid after being issued
    by the server.

    The default expiration time is set to 1 hour, which offers a reasonable
    compromise. Adjust this setting based on your specific security requirements
    and usage patterns.
Default: "PT1H"
format=duration
cors_allowed_origins string
    A comma-separated list of origins that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all origins.
Default: "*"
cors_allowed_methods string
    A comma-separated list of methods that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all methods.
Default: "*"
cors_allowed_headers string
    A comma-separated list of headers that are authorized to make cross-origin requests to the API.

    By default, this is set to `*`, which allows requests from all headers.
Default: "*"
max_parameter_size integer

The maximum size of parameters (in bytes, JSON-serialized) that can be stored on a flow run or deployment. Set to 0 to disable the limit.

Default: 524288
min=0
concurrency object
3 nested properties
lease_storage string

The module to use for storing concurrency limit leases.

Default: "prefect.server.concurrency.lease_storage.memory"
initial_deployment_lease_duration number

Initial duration for deployment concurrency lease in seconds.

Default: 300.0
min=30.0max=3600.0
maximum_concurrency_slot_wait_seconds number

The maximum number of seconds to wait before retrying when a concurrency slot cannot be acquired.

Default: 30
min=0
database object

Settings for controlling server database behavior

12 nested properties
sqlalchemy object

Settings for controlling SQLAlchemy behavior; note that these settings only take effect when using a PostgreSQL database.

5 nested properties
connect_args object

Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when using a PostgreSQL database.

pool_size integer

Controls connection pool size of database connection pools from the Prefect backend.

Default: 5
pool_recycle integer

This setting causes the pool to recycle connections after the given number of seconds has passed; set it to -1 to avoid recycling entirely.

Default: 3600
pool_timeout number | null

Number of seconds to wait before giving up on getting a connection from the pool. Defaults to 30 seconds.

Default: 30.0
max_overflow integer

Controls maximum overflow of the connection pool. To prevent overflow, set to -1.

Default: 10
connection_url string | null
    A database connection URL in a SQLAlchemy-compatible
    format. Prefect currently supports SQLite and Postgres. Note that all
    Prefect database engines must use an async driver - for SQLite, use
    `sqlite+aiosqlite` and for Postgres use `postgresql+asyncpg`.

    SQLite in-memory databases can be used by providing the url
    `sqlite+aiosqlite:///file::memory:?cache=shared&uri=true&check_same_thread=false`,
    which will allow the database to be accessed by multiple threads. Note
    that in-memory databases can not be accessed from multiple processes and
    should only be used for simple tests.
Default: null
driver string | null

The database driver to use when connecting to the database. If not set, the driver will be inferred from the connection URL.

Default: null
host string | null

The database server host.

Default: null
port integer | null

The database server port.

Default: null
user string | null

The user to use when connecting to the database.

Default: null
name string | null

The name of the Prefect database on the remote server, or the path to the database file for SQLite.

Default: null
password string | null

The password to use when connecting to the database. Should be kept secret.

Default: null
echo boolean

If True, SQLAlchemy will log all SQL issued to the database. Defaults to False.

Default: false
migrate_on_start boolean

If True, the database will be migrated on application startup.

Default: true
timeout number | null

A statement timeout, in seconds, applied to all database interactions made by the Prefect backend. Defaults to 10 seconds.

Default: 10.0
connection_timeout number | null

A connection timeout, in seconds, applied to database connections. Defaults to 5.

Default: 5.0
deployments object
1 nested properties
concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a deployment flow run cannot secure a concurrency slot from the server.

Default: 30.0
min=0.0
docket object

Settings for controlling Docket behavior

2 nested properties
name string

The name of the Docket instance.

Default: "prefect-server"
url string

The URL of the Redis server to use for Docket.

Default: "memory://"
ephemeral object

Settings for controlling ephemeral server behavior

2 nested properties
enabled boolean
    Controls whether or not a subprocess server can be started when no API URL is provided.
Default: false
startup_timeout_seconds integer
    The number of seconds to wait for the server to start when ephemeral mode is enabled.
    Defaults to `20`.
Default: 20
events object

Settings for controlling behavior of the events subsystem

14 nested properties
stream_out_enabled boolean

Whether or not to stream events out to the API via websockets.

Default: true
related_resource_cache_ttl string

The number of seconds to cache related resources for in the API.

Default: "PT5M"
format=duration
maximum_labels_per_resource integer

The maximum number of labels a resource may have.

Default: 500
maximum_related_resources integer

The maximum number of related resources an Event may have.

Default: 100
maximum_size_bytes integer

The maximum size of an Event when serialized to JSON

Default: 1500000
expired_bucket_buffer string

The amount of time to retain expired automation buckets

Default: "PT1M"
format=duration
proactive_granularity string

How frequently proactive automations are evaluated

Default: "PT5S"
format=duration
retention_period string

The amount of time to retain events in the database.

Default: "P7D"
format=duration
maximum_websocket_backfill string

The maximum range to look back for backfilling events for a websocket subscriber.

Default: "PT15M"
format=duration
websocket_backfill_page_size integer

The page size for the queries to backfill events for websocket subscribers.

Default: 250
exclusiveMin=0
messaging_broker string

Which message broker implementation to use for the messaging system, should point to a module that exports a Publisher and Consumer class.

Default: "prefect.server.utilities.messaging.memory"
messaging_cache string

Which cache implementation to use for the events system. Should point to a module that exports a Cache class.

Default: "prefect.server.utilities.messaging.memory"
causal_ordering string

Which causal ordering implementation to use for the events system. Should point to a module that exports a CausalOrdering class.

Default: "prefect.server.events.ordering.memory"
maximum_event_name_length integer

The maximum length of an event name.

Default: 1024
exclusiveMin=0
flow_run_graph object

Settings for controlling behavior of the flow run graph

2 nested properties
max_nodes integer

The maximum size of a flow run graph on the v2 API

Default: 10000
max_artifacts integer

The maximum number of artifacts to show on a flow run graph on the v2 API

Default: 10000
logs object

Settings for controlling behavior of the logs subsystem

2 nested properties
stream_out_enabled boolean

Whether or not to stream logs out to the API via websockets.

Default: false
stream_publishing_enabled boolean

Whether or not to publish logs to the streaming system.

Default: false
services object

Settings for controlling server services

11 nested properties
cancellation_cleanup object

Settings for controlling the cancellation cleanup service

2 nested properties
enabled boolean

Whether or not to start the cancellation cleanup service in the server application.

Default: true
loop_seconds number

The cancellation cleanup service will look for non-terminal tasks and subflows this often. Defaults to 20.

Default: 20
db_vacuum object

Settings for controlling the database vacuum service

5 nested properties
enabled string[] | boolean | null

Comma-separated set of vacuum types to enable. Valid values: 'events', 'flow_runs'. Defaults to 'events'. For backward compatibility, 'true' maps to 'events,flow_runs' and 'false' maps to 'events'. Event vacuum also requires event_persister.enabled (the default).

Default:
[
  "events"
]
loop_seconds number

The database vacuum service will run this often, in seconds. Defaults to 3600 (1 hour).

Default: 3600
exclusiveMin=0
retention_period string

How old a flow run must be (based on end_time) before it is eligible for deletion. Accepts seconds. Minimum 1 hour. Defaults to 90 days.

Default: "P90D"
format=duration
batch_size integer

The number of records to delete per database transaction. Defaults to 200.

Default: 200
exclusiveMin=0
event_retention_overrides Record<string, string>

Per-event-type retention period overrides. Keys are event type strings (e.g. 'prefect.flow-run.heartbeat'), values are retention periods in seconds. Event types not listed fall back to server.events.retention_period. Each override is capped by the global events retention period.

Default:
{
  "prefect.flow-run.heartbeat": "P7D"
}
event_persister object

Settings for controlling the event persister service

6 nested properties
enabled boolean

Whether or not to start the event persister service in the server application.

Default: true
batch_size integer

The number of events the event persister will attempt to insert in one batch.

Default: 20
exclusiveMin=0
read_batch_size integer

The number of events the event persister will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the event persister.

Default: 5
exclusiveMin=0.0
queue_max_size integer

The maximum number of events that can be queued in memory for persistence. When the queue is full, new events will be dropped.

Default: 50000
exclusiveMin=0
max_flush_retries integer

The maximum number of consecutive flush failures before events are dropped instead of being re-queued.

Default: 5
exclusiveMin=0
event_logger object

Settings for controlling the event logger service

1 nested properties
enabled boolean

Whether or not to start the event logger service in the server application.

Default: false
foreman object

Settings for controlling the foreman service

6 nested properties
enabled boolean

Whether or not to start the foreman service in the server application.

Default: true
loop_seconds number

The foreman service will check for offline workers this often. Defaults to 15.

Default: 15
inactivity_heartbeat_multiple integer
    The number of heartbeats that must be missed before a worker is marked as offline. Defaults to `3`.
Default: 3
fallback_heartbeat_interval_seconds integer
    The number of seconds to use for online/offline evaluation if a worker's heartbeat
    interval is not set. Defaults to `30`.
Default: 30
deployment_last_polled_timeout_seconds integer
    The number of seconds before a deployment is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
work_queue_last_polled_timeout_seconds integer
    The number of seconds before a work queue is marked as not ready if it has not been
    polled. Defaults to `60`.
Default: 60
late_runs object

Settings for controlling the late runs service

3 nested properties
enabled boolean

Whether or not to start the late runs service in the server application.

Default: true
loop_seconds number
    The late runs service will look for runs to mark as late this often. Defaults to `5`.
Default: 5
after_seconds string
    The late runs service will mark runs as late after they have exceeded their scheduled start time by this many seconds. Defaults to `5` seconds.
Default: "PT15S"
format=duration
scheduler object

Settings for controlling the scheduler service

9 nested properties
enabled boolean

Whether or not to start the scheduler service in the server application.

Default: true
loop_seconds number
    The scheduler loop interval, in seconds. This determines
    how often the scheduler will attempt to schedule new flow runs, but has no
    impact on how quickly either flow runs or task runs are actually executed.
    Defaults to `60`.
Default: 60
deployment_batch_size integer
    The number of deployments the scheduler will attempt to
    schedule in a single batch. If there are more deployments than the batch
    size, the scheduler immediately attempts to schedule the next batch; it
    does not sleep for `scheduler_loop_seconds` until it has visited every
    deployment once. Defaults to `100`.
Default: 100
max_runs integer
    The scheduler will attempt to schedule up to this many
    auto-scheduled runs in the future. Note that runs may have fewer than
    this many scheduled runs, depending on the value of
    `scheduler_max_scheduled_time`.  Defaults to `100`.
Default: 100
min_runs integer
    The scheduler will attempt to schedule at least this many
    auto-scheduled runs in the future. Note that runs may have more than
    this many scheduled runs, depending on the value of
    `scheduler_min_scheduled_time`.  Defaults to `3`.
Default: 3
max_scheduled_time string
    The scheduler will create new runs up to this far in the
    future. Note that this setting will take precedence over
    `scheduler_max_runs`: if a flow runs once a month and
    `scheduler_max_scheduled_time` is three months, then only three runs will be
    scheduled. Defaults to 100 days (`8640000` seconds).
Default: "P100D"
format=duration
min_scheduled_time string
    The scheduler will create new runs at least this far in the
    future. Note that this setting will take precedence over `scheduler_min_runs`:
    if a flow runs every hour and `scheduler_min_scheduled_time` is three hours,
    then three runs will be scheduled even if `scheduler_min_runs` is 1. Defaults to
Default: "PT1H"
format=duration
insert_batch_size integer
    The number of runs the scheduler will attempt to insert in a single batch.
    Defaults to `500`.
Default: 500
recent_deployments_loop_seconds number
    The number of seconds the recent deployments scheduler will wait between checking for recently updated deployments. Defaults to `5`.
Default: 5
pause_expirations object

Settings for controlling the pause expiration service

2 nested properties
enabled boolean
    Whether or not to start the paused flow run expiration service in the server
    application. If disabled, paused flows that have timed out will remain in a Paused state
    until a resume attempt.
Default: true
loop_seconds number
    The pause expiration service will look for runs to mark as failed this often. Defaults to `5`.
Default: 5
repossessor object

Settings for controlling the repossessor service

2 nested properties
enabled boolean

Whether or not to start the repossessor service in the server application.

Default: true
loop_seconds number

The repossessor service will look for expired leases this often. Defaults to 15.

Default: 15
task_run_recorder object

Settings for controlling the task run recorder service

4 nested properties
enabled boolean

Whether or not to start the task run recorder service in the server application.

Default: true
read_batch_size integer

The number of task runs the task run recorder will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
batch_size integer

The number of task runs the task run recorder will attempt to insert in one batch.

Default: 1
exclusiveMin=0
flush_interval number

The maximum number of seconds between flushes of the task run recorder.

Default: 5
exclusiveMin=0.0
triggers object

Settings for controlling the triggers service

4 nested properties
enabled boolean

Whether or not to start the triggers service in the server application.

Default: true
read_batch_size integer

The number of events the triggers service will attempt to read from the message broker in one batch.

Default: 1
exclusiveMin=0
pg_notify_reconnect_interval_seconds integer
    The number of seconds to wait before reconnecting to the PostgreSQL NOTIFY/LISTEN 
    connection after an error. Only used when using PostgreSQL as the database.
    Defaults to `10`.
Default: 10
pg_notify_heartbeat_interval_seconds integer
    The number of seconds between heartbeat checks for the PostgreSQL NOTIFY/LISTEN 
    connection to ensure it's still alive. Only used when using PostgreSQL as the database.
    Defaults to `5`.
Default: 5
tasks object

Settings for controlling server-side behavior related to tasks

3 nested properties
tag_concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a task run cannot secure a concurrency slot from the server.

Default: 10
min=0
max_cache_key_length integer

The maximum number of characters allowed for a task run cache key.

Default: 2000
scheduling object

Settings for controlling server-side behavior related to task scheduling

3 nested properties
max_scheduled_queue_size integer

The maximum number of scheduled tasks to queue for submission.

Default: 1000
max_retry_queue_size integer

The maximum number of retries to queue for submission.

Default: 100
pending_task_timeout string

How long before a PENDING task are made available to another task worker.

Default: "PT0S"
format=duration
ui object
6 nested properties
enabled boolean

Whether or not to serve the Prefect UI.

Default: true
v2_enabled boolean

Whether to serve the experimental V2 UI instead of the default V1 UI.

Default: false
api_url string | null

The connection url for communication from the UI to the API. Defaults to PREFECT_API_URL if set. Otherwise, the default URL is generated from PREFECT_SERVER_API_HOST and PREFECT_SERVER_API_PORT.

Default: null
serve_base string

The base URL path to serve the Prefect UI from.

Default: "/"
static_directory string | null

The directory to serve static files from. This should be used when running into permissions issues when attempting to serve the UI from the default directory (for example when running in a Docker container).

Default: null
show_promotional_content boolean

Whether or not to display promotional content in the UI, including upgrade prompts and marketing banners.

Default: true
ServerTasksSchedulingSettings object

Settings for controlling server-side behavior related to task scheduling

max_scheduled_queue_size integer

The maximum number of scheduled tasks to queue for submission.

Default: 1000
max_retry_queue_size integer

The maximum number of retries to queue for submission.

Default: 100
pending_task_timeout string

How long before a PENDING task are made available to another task worker.

Default: "PT0S"
format=duration
ServerTasksSettings object

Settings for controlling server-side behavior related to tasks

tag_concurrency_slot_wait_seconds number

The number of seconds to wait before retrying when a task run cannot secure a concurrency slot from the server.

Default: 10
min=0
max_cache_key_length integer

The maximum number of characters allowed for a task run cache key.

Default: 2000
scheduling object

Settings for controlling server-side behavior related to task scheduling

3 nested properties
max_scheduled_queue_size integer

The maximum number of scheduled tasks to queue for submission.

Default: 1000
max_retry_queue_size integer

The maximum number of retries to queue for submission.

Default: 100
pending_task_timeout string

How long before a PENDING task are made available to another task worker.

Default: "PT0S"
format=duration
ServerUISettings object
enabled boolean

Whether or not to serve the Prefect UI.

Default: true
v2_enabled boolean

Whether to serve the experimental V2 UI instead of the default V1 UI.

Default: false
api_url string | null

The connection url for communication from the UI to the API. Defaults to PREFECT_API_URL if set. Otherwise, the default URL is generated from PREFECT_SERVER_API_HOST and PREFECT_SERVER_API_PORT.

Default: null
serve_base string

The base URL path to serve the Prefect UI from.

Default: "/"
static_directory string | null

The directory to serve static files from. This should be used when running into permissions issues when attempting to serve the UI from the default directory (for example when running in a Docker container).

Default: null
show_promotional_content boolean

Whether or not to display promotional content in the UI, including upgrade prompts and marketing banners.

Default: true
TasksRunnerSettings object
thread_pool_max_workers integer | null

The maximum number of workers for ThreadPoolTaskRunner.

Default: null
process_pool_max_workers integer | null

The maximum number of workers for ProcessPoolTaskRunner.

Default: null
TasksSchedulingSettings object
default_storage_block string | null

The block-type/block-document slug of a block to use as the default storage for autonomous tasks.

Default: null
delete_failed_submissions boolean

Whether or not to delete failed task submissions from the database.

Default: true
TasksSettings object
refresh_cache boolean

If True, enables a refresh of cached results: re-executing the task will refresh the cached results.

Default: false
default_no_cache boolean

If True, sets the default cache policy on all tasks to NO_CACHE.

Default: false
disable_caching boolean

If True, disables caching on all tasks regardless of cache policy.

Default: false
default_retries integer

This value sets the default number of retries for all tasks.

Default: 0
min=0
default_retry_delay_seconds string | integer | number | number[] | null

This value sets the default retry delay seconds for all tasks.

Default: 0
default_persist_result boolean | null

If True, results will be persisted by default for all tasks. Set to False to disable persistence by default. Note that setting to False will override the behavior set by a parent flow or task.

Default: null
runner object
2 nested properties
thread_pool_max_workers integer | null

The maximum number of workers for ThreadPoolTaskRunner.

Default: null
process_pool_max_workers integer | null

The maximum number of workers for ProcessPoolTaskRunner.

Default: null
scheduling object
2 nested properties
default_storage_block string | null

The block-type/block-document slug of a block to use as the default storage for autonomous tasks.

Default: null
delete_failed_submissions boolean

Whether or not to delete failed task submissions from the database.

Default: true
TelemetrySettings object

Settings for configuring Prefect telemetry

enable_resource_metrics boolean

Whether to enable OS-level resource metric collection in flow run subprocesses.

Default: true
resource_metrics_interval_seconds integer

Interval in seconds between resource metric collections.

Default: 10
min=1
TestingSettings object
test_mode boolean

If True, places the API in test mode. This may modify behavior to facilitate testing.

Default: false
unit_test_mode boolean

This setting only exists to facilitate unit testing. If True, code is executing in a unit test context. Defaults to False.

Default: false
unit_test_loop_debug boolean

If True turns on debug mode for the unit testing event loop.

Default: true
test_setting null

This setting only exists to facilitate unit testing. If in test mode, this setting will return its value. Otherwise, it returns None.

Default: "FOO"
WorkerSettings object
debug_mode boolean

If True, enables debug mode for the worker only. Unlike PREFECT_DEBUG_MODE, this setting does not propagate to flow runs executed by the worker.

Default: false
heartbeat_seconds number

Number of seconds a worker should wait between sending a heartbeat.

Default: 30
query_seconds number

Number of seconds a worker should wait between queries for scheduled work.

Default: 10
prefetch_seconds number

The number of seconds into the future a worker should query for scheduled work.

Default: 10
enable_cancellation boolean

Enable worker-side flow run cancellation for pending flow runs. When enabled, the worker will terminate infrastructure for flow runs that are cancelled while still in PENDING state (before the runner starts).

Default: false
cancellation_poll_seconds number

Number of seconds between polls for cancelling flow runs. Used as a fallback when the WebSocket connection for real-time cancellation events is unavailable.

Default: 120
webserver object
2 nested properties
host string

The host address the worker's webserver should bind to.

Default: "0.0.0.0"
port integer

The port the worker's webserver should bind to.

Default: 8080
WorkerWebserverSettings object
host string

The host address the worker's webserver should bind to.

Default: "0.0.0.0"
port integer

The port the worker's webserver should bind to.

Default: 8080