Back to Prefect

Flow Run

docs/v3/api-ref/cli/flow-run.mdx

3.6.30.dev35.0 KB
Original Source

prefect flow-run

command
prefect flow-run [OPTIONS] COMMAND [ARGS]...
<Info> Interact with flow runs. </Info>

prefect flow-run inspect

command
prefect flow-run inspect [OPTIONS] ID
<Info> View details about a flow run. </Info> <AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID" type="string" required> \[required] </ResponseField> </Accordion> <Accordion title="Options" defaultOpen> <ResponseField name="--web"> Open the flow run in a web browser. </ResponseField> <ResponseField name="--output"> Specify an output format. Currently supports: json </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run ls

command
prefect flow-run ls [OPTIONS]
<Info> 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 </Info>

<AccordionGroup> <Accordion title="Options" defaultOpen> <ResponseField name="--flow-name"> Name of the flow </ResponseField> <ResponseField name="--limit"> Maximum number of flow runs to list </ResponseField> <ResponseField name="--state"> Name of the flow run's state </ResponseField> <ResponseField name="--state-type"> Type of the flow run's state </ResponseField> <ResponseField name="--output"> Specify an output format. Currently supports: json </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run delete

command
prefect flow-run delete [OPTIONS] ID
<Info> Delete a flow run by ID. </Info> <AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID" type="string" required> \[required] </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run cancel

command
prefect flow-run cancel [OPTIONS] ID
<Info> Cancel a flow run by ID. </Info> <AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID" type="string" required> \[required] </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run retry

command
prefect flow-run retry [OPTIONS] ID_OR_NAME
<Info> Retry a failed or completed flow run.

The flow run can be specified by either its UUID or its name. If multiple flow runs have the same name, you must use the UUID to disambiguate.

If the flow run has an associated deployment, it will be scheduled for retry and a worker will pick it up. If there is no deployment, you must provide an --entrypoint to the flow code, and the flow will execute locally.

 Examples: $ prefect flow-run retry abc123-def456-7890-... $ prefect flow-run retry my-flow-run-name $ prefect flow-run retry abc123 --entrypoint ./flows/my_flow.py:my_flow </Info>

<AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID_OR_NAME" type="string" required> The flow run ID (UUID) or name to retry. \[required] </ResponseField> </Accordion> <Accordion title="Options" defaultOpen> <ResponseField name="--entrypoint"> The path to a file containing the flow to run, and the name of the flow function, in the format `path/to/file.py:flow_function_name`. Required if the flow run does not have an associated deployment. </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run logs

command
prefect flow-run logs [OPTIONS] ID
<Info> View logs for a flow run. </Info> <AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID" type="string" required> \[required] </ResponseField> </Accordion> <Accordion title="Options" defaultOpen> <ResponseField name="--head"> Show the first 20 logs instead of all logs. </ResponseField> <ResponseField name="--num-logs"> Number of logs to show when using the --head or --tail flag. If None, defaults to 20. </ResponseField> <ResponseField name="--reverse"> Reverse the logs order to print the most recent logs first </ResponseField> <ResponseField name="--tail"> Show the last 20 logs instead of all logs. </ResponseField> </Accordion> </AccordionGroup>

prefect flow-run execute

command
prefect flow-run execute [OPTIONS] [ID]
<AccordionGroup> <Accordion title="Arguments" defaultOpen> <ResponseField name="ID" type="string"> ID of the flow run to execute </ResponseField> </Accordion> </AccordionGroup>