🛠️ Change Binary MimeType/Extension
How it works
This workflow changes the file name, and therefore the extension and MIME type, of any binary file passed to it. This is perfect for converting file formats on the fly, like turning a Telegram voice message (.oga) into an MP3 for an AI transcription service.
Set New File Name: The SET OUTPUT FILE NAME node is where you define the desired output file name and extension (e.g., audio.mp3). It also dynamically captures the property name of the incoming binary (e.g., data). Extract Binary Data: The workflow temporarily converts the binary file into a Base64 text string to make it accessible in the next step. Rebuild Binary with New Name: A Code node takes the Base64 data and reconstructs it as a binary file, but this time, it assigns the new file name you specified. n8n automatically sets the MIME type based on the new file extension.
Set up steps
Setup time: < 1 minute
This workflow is designed to be used as a sub-workflow.
In your main workflow, add an Execute Sub-Workflow node where you need to change a file's type. In the Workflow parameter, select this "Change Binary MimeType/Extension" workflow. Open this workflow and go to the SET OUTPUT FILE NAME node. Modify the output_file_name value to your desired file name (e.g., voice_message.mp3 or document.pdf). Save this workflow. Now, any binary file you send to it from your main workflow will be returned with the new fileName and mimeType.
Related Templates
Get Airtable data via AI and Obsidian Notes
I am submitting this workflow for the Obsidian community to showcase the potential of integrating Obsidian with n8n. Whi...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments