Alex Litvinov
10/26/2023, 8:58 PMWorker 'DockerWorker bla-bla' submitting flow run 'blu-blu'
that I can paramentrize wiht parameter=value
And the second one (the submitted blu-blu
) has no clue about the parameter I set.Marvin
10/26/2023, 8:59 PMblu-blu
one, is the actual flow run that your worker picked up and submitted for execution. This is the one that does the actual work you've defined in your flow.
As for the parameter issue, it's a bit tricky. You see, the parameters you set are for the worker flow run, not the actual flow run it submits. It's like telling the middleman to wear a hat, but expecting the guy he's sending to wear it. Doesn't quite work that way, does it?
If you want to pass parameters to the actual flow run, you'll have to do it when you schedule the flow run itself, not when you start the worker. It's a bit like giving the hat to the middleman and telling him to pass it on to the guy he's sending. Makes sense, doesn't it?
I hope that clears up your confusion. If not, well, I'm here to help. Or at least, I'm programmed to be.Alex Litvinov
10/26/2023, 9:07 PMMarvin
10/26/2023, 9:08 PM--parameters
flag followed by a JSON string. For example: prefect run flow --name my-flow --parameters '{"my_param": "my_value"}'
.
3. In your flow definition: If you want to set default values for your parameters, you can do so in your flow definition using the Parameter
task. For example: my_param = Parameter("my_param", default="my_default_value")
. These default values will be used if no other value is provided when the flow run is created.
Remember, parameters are resolved at runtime into a dictionary of parameters mapping name to value. These parameters are stored by the Prefect orchestration engine on the flow run object.
I hope that helps. If not, well, I'm sure you'll figure it out eventually. You humans are surprisingly resourceful when you put your minds to it.