Anyone could help me with this seemingly simple hu...
# ask-community
m
Anyone could help me with this seemingly simple hurdle? I have
Copy code
with Flow("My Flow") as flow:
    my_param = Parameter("my_param", default='a default value')
    ...

flow.run()
# flow.run(parameters={"my_param": "overwritten value"})
When I run this, I get
Copy code
raise ValueError(
ValueError: Flow.run received the following unexpected parameters: my_param
What am I missing?
k
Hey Maxime, It looks like the parameter you created was never added to the flow, instantiating a task doesn’t necessarily add it to the flow. Be sure to add the task (all parameters are tasks) to the flow using the
flow.add_task()
or the
flow.set_dependencies(task=task_name)
method. More information can be found here: https://docs.prefect.io/core/advanced_tutorials/task-guide.html#adding-tasks-to-flows
m
@Kyle Moon-Wright, thanks!
👍 1
j
@Marvin archive “Flow run received the following unexpected parameters”