Jeffery Newburn
09/06/2021, 5:29 PMwith Flow("ROI Report Generator") as flow:
start_date = Parameter(name="start_date")
end_date = Parameter(name="end_date")
to_list = Parameter(name="to_list")
email_domain = Parameter(name="email_domain", default="")
account_uuid = Parameter(name="account_uuid")
Run:
state = flow.run(
account_uuid=527132950,
start_date="2020-11-01",
email_domain="",
end_date=None,
to_list=["<mailto:jeff.newburn@logikcull.com|jeff.newburn@logikcull.com>"],
)
Error:
TypeError: run() got an unexpected keyword argument 'account_uuid'
Can someone help me understand what is going on here? Why do Parameters have to be used in a flow for the flow not to explode?Kevin Kho
flow.run()
has a dict for parameters. flow.run(parameters={'account_uuid': 527132950})
. You can set Parameter(name="xxx", required=False)
Jeffery Newburn
09/06/2021, 6:05 PMKevin Kho
Jeffery Newburn
09/06/2021, 8:09 PMKevin Kho
Parameter()
creates it, but passing it somewhere is the one that actually calls it. Without using it, the Parameter doesn’t get registered because it’s a task that wasn’t used.
To avoid this, you might be able to do:
with Flow("ROI Report Generator") as flow:
start_date = Parameter(name="start_date")()
end_date = Parameter(name="end_date")()
Kevin Kho
Jeffery Newburn
09/07/2021, 8:44 PM