<@ULVA73B9P> ```{ "id": "01993637-97fe-762a-8aff-e85849298ddb", "event": "prefect.automation.act...
t
@Marvin
Copy code
{
  "id": "01993637-97fe-762a-8aff-e85849298ddb",
  "event": "prefect.automation.action.failed",
  "occurred": "2025-09-11T00:40:37.118Z",
  "payload": {
    "action_index": 0,
    "action_type": "run-deployment",
    "invocation": "01993637-97bb-761b-88de-df1d41838c85",
    "reason": "Validation error occurred for 'run-deployment' - Error creating flow run: Validation failed. Failure reason: 'kwargs' is a required property",
    "validation_error": "Error creating flow run: Validation failed. Failure reason: 'kwargs' is a required property",
    "status_code": 409
  },
  "received": "2025-09-11T00:40:37.118Z",
  "related": [
    {
      "prefect.resource.id": "prefect.deployment.e369270b-75b6-4b8b-b82d-174d081ffa6c",
      "prefect.resource.role": "target"
    }
  ],
  "resource": {
    "prefect.resource.id": "prefect.automation.9097714d-d450-4d72-91ae-35cdd9725ac2",
    "prefect.resource.name": "Populate inference Queue",
    "prefect.trigger-type": "event",
    "prefect.posture": "Proactive"
  }
}
In my flow declaration, I have **kwargs because sometimes I need it to take extra kwargs.
Copy code
@flow(
    log_prints=True,
)
def inference(
    video_path: str | Path,
    model_path: str | Path,
    output_path: str | Path = None,
    update_db: bool = True,
    **kwargs,
):
Is this design intentional?
m
thought for 404.2 seconds
Short answer: yes — this is the current, intentional behavior in Prefect 3.x. What’s happening - Prefect generates a parameter schema from your flow’s signature. When a flow includes
**kwargs
, Prefect represents it as a single
kwargs
object in the schema. - With parameter schema enforcement enabled (the default on deployments), a
kwargs
value is required when creating a flow run — even if it’s just an empty dict. - Your automation’s
run-deployment
action likely didn’t include
kwargs
, so the validation failed with "'kwargs' is a required property". Ways to fix it 1) Include
kwargs
when triggering runs (empty if you don’t need extras) - In your automation action’s parameters, include `kwargs`:
{}
at minimum. - Example:
Copy code
parameters:
    video_path: ".../video.mp4"
    model_path: ".../model.pt"
    update_db: true
    kwargs: {}  # or {"extra_flag": true, "threshold": 0.8}
2) Prefer an explicit, optional dict parameter instead of
**kwargs
- This produces a clearer, more user-friendly schema and avoids making it required if you give it a default.
Copy code
@flow(log_prints=True)
  def inference(
      video_path: str | Path,
      model_path: str | Path,
      output_path: str | Path = None,
      update_db: bool = True,
      extras: dict | None = None,   # replaces **kwargs
  ):
      extras = extras or {}
      ...
- Then you’d pass
extras: {...}
when needed. 3) Disable parameter schema enforcement on the deployment - If you want to keep
**kwargs
and not require
kwargs
to be present:
Copy code
from prefect import flow

  @flow
  def inference(..., **kwargs):
      ...

  # When deploying (Python API)
  inference.deploy(
      name="your-deployment",
      enforce_parameter_schema=False,
      ...
  )
- You can also set this via
Flow.from_source(...).deploy(..., enforce_parameter_schema=False)
if deploying from source. References - Prefect 3.x Deploy via Python docs: Deploy via Python If you share how your automation is configured (the
run-deployment
action block, especially its
parameters
), I can suggest the minimal edit to add
kwargs: {}
and get you unblocked.