CreateFlowRun​Create​Flow​Run

Create a flow run in Prefect

Trigger a Prefect deployment and optionally wait for the flow run to complete. Supports both Prefect Cloud and self-hosted Prefect instances.

yaml
type: "io.kestra.plugin.prefect.CreateFlowRun"

Trigger a Prefect Cloud deployment and wait for completion

yaml
id: prefect_trigger
namespace: company.team

tasks:
  - id: trigger_prefect_run
    type: io.kestra.plugin.prefect.CreateFlowRun
    apiUrl: "https://api.prefect.cloud/api"
    accountId: "{{ secret('PREFECT_ACCOUNT_ID') }}"
    workspaceId: "{{ secret('PREFECT_WORKSPACE_ID') }}"
    deploymentId: "{{ secret('PREFECT_DEPLOYMENT_ID') }}"
    apiKey: "{{ secret('PREFECT_API_KEY') }}"
    wait: true
    pollFrequency: PT10S

Trigger a Prefect Cloud deployment without waiting

yaml
id: "createflowrun"
type: "io.kestra.plugin.prefect.CreateFlowRun"
id: prefect_trigger
namespace: company.team

tasks:
  - id: trigger_prefect_run
    type: io.kestra.plugin.prefect.CreateFlowRun
    apiUrl: "https://api.prefect.cloud/api"
    accountId: "{{ secret('PREFECT_ACCOUNT_ID') }}"
    workspaceId: "{{ secret('PREFECT_WORKSPACE_ID') }}"
    deploymentId: "{{ secret('PREFECT_DEPLOYMENT_ID') }}"
    apiKey: "{{ secret('PREFECT_API_KEY') }}"
    wait: false

Trigger a self-hosted Prefect deployment (without authentication)

yaml
id: prefect_self_hosted
namespace: company.team

tasks:
  - id: trigger_prefect_run
    type: io.kestra.plugin.prefect.CreateFlowRun
    apiUrl: "http://host.docker.internal:4200/api"
    deploymentId: "{{ secret('PREFECT_DEPLOYMENT_ID') }}"
    wait: true
    pollFrequency: PT10S

Trigger a self-hosted Prefect deployment with Basic authentication

yaml
id: "createflowrun"
type: "io.kestra.plugin.prefect.CreateFlowRun"
id: prefect_self_hosted_auth
namespace: company.team

tasks:
  - id: trigger_prefect_run
    type: io.kestra.plugin.prefect.CreateFlowRun
    apiUrl: "http://host.docker.internal:4200/api"
    deploymentId: "{{ secret('PREFECT_DEPLOYMENT_ID') }}"
    apiKey: "{{ secret('PREFECT_BASIC_AUTH') }}"  # base64-encoded "admin:pass"
    wait: true
    pollFrequency: PT10S
Properties

Deployment ID

The deployment ID (UUID) to create a flow run from.

Prefect Cloud account ID

The account ID (UUID) in Prefect Cloud. Required only for Prefect Cloud deployments.

Prefect API key / authentication

Authentication credentials for Prefect API. The format depends on your deployment:

  • Prefect Cloud: Use your API key (will be sent as Bearer token)
  • Self-hosted with Basic Auth: Use base64-encoded "admin: pass" (e.g., "YWRtaW46cGFzcw"). You can also provide the full header value "Basic YWRtaW46cGFzcw"
  • Self-hosted without auth: Leave empty
Default https://api.prefect.cloud/api

Prefect API URL

Base URL for the Prefect API. For Prefect Cloud, use https://api.prefect.cloud/api. For self-hosted Prefect, use your server URL, e.g., http://127.0.0.1: 4200/api.

Flow run parameters

Optional parameters to pass to the flow run.

Default PT5S
Format duration

Poll frequency

How often to poll the flow run status when wait is true.

Default true

Wait for flow run completion

Whether to wait for the flow run to complete before continuing. If true, the task will poll the flow run status until it reaches a terminal state (COMPLETED, FAILED, CANCELLED, etc.).

Prefect Cloud workspace ID

The workspace ID (UUID) in Prefect Cloud. Required only for Prefect Cloud deployments.

Flow run ID

The ID of the created flow run

Flow run URL

The URL to view the flow run in Prefect Cloud

Flow run state

The final state of the flow run (if wait is true) or the initial state