workflows.fit
Back to n8n workflows
n8n templateFreeBy Jitesh Dugar

Create event recap Instagram carousels from photo dumps using Upload to URL

Automate your post-event Instagram carousel using a fan-out and merge pattern. One Code node splits the photos array into individual n8n items. Every photo then flows through HTTP Fetch, Upload to URL, and a child con...

Data & StorageDevelopmentCore NodesCommunicationHITLUtilitySticky NoteWebhook
Loading interactive preview...

Template notes

Automate your post-event Instagram carousel using a fan-out and merge pattern. One Code node splits the photos array into individual n8n items. Every photo then flows through HTTP Fetch, Upload to URL, and a child container Code node independently. A Merge node collects all completed items, a final Code node sorts them and builds the children parameter, then the carousel is assembled and published. Upload to URL is a real visible node on the canvas, running once per photo.

---

What This Workflow Does

Intake and Fan-Out - Webhook - Receive Event Payload -- accepts a POST to /ig-event-recap. Responds after the full workflow completes. Typically triggered by a photographer tool, event CMS, or manual call immediately after event photos are ready. - Code - Validate Caption and Split Photos -- validates the photos array (2-10 items, HTTPS URLs, deduplicated), builds a multi-block storytelling caption from all event metadata, then returns one item per photo. Each item carries the photo URL, slideIndex, fullCaption, eventName, and IG credentials. This fans the downstream nodes out to process all photos in parallel.

Per-Photo Pipeline (runs once per item) - HTTP - Fetch Photo Binary -- downloads each photoUrl as a binary file. Runs once per item. Works with any public HTTPS image source. - Upload to URL -- real node on the canvas, runs once per photo item. Uploads the binary and returns a stable public CDN URL. This step is mandatory because Instagram child container endpoints require a direct public HTTPS image URL and reject binary payloads. - Code - Create Child Container -- calls the Instagram Graph API per item with iscarouselitem set to true. Returns childContainerId and cdnUrl alongside the slideIndex for sort ordering downstream.

Fan-In and Carousel Assembly - Merge All Child Items -- waits for all per-photo items to complete and collects them into a single execution. This is the fan-in point. Mode: Merge by Position. - Code - Build Children Param -- receives all merged items, sorts by slideIndex to guarantee photo order is preserved, joins child container IDs as a comma-separated string, and re-attaches the caption and event metadata from the first item. - HTTP - Create Carousel Container -- POSTs to the Instagram Graph API /media endpoint with mediatype CAROUSEL, the sorted children ID string, and the caption. Caption is set only on the parent container. - Wait 8s -- buffer before the publish call to allow Instagram to validate all child assets. - HTTP - Publish Carousel -- calls /mediapublish. Returns the live Post ID. - HTTP - Fetch Post Metadata -- retrieves permalink and timestamp.

Logging and Notification - Airtable - Log Published Post -- creates a record with event name, Post ID, permalink, slide count, and publish timestamp. For client reporting and campaign tracking. - Slack - Notify Team -- sends event name, slide count, permalink, and publish timestamp. - Respond to Webhook -- returns a structured JSON payload with mediaId, permalink, slideCount, eventName, and publishedAt.

---