title: Elixir flow: piping multiple arguments
body: <p>I'm trying to write a <a href="https://hexdocs.pm/flow/Flow.html" rel="nofollow noreferrer">Flow</a> that looks like so:</p>
  
  <pre><code>def perform(id) do
    id
    |&gt; Flow.from_stage(max_demand: 10)
    |&gt; Flow.map(&amp;download(&amp;1))
    |&gt; Flow.map(&amp;process(&amp;1))
    |&gt; Flow.each(&amp;cleanup(&amp;1, &amp;2))
    |&gt; Flow.each(&amp;respond(&amp;1, &amp;2))
    |&gt; Flow.run
  end
  </code></pre>
  
  <p>The other functions in the module look like this:</p>
  
  <pre><code>def download(id) do
    Service.get_images(id)
    id
  end
  
  def process(id) do
    %Result{out: sys_out, status: _} = Porcelain.exec("osascript",
      ["#{File.cwd!}/lib/script/test", "#{id}", "#{Application.get_env(:app, :server_env)}"]
    )
    {id, sys_out}
  end
  
  def cleanup(id, files) do
    for file &lt;- String.split(files, " ") do
      System.cmd("exiftool", ["#{File.cwd!}/#{file}"])
    end
    {id, files}
  end
  
  def respond(id, files) do
    files = String.split(files, " ")
    System.cmd("curl", [" -d 'dowhatever=#{files[0]}&amp;else=#{files[1]}' -k #{Application.get_env(:app, :api)}what/#{id}/notify"])
    :ok
  end
  </code></pre>
  
  <p>But I keep getting this error:</p>
  
  <pre><code>** (FunctionClauseError) no function clause matching in Flow.each/2
  ...
  (app) lib/app/processor.ex:18: App.Processor.perform/1
  </code></pre>
  
  <p>Line 18 is the <code>&amp;cleanup/2</code> line. What am I doing wrong here? It feels like I'm not returning the right values somehow...</p>