Cannot convert binary to base64 in Code node - task runner returns "filesystem-v2"

Hi,

I’m on n8n 2.12.1 self-hosted with binaryMode: separate.

I’m trying to attach an Excel file to an email via the Graph API.
The binary is generated by a “Convert to File” node (xlsx).

In my Code node I tried:

// Attempt 1
const binaryBuffer = await this.helpers.getBinaryDataBuffer(item, ‘data’);
→ Unknown error (JsTaskRunnerSandbox)

// Attempt 2
const base64 = item.binary.data.data;
→ returns “filesystem-v2” instead of real base64

Is there any way to read binary data as base64 inside a Code node
when using the task runner?

Or should I use a completely different approach to attach
a generated Excel file to a Graph API sendMail call?

Thanks

Welcome to the n8n community @Sahbi_hanafi
filesystem-v2 is the file-backed binary reference, not the actual base64. I’d avoid converting it in Code here and send the binary directly in the HTTP Request/Graph API step instead

tried this exact setup once - the getBinaryDataBuffer approach fails silently with the task runner. filesystem-v2 is actually a fallback path string, not real base64 data. what worked for us was falling back to filesystem mode and using the file attachment approach instead of trying to convert binary in the code node. the graph api sendmail should accept a file attachment, might be easier than fighting the conversion.