Is it possible to run a flow from command line and have the run show up in the web UI?
j
Is it possible to run a flow from command line and have the run show up in the web UI?
n
Hi @jack - no that's not possible right now unless you create a file that will make an explicit call to the API like this:
Copy code
mutation {
  create_flow_run(...args) {
    id
  }
}
Ah I'm sorry @jack I misspoke, you can run a flow via the CLI using this:
Copy code
prefect run cloud --name "My Flow Name" --project "Hello, World!"
But the flow will need to be registered and you'll need to have an agent running still.
j
@nicholas if we are using a standalone server, do we still use the
cloud
argument?
d
It might be server
prefect run flow --name Test-Flow --project My-Project -ps
@jack AFAIK that’s the correct one
Copy code
(prefect) dylanhughes@Dylans-MacBook-Pro-Prefect ~/d/prefect> prefect run                                                                                                                                                                                          master
Usage: prefect run [OPTIONS] COMMAND [ARGS]...

  Run Prefect flows.

  Usage:
      $ prefect run [STORAGE/PLATFORM]

  Arguments:
      flow    Run a flow with a backend API

  Examples:
      $ prefect run flow --name Test-Flow --project My-Project -ps '{"my_param": 42}'
      Flow Run: <https://cloud.prefect.io/myslug/flow-run/2ba3rrfd-411c-4d99-bb2a-f64a6dea78f9>

      $ prefect run flow --name Test-Flow --project My-Project --watch
      Flow Run: <https://localhost:8080/flow-run/2ba3rrfd-411c-4d99-bb2a-f64a6dea78f9>
      Scheduled -> Submitted -> Running -> Success

Options:
  -h, --help  Show this message and exit.
prefect run
on its own shows the health command
just make sure you’ve set
prefect backend server
so the CLI knows to talk to your prefect server instance