Skip to content

Markdown description can be hidden on pause_flow_run input box #21491

@tunasplam

Description

@tunasplam

Bug summary

There are some cases where the markdown description on the pause_flow_run input box can be hidden. It looks like it is an issue if there are too many inputs being requested.

Here is a simple example. Submit a flow with the first value as 0 and the pause_flow_run prompt will hide the error box. Reducing the number of input fields to 3 causes the input form to correctly render.

from typing import Self

from prefect import flow
from prefect.flow_runs import pause_flow_run
from prefect.input import RunInput
from prefect.states import Completed
from prefect.client.schemas.objects import State
from pydantic import Field, model_validator, ValidationError


class ToyExampleForm(RunInput):
    field_1: int = Field(description="Must not be 0", json_schema_extra=dict(position=1))
    field_2: int = Field(default=1, description="Field 2", json_schema_extra=dict(position=2))
    field_3: int = Field(default=1, description="Field 3", json_schema_extra=dict(position=3))
    field_4: int = Field(default=1, description="Field 4", json_schema_extra=dict(position=4))
    field_5: int = Field(default=1, description="Field 5", json_schema_extra=dict(position=5))
    field_6: int = Field(default=1, description="Field 6", json_schema_extra=dict(position=6))
    field_7: int = Field(default=1, description="Field 7", json_schema_extra=dict(position=7))
    field_8: int = Field(default=1, description="Field 8", json_schema_extra=dict(position=8))
    field_9: int = Field(default=1, description="Field 9", json_schema_extra=dict(position=9))
    field_10: int = Field(default=1, description="Field 10", json_schema_extra=dict(position=10))

    @model_validator(mode="after")
    def validate(self) -> Self:
        if self.field_1 == 0:
            raise ValueError("Field 1 cannot be 0")
        return self


@flow(validate_parameters=False)
async def deploy_toy_example(form: ToyExampleForm) -> State:
    validated_params = await validate_flow_inputs(form, ToyExampleForm)
    return Completed(message="👍")

DESCRIPTION_MD = """
    One or more of your inputs were invalid.
    Error Message:
    %s
"""

def _format_error(e: ValidationError) -> str:
    return "; ".join(err["msg"] for err in e.errors())

async def validate_flow_inputs(inputs: dict, form: type[RunInput]) -> RunInput:
    try:
        return form.model_validate(inputs)
    except ValidationError as e:
        msg = _format_error(e)

    while True:
        try:
            new_inputs = await pause_flow_run(
                timeout=3600,
                wait_for_input=form.with_initial_data(
                    description=DESCRIPTION_MD % msg,
                    **inputs
                )
            )
            return new_inputs
        except ValidationError as e:
            msg = _format_error(e)

Version info

Version:              3.6.24
API version:          0.8.4
Python version:       3.13.9
Git commit:           195d63c9
Built:                Fri, Mar 27, 2026 04:10 PM
OS/Arch:              linux/x86_64
Profile:              ephemeral
Server type:          cloud
Pydantic version:     2.12.5
Server:
  Database:           sqlite
  SQLite version:     3.50.4
Integrations:
  prefect-aws:        0.5.13
  prefect-dask:       0.3.6
  prefect-email:      0.4.2

Additional context

Here is a screenshot of the issue.

Image

Here is a screenshot after I edited the markdown box to force it to have padding.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguiRelated to the Prefect web interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions