prefect.cli.flow_run

Command line interface for working with flow runs

Functions

inspect

inspect(id: UUID, web: bool = typer.Option(False, '--web', help='Open the flow run in a web browser.'), output: Optional[str] = typer.Option(None, '--output', '-o', help='Specify an output format. Currently supports: json'))
View details about a flow run.

ls

ls(flow_name: List[str] = typer.Option(None, help='Name of the flow'), limit: int = typer.Option(15, help='Maximum number of flow runs to list'), state: List[str] = typer.Option(None, help="Name of the flow run's state"), state_type: List[str] = typer.Option(None, help="Type of the flow run's state"))
View recent flow runs or flow runs for specific flows. Arguments: flow_name: Name of the flow limit: Maximum number of flow runs to list. Defaults to 15. state: Name of the flow run’s state. Can be provided multiple times. Options are ‘SCHEDULED’, ‘PENDING’, ‘RUNNING’, ‘COMPLETED’, ‘FAILED’, ‘CRASHED’, ‘CANCELLING’, ‘CANCELLED’, ‘PAUSED’, ‘SUSPENDED’, ‘AWAITINGRETRY’, ‘RETRYING’, and ‘LATE’. state_type: Type of the flow run’s state. Can be provided multiple times. Options are ‘SCHEDULED’, ‘PENDING’, ‘RUNNING’, ‘COMPLETED’, ‘FAILED’, ‘CRASHED’, ‘CANCELLING’, ‘CANCELLED’, ‘CRASHED’, and ‘PAUSED’. Examples: $ prefect flow-runs ls —state Running $ prefect flow-runs ls —state Running —state late $ prefect flow-runs ls —state-type RUNNING $ prefect flow-runs ls —state-type RUNNING —state-type FAILED

delete

delete(id: UUID)
Delete a flow run by ID.

cancel

cancel(id: UUID)
Cancel a flow run by ID.

logs

logs(id: UUID, head: bool = typer.Option(False, '--head', '-h', help=f'Show the first {LOGS_WITH_LIMIT_FLAG_DEFAULT_NUM_LOGS} logs instead of all logs.'), num_logs: int = typer.Option(None, '--num-logs', '-n', help=f'Number of logs to show when using the --head or --tail flag. If None, defaults to {LOGS_WITH_LIMIT_FLAG_DEFAULT_NUM_LOGS}.', min=1), reverse: bool = typer.Option(False, '--reverse', '-r', help='Reverse the logs order to print the most recent logs first'), tail: bool = typer.Option(False, '--tail', '-t', help=f'Show the last {LOGS_WITH_LIMIT_FLAG_DEFAULT_NUM_LOGS} logs instead of all logs.'))
View logs for a flow run.

execute

execute(id: Optional[UUID] = typer.Argument(None, help='ID of the flow run to execute'))