title: Transform Header and payload to Json nodes
body: <p>I am trying to enrich payload with some Headers keys and convert to a json structure like that: </p>
  
  <pre><code>{
   "Header": { ["key" : "value", "key2": "value"]}
   "Payload": { "attribute" : "value" }
  }
  </code></pre>
  
  <p>My gateway is configured like this:</p>
  
  <pre><code>    @MessagingGateway 
  public static interface MailService {
      @Gateway(requestChannel = "mail.input")
      void sendMail(String body, @Headers Map&lt;String,String&gt; headers);        
  }
  </code></pre>
  
  <p>Here is my flow:</p>
  
  <pre><code>@Bean 
  public IntegrationFlow errorFlow(){
      return IntegrationFlows.from(recoveryChannel())
                              .transform("payload.failedMessage")                             
                              .enrichHeaders(c -&gt; c.header(FileHeaders.FILENAME, "emailErrors.json"))
                              .handle(this.fileOutboundAdapter())
                              .get();
  }
  </code></pre>
  
  <p>How could I solve this issue?</p>
  
  <p>Thanks.</p>