
Prefect CreateFlowRun
CertifiedTrigger a Prefect deployment run
Prefect CreateFlowRun
Trigger a Prefect deployment run
Creates a flow run from a Prefect deployment and can wait until it reaches a terminal state. Works with Prefect Cloud (account and workspace required) and self-hosted APIs; waits poll every 5 seconds by default and fails on FAILED/CRASHED/CANCELLED when waiting.
type: io.kestra.plugin.prefect.CreateFlowRunExamples
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: 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: 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
Pass parameters to the flow run
id: prefect_with_params
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
parameters:
run_date: "{{ now() }}"
retries: 2
region: "us-east-1"
Properties
deploymentId *Requiredstring
Deployment ID
Deployment UUID used to create the flow run.
accountId string
Prefect Cloud account ID
Prefect Cloud account UUID required when calling the Cloud API.
apiKey string
API credentials
Authentication sent in the Authorization header. Prefect Cloud expects an API key (sent as Bearer); self-hosted can supply a base64 Basic token like "YWRtaW46cGFzcw==" or the full "Basic ..." header; leave empty for unauthenticated servers.
apiUrl string
https://api.prefect.cloud/apiPrefect API endpoint
Base Prefect API URL. Defaults to https://api.prefect.cloud/api; for self-hosted instances provide your /api endpoint such as http://127.0.0.1: 4200/api.
parameters Non-dynamicobject
Flow run parameters
Optional parameters passed to the flow run after rendering with the task context.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
pollFrequency Non-dynamicstring
PT5SdurationPoll frequency
Polling interval while waiting; defaults to PT5S and only used when wait is true.
wait booleanstring
trueWait for flow run completion
Whether to block until the flow run reaches a terminal state. Defaults to true; when true, FAILED/CRASHED/CANCELLED throw a task error.
workspaceId string
Prefect Cloud workspace ID
Prefect Cloud workspace UUID required when calling the Cloud API.
Outputs
flowRunId string
Flow run ID
ID of the created flow run
flowRunUrl string
Flow run URL
URL to view the flow run in Prefect UI (Cloud or self-hosted)
state string
Flow run state
Terminal state when wait is true; initial state otherwise