How to post an image from HTTP node to Mattermost node

Hi everyone,

I’m working on an n8n workflow where I fetch an image from an HTTP URL (in this case, a Grafana monitoring chart), and I want to send that image to a Mattermost channel.

Here’s a simplified version of my workflow:

  1. Trigger: Manual or Webhook
  2. HTTP Request: Get image from https://grafana-monitoring...
  3. (Code Node): I can see the binary data comes back properly
  4. Mattermost Node: I want to post the image as part of the message

However, I’m not sure how to pass the image (binary) correctly into the Mattermost API.
I’ve tried different configurations but the image doesn’t appear in the chat – either it shows nothing, or just the link/text.

Any help or example on:

  • How to send the image as a file?
  • What config is needed in the HTTP Get node and Mattermost node?

Would really appreciate any advice or example!

Thanks :pray:

Hello @khoatt89.
Hope you are well!

Check if the HTTP Request Node is already configured correctly with the output in binary format. Some important configurations that ensure that the file is downloaded correctly. Check out these details below

Method: GET
URL: (The full URL to get the Grafana image).
Download File: true (download the response as binary data).
Binary Property Name: data (as shown in the print).
Expected result: The binary output of the HTTP Request node is in a field called data, with the file information (File Name, Mime Type, etc.) and the actual image data.

Go to the Mattermost node to send the binary file and see if the Mattermost Node configuration follows the reasoning below.

Resource: Message
Operation: Post
Channel Name: Enter the name or ID of the Mattermost channel (e.g.: my-team:some-channel).
JSON Parameters: Mark as true.
Message: Text message that will accompany the attachment (e.g.: Here is the updated graph:).

In the Binary Properties, confirm that it is as follows.

Binary Property Name: data (the same name as the binary field returned by the HTTP Request node).

Hope this helps.
Best regards