Error message:"were unable to deserialize"

Hi everyone!
I am struggling with this issue for quite some time now and I can’t seem to find a solution to this.
I’m building a workflow that gets multiple files from OneDrive, compresses them, and at the end I need to send a mail with the zip file attached to the mail. I think I’ve tried everything and I still can’t find a solution.
I am 99% sure that the compression node is triggering this error.
I would greatly appreciate any tips/advice on this. Thanks!

1 Like

error code:400

{
  "error": {
    "code": "UnableToDeserializePostBody",
    "message": "were unable to deserialize "
  }
}

Hey @tgruevskii you’re trying to get files from OneDrive, compress them, and then send an email with the zip file attached.

The compression node might be the issue, but let’s solve this together. Can you tell me more about the error you’re getting? What’s the exact error message? That might give us a clue about what’s going wrong.

Also, have you checked the compression node’s settings? Are you sure it’s producing a valid zip file? Maybe try adding a debug node to see what’s happening with the file after compression.

One thing to keep in mind is that the compression node might be outputting a binary file, and the email node might be expecting a specific format. Just saying.

1 Like

Hey, thanks for the reply! The error message that I’m receiving is: were unable to deserialize
Error code 400.
After the compression node, I have a code node which passes the binary data.

Everything seems to be working fine, up until the Outlook node. The error specifically is the attachment in the Outlook node.

Is there any workaround to this? I’ve tried everything that me and Claude and n8n AI assistant could ever think of.
Here’s an image for more context

You’re passing binary data from the compression node to the code node, and then to the Outlook node. The issue seems to be with the attachment part.

Have you tried setting the attachment data type to “Binary” in the Outlook node? And double checked that the file name and MIME type are correct? That might do the trick.

If that doesn’t work, maybe try playing around with how you’re handling the binary data in the code node. Are you using the $.binary property or something similar?

1 Like

I tried everything. Even Claude and ChatGPT could not solve this issue. It seems like that the Compression node has a bug in this particular version? I don’t really know. Anyways, I found a workaround and I’m not using the compression node, so it’s all good. Thanks for your time and help!

Ok @tgruevskii im glad that you found a workaround for the error. Can you share how you solved it to help others.

Are there any updates on this? This issue has been around for quite some time and is not related to the compression node. The attachments work fine for the Outlook “Send Email” node, but not for drafts.

See Outlook NodeApiError: were unable to deserialize - #11 by RMElevate

I have the same issue. Impossible to add an attachment to a draft but I can add one when sending directly.
Note that the “Add attachment to a message” action also fails

WIll take a look to find the error

1 Like

I honestly just skipped compressing the files, as there were multiple ones but they are small in size. I used simple HTTP request to send the email, with all the attachments. However, if the attachments that you send are >4MB, you’ll need a chunk/session upload, since Microsoft Graph supports <4MB attachments. Now, I’m sending the email with all the files as PDF(if they are <4MB) and a batch of mails if they are >4MB. It isn’t the best solution, but it’s an honest work :rofl: