update_flight
Update a Flight. Any subset of name, source_code, requirements_txt, schedule_cron, config, md_token_name, or md_secret_names may be provided.
Updates to source_code, requirements_txt, config, md_secret_names, or md_token_name produce a new FlightVersion. Updates to name or schedule_cron are metadata-only.
You are responsible for the code you run and the packages it installs. Flights does not scan customer code or dependencies. Avoid untrusted packages, pin dependency versions, and treat dependency installs as a supply-chain risk.
Description
update_flight is a PATCH operation: omitted fields are left unchanged. To clear the schedule, pass schedule_cron as an empty string; omitting it leaves the schedule unchanged.
config and md_secret_names are full replacements — to change one entry, send the full map or list with the change applied.
The SQL equivalent is MD_UPDATE_FLIGHT.
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | The Flight UUID. |
name | string | No | Updated Flight name. Metadata-only. |
schedule_cron | string | No | Updated 5-field cron expression (UTC). Pass "" to clear the schedule. Metadata-only. |
source_code | string | No | Updated Python entrypoint source. Bumps the version. |
requirements_txt | string | No | Updated requirements.txt contents. Bumps the version. |
config | object | No | Replacement config map (full replace). Bumps the version. |
md_token_name | string | No | Updated MotherDuck access token label. Bumps the version. |
md_secret_names | string[] | No | Replacement list of secret names (full replace). Bumps the version. |
Output schema
{
"success": boolean,
"flight": {
"id": string,
"name": string,
"schedule_cron": string|null,
"current_version": number
},
"error": string
}
Example usage
Rename only:
{ "id": "80000000-...", "name": "analytics_hourly_sync" }
Update source (bumps version):
{
"id": "80000000-...",
"source_code": "def main():\n print('v2')\n\nif __name__ == \"__main__\":\n main()\n"
}
Clear the schedule:
{ "id": "80000000-...", "schedule_cron": "" }
Related
edit_flight_source— Edit source without resending the whole file.get_flight— Read current state before editing.MD_UPDATE_FLIGHT— SQL equivalent.