prefect.deployments.flow_runs
run_deployment(name, client=None, parameters=None, scheduled_time=None, flow_run_name=None, timeout=None, poll_interval=5, tags=None, idempotency_key=None, work_queue_name=None, as_subflow=True, job_variables=None)
async
Create a flow run for a deployment and return it after completion or a timeout.
By default, this function blocks until the flow run finishes executing.
Specify a timeout (in seconds) to wait for the flow run to execute before
returning flow run metadata. To return immediately, without waiting for the
flow run to execute, set timeout=0
.
Note that if you specify a timeout, this function will return the flow run metadata whether or not the flow run finished executing.
If called within a flow or task, the flow run this function creates will
be linked to the current flow run as a subflow. Disable this behavior by
passing as_subflow=False
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Union[str, UUID]
|
The deployment id or deployment name in the form:
|
required |
parameters
|
Optional[dict]
|
Parameter overrides for this flow run. Merged with the deployment defaults. |
None
|
scheduled_time
|
Optional[datetime]
|
The time to schedule the flow run for, defaults to scheduling the flow run to start now. |
None
|
flow_run_name
|
Optional[str]
|
A name for the created flow run |
None
|
timeout
|
Optional[float]
|
The amount of time to wait (in seconds) for the flow run to
complete before returning. Setting |
None
|
poll_interval
|
Optional[float]
|
The number of seconds between polls |
5
|
tags
|
Optional[Iterable[str]]
|
A list of tags to associate with this flow run; tags can be used in automations and for organizational purposes. |
None
|
idempotency_key
|
Optional[str]
|
A unique value to recognize retries of the same run, and prevent creating multiple flow runs. |
None
|
work_queue_name
|
Optional[str]
|
The name of a work queue to use for this run. Defaults to the default work queue for the deployment. |
None
|
as_subflow
|
Optional[bool]
|
Whether to link the flow run as a subflow of the current flow or task run. |
True
|
job_variables
|
Optional[dict]
|
A dictionary of dot delimited infrastructure overrides that
will be applied at runtime; for example |
None
|
Source code in src/prefect/deployments/flow_runs.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|