Marketing · n8n

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.

difficulty Intermediatesetup 45 minresult A ready-to-publish Instagram post with an AI-written caption is created automatically whenever a new Zendrop product is ready to promote.
  1. 1

    Trigger: Manually start or schedule the workflow

    Add a Schedule Trigger node (or use Manual Trigger for 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. 2

    Fetch product data from Zendrop via HTTP Request

    Add an HTTP Request node. Set Method to GET and URL to the Zendrop API endpoint for your product catalogue, e.g. https://api.zendrop.com/v1/products. Under Headers add Authorization: Bearer YOUR_ZENDROP_API_KEY. In the node Notes field store your API key hint. The response will include image_url and title fields for each product. Limit results to 1 product per run using the query parameter ?limit=1.

  3. 3

    Extract image URL and product name with Set node

    Add a Set node to pull clean values from the HTTP response. Create two fields: set productImage to {{ $json.data[0].image_url }} and productName to {{ $json.data[0].title }}. This keeps downstream nodes simple and avoids deeply nested expressions.

  4. 4

    Generate Instagram caption with OpenAI

    Add an HTTP Request node configured to call OpenAI. Set Method to POST and URL to https://api.openai.com/v1/chat/completions. Under Headers add Authorization: Bearer YOUR_OPENAI_API_KEY and Content-Type: application/json. In the Body (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. 5

    Post image and caption to Instagram

    Add a final HTTP Request node to publish to Instagram. First call https://graph.facebook.com/v19.0/YOUR_IG_USER_ID/media with POST, passing image_url as {{ $json.productImage }} and caption as {{ $json.choices[0].message.content }} plus your access_token. Then make a second call to https://graph.facebook.com/v19.0/YOUR_IG_USER_ID/media_publish with the returned creation_id to 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.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.