Title
j

Joe

10/28/2021, 9:22 PM
Hello everyone, I'm using
start_flow_run.map(...)
to use the same flow, but iterate across some provided parameters. Unfortunately when I set the
flow_name=unmapped('webfs')
I get this error when attempting to run the flow: `ValueError: Received both
flow_id
and
flow_name
. Only one flow identifier can be passed.`
1
m

Michael Adkins

10/28/2021, 9:23 PM
Hey @Joe -- just to check, you're not passing a
flow_id
too?
j

Joe

10/28/2021, 9:23 PM
Negative
storage = create_storage(flow_name=flow_name)
    run_config = UniversalRun(labels=['local'])

    with Flow(flow_name, storage=storage, run_config=run_config, result=storage.result) as flow:
        image = parameter_webfs_image()
        command = parameter_container_command()
        network = parameter_container_network()

        create_host_config = CreateHostConfigWithMount()
        create_container = CreateContainer(trigger=not_all_skipped)
        start_container = StartContainer()
        mongo_volumes = MongoVolumes()
        volumes = mongo_volumes()
        mapped_flows = create_flow_run.map(
            volumes,
            flow_name=unmapped('webfs'),
            project_name=unmapped(project_name),
        )
m

Michael Adkins

10/28/2021, 9:24 PM
You're passing
volumes
as a positional argument
mm
Yeah. The first argument is
flow_id
so you're passing it in there.
j

Joe

10/28/2021, 9:25 PM
Ah, I'm unclear on how to pass the mapped information in that case... Is it another wrapper?
like the unmapped one I mean
m

Michael Adkins

10/28/2021, 9:26 PM
Perhaps you want...
mapped_flows = create_flow_run.map(
            parameters={"volume": volumes},
            flow_name=unmapped('webfs'),
            project_name=unmapped(project_name),
        )
j

Joe

10/28/2021, 9:27 PM
and that will iterate across the volumes?
m

Michael Adkins

10/28/2021, 9:27 PM
I think so, I'm actually not sure with it wrapped in a dictionary like that
That might require something else..
But generally yes, any task inputs you pass that aren't wrapped in
unmapped
are mapped over.
@Kevin Kho I think you'll know how to do this better than I
j

Joe

10/28/2021, 9:29 PM
Ahhh, OK now I see
That does appear to do it since my volumes list is just the dict for task parameters
Thanks!
m

Michael Adkins

10/28/2021, 9:30 PM
You're welcome!
k

Kevin Kho

10/28/2021, 9:39 PM
Was this fixed @Joe? Just got here 😅
j

Joe

10/28/2021, 11:53 PM
Yeah - I was having a hard time interpreting the docstring for how to pass the iterated argument(s) not realizing the goal was to pass any **kwarg that the mapped task accepted as an iterable of the arguments valid type(s)
Which gets very abstract once you start executing flows as tasks due to the massive parameter space.