I want to run a registered flow with `prefect run...
# prefect-community
s
I want to run a registered flow with
prefect run serer --name flowname
but I need to set a parameter for this run. Is this possible?
๐Ÿ‘€ 1
d
Copy code
(process_delete_events__staging) dylanhughes@Dylans-MacBook-Pro-Prefect ~/d/f/d/process_delete_events__staging> prefect run server -h                                                                                                                     process-delete-events
Usage: prefect run server [OPTIONS]

  Run a registered flow with Prefect Server

  Options:
      --name, -n                  TEXT        The name of a flow to run [required]
      --version, -v               INTEGER     A flow version to run
      --parameters-file, -pf      FILE PATH   A filepath of a JSON file containing parameters
      --parameters-string, -ps    TEXT        A string of JSON parameters
      --run-name, -rn             TEXT        A name to assign for this run
      --watch, -w                             Watch current state of the flow run, stream output
                                              to stdout
      --logs, -l                              Get logs of the flow run, stream output to stdout
      --no-url                                Only output the flow run id instead of a link

  If both `--parameters-file` and `--parameters-string` are provided then the values passed
  in through the string will override the values provided from the file.

  e.g.
  File contains:  {"a": 1, "b": 2}
  String:         '{"a": 3}'
  Parameters passed to the flow run: {"a": 3, "b": 2}

  Returns:     - flow_run_id (str): the flow run ID if the flow run
  completes     - None: if flow or flow run canot be found

Options:
  -h, --help  Show this message and exit.
It is!
So if you need help with any prefect cli command, just type
-h
for the help menu
In your case, you can provide either a
--parameters-file
or a
--parameters-string
@Sven Teresniak
s
thats easy! and very nice! my fault was that i just did
prefect run -h
๐Ÿ™‚
d
Yup, understandable
Our pattern is that every sub-command has its own
-h
So check for all the help strings! haha
s
prefect is very very nice. we have our first prototype running and prefect will really help our company. ๐Ÿ™‚
d
Thank you! Weโ€™re glad to hear it =]