How I merge Instagram stories into YouTube videos automatically
I record short Instagram stories from wherever I am. At the end of the day they become one
YouTube video with a custom thumbnail. The recording is the stories. The rest is a pipeline.
I built it in Integromat — now Make.com — plus
Pipedream for the upload. The YouTube module was not licensed on Integromat yet. The merged file is also too big to run through Integromat. Those two constraints decide the shape.
RapidAPI returns every live story URL
The first hop is the Instagram Stories endpoint on RapidAPI. I put in my Instagram user id. It returns every story that is currently up, with a URL for each file.
I want a timestamp on each clip later so I can republish the same stories onto TikTok, YouTube Shorts, and Instagram Reels. I did not build that in this pass. The day-level split is enough to start.
Days and Stories in Airtable
Dropbox is the easy file store in Integromat. I used
Airtable instead so every story I ever post sits in one place I can query later.
Two tables. Days. Stories. A relation from each story back to its day. I format the date without the time — the clock just makes the key messier.
Each run creates a Day, then an iterator walks every story: create the Story record, download the file from the URL, link it to that Day. The first pull had audio. That is the check that matters on a video pipeline.
Merge on SFTP after the last bundle
Integromat cannot be the merger. I already had a small MP4 merger sitting on an SFTP box. The scenario uploads each story into that day's folder. The merger concatenates everything in the folder.
Do not fire the merge on the first file. Wait until the iterator is on the last bundle — position equals the total number of bundles — then upload and merge once.
Skip pictures. Instagram stories are mixed. Media type 2 is video. Anything else stays out of the folder.
Give every file a unique name. I uploaded a batch with the same filename and overwrote the clips. Date-formatted folder names also broke the server; it would not accept that path.
The first full merge came back in the right order. That was the risk I was watching. After that I treated order as solved.
Stay under 80MB and the five-minute timeout
Integromat kills a scenario at five minutes. Merging a day's stories takes longer than that. I put a 300-second sleep after the merge starts, then an SFTP list on the uploads directory, last modified descending. The top file is the new output.
Two of those waits give you about 15 minutes of merge time. Add more if the files are large. The first real run timed out merging 17 stories.
The other hard limit is about 80MB. That is as large as Integromat will hold a file. Do not pull the merged video back into the scenario except as a URL. Individual story downloads are fine. The stitched file is not.
When I need to paste a URL I already copied, Slapdash clipboard history is the fast path.
Bannerbear writes the thumbnail
Someone had mentioned Bannerbear. I wanted a first pass at their API: a template, dynamic text, a PNG. I glanced at
Figma and stayed on Bannerbear.
They ping a webhook when the image is ready. I pass the Airtable record through Bannerbear metadata so the next scenario knows which Day to update. Search the Day, write the thumbnail URL onto it. The template I used in the video is a placeholder. Spend time on the image later.
Pipedream uploads to YouTube; Integromat cannot
YouTube was not available on Integromat. They were still waiting on the license. I looked at Zapier, then used Pipedream. It will take a large file — they quote five terabytes — and it is much cheaper than Integromat. You can run your own Node.js. The UX is worse. I still live in Integromat for everything else.
Upload the video first. Pipedream returns a video id. Then a separate scenario downloads the Bannerbear PNG from Airtable and sets it as the thumbnail. I search a view I called story pipeline where created time is today.
Four scenarios, 2:42 UK
The description says three Integromat scenarios plus Pipedream. The thumbnail pass made four scenarios talking to each other.
One: pull live stories, create the Day, download each video, upload to SFTP, start the merge.
Two: sleep, find the newest file in uploads, write that URL onto the Day, start Bannerbear.
Three: Bannerbear webhook, update the Day with the thumbnail, POST the file to Pipedream.
Four: take the video id, fetch the PNG, set the YouTube thumbnail.
I schedule it once a day at 2:42, late enough that I have posted every story I am going to post in UK time. If it works you see a video that night: every story from that day, one file, custom thumbnail.
OFM Insider and
Automation Academy if you want the communities from this video. Tools and resources are
Bento. A one-off session is
Calendly. Four sessions is
4x Consultations.
Transcript
Today I'm going to build a automation where we pull Instagram stories automatically from our own Instagram profile and then these can automatically be merged together to create a long-form piece of video content which will then be automatically published on YouTube as well so by it just creates a much more like seamless recording process if I can record short stories from anywhere and then we um merge them all together into one video file and upload them uh we're also someone mentioned to me the other day Bannerbear
And I want to have a little play around with their API so I'm going to plug that in to actually generate custom thumbnails dynamic thumbnails using their API so it's going to be the first time I played around with it so yeah let's let's see what it can do let's go ahead and jump straight into Integromat and I'm using two different apis I've just like added in and set up just to speed up the course of this video the first one we're using is Instagram stories by a service called rapid API
And the only thing I've done is added in my Instagram user id and this just all it will do is I've run it once here for an example um one second yeah it will pull all of the stories that we have up and it will give us the url we've got quite a few okay so let's first off let's get started by we're going to want to grab the file and I think we're actually going to need an iterator to go through each one of each one of the files that's returned to url only other thing is that we ideally need some type of structure about when the video was taken because the other way that I'm thinking to use this is to republish content onto TikTok
And YouTube Shorts as well as Instagram Reels actually but we can build it in later uh and then just to I keep things very simple I'm not in fact I don't mind the platform but it's really easily it's really well integrated into Integromat so we can use Dropbox and the first thing I want to do is actually create a folder okay I'm going to make a little bit of logic here just to make sure that we correctly split each each day
So I'm going to add what's going to be I'm going to make a little Airtable structure quickly for us to have as a just yeah just an easy way to manage this so and this also means that we can have a centralized way of storing all of the stories that we ever make in case we want to use them in in future so it's and I'm just thinking what's going to be I know that will do for now let's and let's add a second table this can be the days
And this can be the actual stories that we download days we'll make a relation to the so this will actually be like a really interesting way for us to mass produce or mass release content I should say I'm doing another dashboard stories yes uh okay so let's come back over every time this scenario runs what we want to do is create a new day in the day field and all of the stories that we retrieve from the Instagram will automatically be linked linked to that
Okay uh some I think we can also just format the date uh we yeah so we'll format the date because we don't need the exact time and it's just going to over complicate things a little yeah okay that looks good get a file Airtable create a record enter we'll link them all correctly into our main our table will only download from the url we're going to do it in a slightly different order actually so yeah that has worked correctly so just to walk you through the automation this is going to grab the Instagram stories over here we're going to create a new day an Airtable I want each video linked into a specific day it just will make it much easier to manage
And work with in future if we want to republish the content elsewhere iterator is going to go through every single um story that we post and it's going to upload them in Airtable and then this is like a little video merger that we made that will merge all MP4 files together let's um let's run it once and just double check that this is it's working first off it should create a date here and then it should download all of our Instagram stories
And link them here and yeah it looks like it's working working well yeah just check that it's downloaded yeah we have audio as well great so next step is going to be we want to get a file so for each file you can pull them out SFTP I think this is the folder structure I had in fact we only need to run in fact I want to bring that back back and then we want to start uploading the and then we want to do total number of bundles sorry
And the position equal to total number of bundles in fact that works the same both ways so that means it will only process once all of the let's just delete the old data and I just want to give this a little run once let's check what happens let's see if it works okay that's worked uh I think it might be because of the this folder perhaps instead we should and then also there if we try with record id in fact it doesn't matter
Yeah I think because it's a date format that the server can't accept it as a um can't accept that file type but I could could be wrong sorry that um the type of that name so this is now uploading all of our videos on the SFTP server and that folder on the SFTP server is then used to merge all of the videos correctly there's going to be a few things that we have to check though the first one is does it merge them together in the correct order which
And that's going to be quite an interesting problem to solve that's fine uh okay interesting um so we need to add in a filter to don't merge to don't upload any uh any videos uh sorry any pictures basically type so we need to make sure that the video type I think the best way to do this is just check that media type is two it's going to be an even easier way in there send a folder that contains more than interesting perhaps because it's giving them all the same file name uh could be one reason ah that's completely my fault um
Let's run it manually but I forgot to change it back to the variable videos are now merging let's see what in fact as while we're sitting here why don't we make an account with Bannerbear and let's have a little play around with their API and Bannerbear is what we will use to make custom YouTube thumbnails uh apparently they I think because of their image they're but why don't we check if Figma has any all right save template here we've got a it's just finished merging quite a large I imagine that's where they give the oh they generate that dynamically we need to make a second scenario I
Okay so let's see what that comes back with this should now have downloaded we can open and see what the result of our everything seems to be in the correct order which is great news yeah good good good good so much request then what we want to do is we want to add a sleep timer here because it will time out after five minutes but generally it will take longer than five minutes to merge the videos together so it's 300 isn't it
And then what we can do is we'll add in a module SFTP list of folders content come back in here show and we want to list everything in the uploads directory before sort by last modified date sort order descending files so this should then return us the file that is listed there which it has done which is also great news and module and then under day maybe we can make a new field to add in the the fully merged video and
Then we can trigger Bannerbear and I'm just going to make a second scenario because I think that they they're going to ping us when it successfully creates create yeah this is going to give us 15 minutes of merge time we can always add in more and the only reason that I don't want to download it the largest file size Integromat can handle I think is like 80 megabytes um and I think that this video emerging will go over it so we need to make sure that we don't actually post the file at any point on Integromat itself except for when we're downloading the individual stories otherwise the
Okay anyway that that would have worked I don't really want to wait 15 minutes again for that to go through but we've got the video there I can just run this manually just to make sure that they will pull of video let me and this is like a really interesting feature actually that I I'm often talking about Slapdash this I think is a really underrated feature where we can just copy again anything that was in our clipboard history so I can
Now run that that has gone through correctly and it should be downloading our full length video again let's just double check whenever like you're passing data through things particularly video you just want to make sure it's from yeah we've got audio and it seems to be the full length we've made like a lot of modifications for this video file so but yeah it seemed seems to have come through correctly now let's trigger this Bannerbear testing see how long it takes to make a uh from that again
And it makes a nice little custom video for us oh sorry custom text cool let's so let's use that and we can use this actually as a trigger to know let's go ahead and delete all these old ones and we can just make it a very like and it means that we can just pull the all the most recent uh get a record search records and then we'll just search in this view and that's how we'll pull like the the final video file or in fact we could actually pass maybe a cleaner way to do this is to pass it through his metadata in banner
And in fact let's just go we use the old one that we were using I hope that information is passed through there we go metadata they have given it there we go and then we can go and the thing to do now will be to invest a little bit more time in making a better better thumbnail and take a png image doesn't really matter to me nice okay then let's go and trigger let's do Zapier the only reason to do YouTube doesn't work on Integromat they're waiting to get their license approved
So I think one way I just thought we might be able it's a little talking Pipedream which we may be able to use to trigger on YouTube do web five terabytes okay so for working with data this is going to be a much better better option upload a video yeah good so I think we can actually update the thumbnail after might be a better way of doing it um save uh let's just make sure that the um that it shows and the audio has come through
And everything this is like a really hacking together a solution but you know it's quite interesting interesting problem to solve and I often forget about Pipedream as well it's not a tool that I use very often but it is much much cheaper than Integromat it's quite good it's really growing quite um the tools that they have are really quite good and it's very flexible as well you can run your own Node.js code on there as well um yeah there's the only problem for me is like the UX is just nowhere near as good as Integromat
And when you spend most of your life sitting on one of these platforms like you don't want to be working on at all that is uh that is annoying to work with like UX plays a massive part and yet it's so overlooked it's uploaded I'm I'm very happy with that um so yeah we can now I'm just going to run one last time yeah that's uh let's go through the scenario so first step is grab Instagram stories that are currently active on the phone create a new day in the Airtable create a folder for that specific day upload all of the stories into Airtable get download each individual Instagram story
And then upload them to be ready to be merged this will then merge the files together it's got a five minute timeout which is why we have to add in these two second parts just to allow up to 15 minutes for it to merge the videos together and it's going to depend on how big the files are that you are uploading perhaps you need to add in more perhaps you need to add in less when we tried it the first time it timed out when it was merging 17 different um
Then it's just going to check for the output file from here and then it's going to upload into um into Airtable output file and it will start generating the thumbnail uh after the thumbnail is finished generating it's going to trigger a web hook and we're going to get a record get the record uh sorry someone's at the door get the day update it with the update with the new thumbnail which you can see is available here and then we're going to make a request to Pipedream to upload the video for us
And then one final touch that we can do just as I said I was going to do it probably use Zapier or no we can't we can use and let me try and set this up we want to do upload a thumbnail that's exactly what we want yeah okay let's see if we can do this upload the thumbnail connect it looks like it is going to work so another thing to do would then be YouTube uh get a channel maybe channel id
Let's copy that I'm gonna have to get my own channel or does Pipedream return us a video id that would be useful to know yes they do so okay let's go ahead and do okay we're gonna have to add in another scenario it's getting a little bit a little bit messy get request url video published ourselves I'm just going to pull the video id from to grab the file Airtable search records there's so many parts involved in it now um Airtable search records story pipeline one
And we're just going to use this view created time is today then and we actually need to get the file http and that should successfully upload the thumbnail just to give myself like the data format just for future runs I'm just going to ping this endpoint myself again accepted there we go yeah okay so now we just need to add that final piece of information into and that will tell us that it is working the final one is here we can remove these last parts uh the one thing that I do need to make stop that
And we want to run once every day at let's run it like to in fact let's run it 242 so that's coming to the end of like UK time uh end of the day and it will trigger in time for my um for by the end of the day my time all of I will have posted all the stories for the day then it will go ahead and merge them and it will post them on on YouTube for me so if I have built this successfully you will see a video posted at the end of today with a custom thumbnail
But with all with the all the Instagram stories I have merged together into one YouTube video yeah this was actually quite interesting to build not quite as seamless as I planned because we've got four different scenarios communicating with each other but interesting to build nonetheless yeah any questions as always leave a comment