title: How to access the asset in workflow process step
body: <p>I am trying to write a workflow <code>process step</code> for the <code>DAM update asset</code> such that the uploaded asset will be sent to an external service that will modify the asset and then the modified asset can be sent to the <code>Metadata extraction</code> step. So I've added my process step to the DAM update asset like this:</p>
  
  <p><img src="https://i.stack.imgur.com/unBj1.png" alt="enter image description here"></p>
  
  <p>And my code looks like this so far:</p>
  
  <pre><code>public void execute(WorkItem item, WorkflowSession wfsession,MetaDataMap args) throws WorkflowException {
      try
      {
          log.info("Here2 in execute method");    //ensure that the execute method is invoked
  
          final Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
          map.put( "user.jcr.session", wfsession.getSession());
  
          ResourceResolver rr = resolverFactory.getResourceResolver(map);
          String path = item.getWorkflowData().getPayload().toString();
          log.info("Here2 path: " + path);
          Resource resource = rr.getResource(path);
          log.info("Here2 resource: " + resource);
          InputStream is = resource.adaptTo(InputStream.class);
          log.info("Here2 assets IS: " + is);
      }
  
      catch (Exception e)
      {
          log.info("Here Error");
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This is what I see in the logs when I upload an asset:</p>
  
  <p>Here2 in execute method
  Here2 path: /content/dam/photo1.JPG/jcr:content/renditions/original
  Here2 asset: null</p>
  
  <p><strong>Question</strong></p>
  
  <ul>
  <li>My external service has an API accepting requests over HTTP. How should I send over the asset to the external service?</li>
  <li>Once the external service modifies the asset, what should I do so that the Metadata extraction step reads the modified asset instead of the original?</li>
  </ul>