CreateFlowRun
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.
type: "io.kestra.plugin.prefect.CreateFlowRun"Examples
Trigger a Prefect Cloud deployment and wait for completion
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
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)
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
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
deploymentId *Requiredstring
Deployment ID
The deployment ID (UUID) to create a flow run from.
accountId string
Prefect Cloud account ID
The account ID (UUID) in Prefect Cloud. Required only for Prefect Cloud deployments.
apiKey string
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
 
apiUrl string
https://api.prefect.cloud/apiPrefect 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.
parameters Non-dynamicobject
Flow run parameters
Optional parameters to pass to the flow run.
pollFrequency Non-dynamicstring
PT5SdurationPoll frequency
How often to poll the flow run status when wait is true.
wait booleanstring
trueWait 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.).
workspaceId string
Prefect Cloud workspace ID
The workspace ID (UUID) in Prefect Cloud. Required only for Prefect Cloud deployments.
Outputs
flowRunId string
Flow run ID
The ID of the created flow run
flowRunUrl string
Flow run URL
The URL to view the flow run in Prefect Cloud
state string
Flow run state
The final state of the flow run (if wait is true) or the initial state