Skip to content

Getting Started with Prefect Cloud

The following sections will get you set up and using Prefect Cloud, using these steps:

  1. Sign in or register a Prefect Cloud account.
  2. Create workspaces for your account.
  3. Create an API key to authorize a local execution environment.
  4. Configure Orion settings to use Prefect Cloud.
  5. Configure storage.
  6. Run a flow and view flow results in Prefect Cloud.

Sign in or register

To sign in with an existing account or register an account, go to

You can create an account with:

  • Google account
  • GitHub account
  • Email and password

Create a workspace

A workspace is an isolated environment within Prefect Cloud for your flows and deployments. You can use workspaces to organize or compartmentalize your workflows. For example, you can create separate workspaces to isolate development, staging, and production environments; or to provide separation between different teams.

When you register a new account, you'll be prompted to create a workspace.

Creating a new Prefect Cloud account.

Click Create Workspace. You'll be prompted to provide a name and description for your workspace.

Creating a new workspace in the Cloud UI.

Click Create to create the workspace.

Viewing a list of available workspaces in the Cloud UI.

If you change your mind, you can select Edit Workspace to modify the workspace details or to delete it.

The Edit Workspace dialog also provides a shell command that configures Prefect to orchestrate flow runs using this workspace. Copy the command into the environment in which you'll be running flows, so that they will show up in your workspace.

Editing a workspace.

The Prefect logo in the upper left always returns to your account dashboard, which shows the list of available workspaces. You can then navigate to a given workspace to view the results of flow runs associated with that workspace.

Viewing a workspace dashboard in the Prefect Cloud UI.

Create an API key

API keys enable you to authenticate an a local environment to work with Prefect Cloud. See Configuring Orion for Cloud for details on how API keys are configured in your execution environment.

To create an API key, click the account icon at the bottom-left corner of the UI, then click Profile. This displays your account profile.

Viewing an account profile in the Cloud UI.

Click the API Keys tab. This displays a list of previously generated keys and lets you create new API keys or delete keys.

Editing and creating API keys in the Cloud UI.

Click Create to create a new API key. You're prompted to provide a name for the key. Click Confirm to generate the key.

Note that API keys cannot be revealed again in the UI after you generate them, so copy the key to a secure location.

Configure Orion for Cloud

Your next step is to configure a local execution environment to use Prefect Cloud as the API server for local flow runs.

First, Install Orion in the environment in which you want to execute flow runs.

Next, use the Prefect CLI prefect cloud login command to log into Prefect Cloud from your environment, using the API key generated previously.


It will prompt you to choose a workspace if you haven't given one (you can specify a workspace with the -w or --workspace option).

┃              Select a Workspace: ┃
│ > tprefectio/tp-workspace        │
Successfully logged in and set workspace to 'tprefectio/tp-workspace' in profile:

It then sets PREFECT_API_KEY and PREFECT_API_URL for the current profile.

Now you're ready to run flows locally and have the results displayed in the Prefect Cloud UI.

The prefect cloud logout CLI command unsets those settings in the current profile, logging the environment out of interaction with Prefect Cloud.

Manually configuring Cloud settings

Note that you can also manually configure the settings to interact with Prefect Cloud using an account ID, workspace ID, and API key.

$ prefect config set PREFECT_API_URL="[ACCOUNT-ID]/workspaces/[WORKSPACE-ID]"
$ prefect config set PREFECT_API_KEY="[API-KEY]"

When you're in a Prefect Cloud workspace, you can copy the API URL directly from the page URL, or copy the entire command string from the Workspace Details page.

In this example, we configured PREFECT_API_URL and PREFECT_API_KEY in the default profile. You can use prefect profile CLI commands to create settings profiles for different configurations. For example, you could have a profile configured to use the Cloud API URL and API key, and another profile for local development using a local Orion API server. See Settings for details.

Configure storage

When using Prefect Cloud, we recommend configuring global storage for persisting flow and task data. See Storage for details.

By default, Prefect uses local file system storage to persist flow code and flow and task results. For local development and testing this may be adequate. Be aware, however, that local storage is not guaranteed to persist data reliably between flow or task runs, particularly when using containers or distributed computing environments like Dask and Ray.

Run a flow with Prefect Cloud

Okay, you're all set to run a local flow with Prefect Cloud. Notice that everything works just like running local flows with the Prefect API server, but because you configured PREFECT_API_URL and PREFECT_API_KEY, your flow runs show up in Prefect Cloud!

In your local environment, where you configured the previous steps, create a file named with the following contents:

from prefect import flow, get_run_logger

def basic_flow():
    logger = get_run_logger()
    logger.warning("The fun is about to begin")

if __name__ == "__main__":

Now run

$ python
11:31:46.135 | INFO    | prefect.engine - Created flow run 'delicate-woodpecker' for flow 'Testing'
11:31:46.135 | INFO    | Flow run 'delicate-woodpecker' - Using task runner 'ConcurrentTaskRunner'
11:31:46.748 | WARNING | Flow run 'delicate-woodpecker' - The fun is about to begin
11:31:47.643 | INFO    | Flow run 'delicate-woodpecker' - Finished in state Completed(None)

Go to the dashboard for your workspace in Prefect Cloud. You'll see the flow run results right there in Prefect Cloud!

Viewing local flow run results in the Cloud UI.

To run deployments using the API or directly from the Prefect Cloud UI, you'll need to configure work queues and agents. See the Work Queues & Agents documentation for details, and the Deployments tutorial for a hands-on example.