# Cloud Tasks


These tasks are classified as Cloud due to their reliance on Prefect Cloud.

# FlowRunTask

class

prefect.tasks.cloud.flow_run.FlowRunTask

(flow_name=None, project_name=None, parameters=None, **kwargs)[source]

Task used to kick off a flow run using Prefect Core's server or Prefect Cloud. If multiple versions of the flow are found, this task will kick off the most recent unarchived version.

Args:

  • flow_name (str, optional): the name of the flow to schedule; this value may also be provided at run time
  • project_name (str, optional): the Cloud project in which the flow is located; this value may also be provided at run time
  • parameters (dict, optional): the parameters to pass to the flow run being scheduled; this value may also be provided at run time
  • **kwargs (dict, optional): additional keyword arguments to pass to the Task constructor

methods:                                                                                                                                                       

prefect.tasks.cloud.flow_run.FlowRunTask.run

(flow_name=None, project_name=None, parameters=None)[source]

Run method for the task; responsible for scheduling the specified flow run.

Args:

  • flow_name (str, optional): the name of the flow to schedule; if not provided, this method will use the flow name provided at initialization
  • project_name (str, optional): the Cloud project in which the flow is located; if not provided, this method will use the project provided at initialization
  • parameters (dict, optional): the parameters to pass to the flow run being scheduled; if not provided, this method will use the parameters provided at initialization
Returns:
  • str: the ID of the newly-scheduled flow run
Raises:
  • ValueError: if flow or project names were not provided, or if the flow provided cannot be found
Example:
    from prefect.tasks.cloud.flow_run import FlowRunTask

kickoff_task = FlowRunTask(project_name="My Cloud Project", flow_name="My Cloud Flow")




This documentation was auto-generated from commit n/a
on May 14, 2020 at 21:12 UTC