Auto-Generate Instagram Captions from Zendrop Product Images Using OpenAI
Automatically fetch a Zendrop product image URL, send it to OpenAI to generate an engaging Instagram caption, and post it directly to Instagram. Social media managers save hours of manual copywriting every week.
- 1
Trigger: Manually start or schedule the workflow
Add a
Schedule Triggernode (or useManual Triggerfor testing). Set it to run daily or at whatever cadence you want to post. This fires the workflow and passes control to the next step. No credentials needed. - 2
Fetch product data from Zendrop via HTTP Request
Add an
HTTP Requestnode. SetMethodto GET andURLto the Zendrop API endpoint for your product catalogue, e.g.https://api.zendrop.com/v1/products. UnderHeadersaddAuthorization: Bearer YOUR_ZENDROP_API_KEY. In the nodeNotesfield store your API key hint. The response will includeimage_urlandtitlefields for each product. Limit results to 1 product per run using the query parameter?limit=1. - 3
Extract image URL and product name with Set node
Add a
Setnode to pull clean values from the HTTP response. Create two fields: setproductImageto{{ $json.data[0].image_url }}andproductNameto{{ $json.data[0].title }}. This keeps downstream nodes simple and avoids deeply nested expressions. - 4
Generate Instagram caption with OpenAI
Add an
HTTP Requestnode configured to call OpenAI. SetMethodto POST andURLtohttps://api.openai.com/v1/chat/completions. UnderHeadersaddAuthorization: Bearer YOUR_OPENAI_API_KEYandContent-Type: application/json. In theBody(raw JSON) use:{"model":"gpt-4o","messages":[{"role":"user","content":"Write a punchy 3-sentence Instagram caption with 5 relevant hashtags for this product: {{$json.productName}}. The product image is at {{$json.productImage}}."}]}. Store your OpenAI key in the node Notes as a reminder to use n8n credentials. - 5
Post image and caption to Instagram
Add a final
HTTP Requestnode to publish to Instagram. First callhttps://graph.facebook.com/v19.0/YOUR_IG_USER_ID/mediawith POST, passingimage_urlas{{ $json.productImage }}andcaptionas{{ $json.choices[0].message.content }}plus youraccess_token. Then make a second call tohttps://graph.facebook.com/v19.0/YOUR_IG_USER_ID/media_publishwith the returnedcreation_idto actually publish. Store your Instagram Page Access Token in the node Notes. Ensure your Instagram account is a Business or Creator account connected to a Facebook Page.
Frequently asked questions
Do I need a developer account to post to Instagram?
Yes. You need a Facebook Developer account, an approved app with the `instagram_content_publish` permission, and your Instagram account must be a Business or Creator account linked to a Facebook Page. The setup takes about 20 minutes in the Facebook Developer portal.
What if Zendrop does not have a public API for my plan?
On lower Zendrop tiers the API may be unavailable. In that case, replace the Zendrop HTTP Request node with a `Google Sheets` node that reads a spreadsheet where you manually paste product image URLs and names. The rest of the workflow stays identical.
Can I review the AI caption before it posts?
Yes. Insert an `n8n Wait` node or replace the final Instagram node with an email node (such as Gmail) that sends you the caption for approval. Once you are happy with the results after a few runs, swap it back to the live Instagram posting node.