Generate a Prefect Cloud API key from your Prefect Cloud account settings.
Identify your account ID, workspace ID, and the deployment ID you want to trigger.
POST to https://api.prefect.cloud/api/accounts/YOUR_ACCOUNT_ID/workspaces/YOUR_WORKSPACE_ID/deployments/YOUR_DEPLOYMENT_ID/create_flow_run with Authorization: Bearer YOUR_API_KEY and Content-Type application/json.
Optionally include a JSON body with parameters, state, or tags to customize the run.
Capture the id field from the response — this is the flow run ID.
Poll GET /flow_runs/YOUR_FLOW_RUN_ID on the same base URL to monitor state transitions until the run reaches a terminal state.
Known gotchas
The API URL path includes both account ID and workspace ID — omitting either segment or swapping their order will result in a 404 error.
Flow run parameters must match the schema defined in the deployment; supplying unexpected keys may cause the run to fail at startup.
Prefect Cloud API keys are workspace-scoped by default; ensure your key has permissions for the target workspace before triggering runs programmatically.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp