Alchemy RecipeAdvancedautomation

Eye Care Marketing Campaign from Product Specifications

Published

You've just received a spreadsheet full of eye care product specifications: lens materials, UV protection ratings, frame styles, price points. Your marketing team needs a campaign ready by Friday. Manually writing copy for each product variant, detecting which ones suit different customer segments, scheduling posts across social media, then uploading everything to your content calendar sounds like a two-day job.... For more on this, see Social media content calendar from blog posts and news feeds. For more on this, see Fashion brand social media content calendar from mood boards. For more on this, see Product launch social media content suite from press release.

It doesn't have to be. With the right AI tools wired together, you can turn that product data into a fully planned, segmented, and scheduled marketing campaign in under an hour. No copy-pasting between tabs, no manual uploads, no guessing which messaging works for which audience.

This workflow combines product data enrichment, audience segmentation, copywriting, and social scheduling into a single automated pipeline. You'll use AI-Boost to massage your raw product specs into clean, structured data; ChatGPT Writer to generate audience-specific marketing copy; Eye-Type Detector to segment products by the customer personas most likely to buy them; and Postwise to schedule everything to your social channels. An orchestration tool ties it all together so data moves automatically from step to step. Let's walk through how to build it.

The Automated Workflow

Which Orchestration Tool to Use

For this workflow, we recommend n8n. It's free to self-host, has excellent error handling, and supports complex branching logic (you'll need this when segmenting products by detected eye type). Zapier and Make work too, but they charge per task; with n8n, you'll run this workflow dozens of times without additional cost.

Step 1: Trigger and Data Input

Start by uploading your product specs CSV to a Google Sheet or dropbox folder. Set your orchestration tool to watch for new files or sheet updates. Here's how to configure the webhook trigger in n8n:

{
  "trigger": "webhook",
  "method": "POST",
  "path": "/eye-care-campaign",
  "headers": {
    "Content-Type": "application/json"
  }
}

Your CSV should have these minimum columns: Product Name, Lens Material, UV Protection (SPF), Frame Style, Price, Target Age Group, Key Benefits.

When n8n detects an update, it reads the entire sheet and passes each row as a separate object into the next step. This means a 50-product spec sheet becomes 50 parallel processing threads, each moving independently through the workflow.

Step 2: Data Enrichment with AI-Boost

AI-Boost standardises messy product data. Eye care specs often come from multiple suppliers with inconsistent formatting: one lists "SPF 400" while another says "UV400". AI-Boost normalises these fields so downstream tools can work with clean data.

Set up an API call to AI-Boost like this:

{
  "method": "POST",
  "url": "https://api.ai-boost.com/v1/standardise",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "text": "{{ $json.lens_material }}, {{ $json.uv_protection }}, {{ $json.frame_style }}",
    "model": "product-specs-v2",
    "output_format": "structured"
  }
}

AI-Boost returns:

{
  "lens_material_normalized": "polycarbonate",
  "uv_protection_level": "UV400",
  "frame_style_category": "cat-eye",
  "confidence_scores": {
    "material": 0.98,
    "protection": 0.95,
    "style": 0.92
  }
}

Store these cleaned values in intermediate variables within n8n. You'll need them for the next step.

Step 3: Audience Segmentation with Eye-Type Detector

Eye-Type Detector is a specialist model that identifies which eye shapes and vision needs each product suits. It takes your product specs and returns a list of customer personas: "myopic_young_professionals", "presbyopic_over_50s", "astigmatism_athletes", etc.

Call the Eye-Type Detector API like this:

{
  "method": "POST",
  "url": "https://api.eye-type-detector.com/v1/segment",
  "headers": {
    "Authorization": "Bearer YOUR_EYE_TYPE_API_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "lens_material": "{{ $json.lens_material_normalized }}",
    "uv_protection": "{{ $json.uv_protection_level }}",
    "frame_style": "{{ $json.frame_style_category }}",
    "price_point": "{{ $json.price }}",
    "key_benefits": "{{ $json.key_benefits }}"
  }
}

The response looks like this:

{
  "primary_segment": "myopic_young_professionals",
  "secondary_segments": ["active_lifestyle", "fashion_conscious"],
  "segment_confidence": 0.87,
  "messaging_angle": "style_and_clarity",
  "recommended_platforms": ["instagram", "tiktok"],
  "tone": "modern_casual"
}

Store the primary and secondary segments, messaging angle, and recommended platforms. You'll use these to branch your workflow and personalise copy.

Step 4: Conditional Branching Based on Segment

This is where n8n shines. Create three separate branches, one for each major segment: young professionals, active lifestyles, and fashion-conscious buyers. Each branch will feed the same product information into ChatGPT Writer but with different prompts.

Use n8n's "Switch" node to route based on the primary_segment value:

{
  "node": "Switch",
  "rules": [
    {
      "condition": "primary_segment == 'myopic_young_professionals'",
      "output": 1
    },
    {
      "condition": "primary_segment == 'active_lifestyle'",
      "output": 2
    },
    {
      "condition": "primary_segment == 'fashion_conscious'",
      "output": 3
    }
  ]
}

Each output feeds into a separate ChatGPT Writer instance with its own tailored prompt.

Step 5: Copy Generation with ChatGPT Writer

Now you generate segment-specific marketing copy. ChatGPT Writer integrates directly via API, so you don't need manual prompting.

For the young professionals branch:

{
  "method": "POST",
  "url": "https://api.chatgpt-writer.com/v1/generate",
  "headers": {
    "Authorization": "Bearer YOUR_CHATGPT_WRITER_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "product_name": "{{ $json.product_name }}",
    "prompt": "Write a 280-character Instagram caption for young professionals who value clarity and style. Product: {{ $json.product_name }}. Key benefits: {{ $json.key_benefits }}. Lens material: {{ $json.lens_material_normalized }}. Include a relevant emoji. Tone: modern and professional.",
    "max_tokens": 100,
    "temperature": 0.7,
    "model": "[gpt](/tools/gpt)-4"
  }
}

For the active lifestyle branch, change the prompt:

{
  "prompt": "Write a 280-character Instagram caption for athletes and active people. Emphasise durability, UV protection, and performance. Product: {{ $json.product_name }}. Key benefits: {{ $json.key_benefits }}. Highlight that these lenses are impact-resistant. Tone: energetic and sporty."
}

ChatGPT Writer returns:

{
  "generated_copy": "Crystal clarity meets modern style. These {{ $json.lens_material_normalized }} lenses shield your eyes from UV rays while keeping your look sharp. Perfect for long workdays and weekend adventures. 😎 #EyeCare",
  "character_count": 178,
  "estimated_engagement": 0.042
}

Store each generated caption in a list tied to its product and segment.

Step 6: Image and Metadata Attachment

Postwise requires images for each post. If your product specs include image URLs, pass them through now. If not, use a simple image lookup (search your brand asset library by product name via API) or use a generic eye care template image.

In n8n, add a "Set" node that bundles all the data Postwise needs:

{
  "node": "Set",
  "data": {
    "product_name": "{{ $json.product_name }}",
    "caption": "{{ $json.generated_copy }}",
    "image_url": "{{ $json.image_url }}",
    "target_platform": "{{ $json.recommended_platforms[0] }}",
    "hashtags": "#EyeCare #Vision #UVProtection #{{ $json.frame_style_category | titlecase }}",
    "scheduled_time": "{{ now().add(2, 'days').format('YYYY-MM-DD HH:mm:ss') }}",
    "segment": "{{ $json.primary_segment }}"
  }
}

Postwise works best when you schedule posts 2-3 days out, giving you time to review and adjust if needed.

Step 7: Social Scheduling with Postwise

Postwise's API accepts batches of scheduled posts. Send your bundled data here:

{
  "method": "POST",
  "url": "https://api.postwise.com/v1/schedule",
  "headers": {
    "Authorization": "Bearer YOUR_POSTWISE_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "posts": [
      {
        "content": "{{ $json.caption }}",
        "image": "{{ $json.image_url }}",
        "platforms": ["{{ $json.target_platform }}"],
        "scheduled_at": "{{ $json.scheduled_time }}",
        "metadata": {
          "product": "{{ $json.product_name }}",
          "segment": "{{ $json.segment }}",
          "campaign_id": "eye_care_q1_2024"
        }
      }
    ]
  }
}

Postwise returns confirmation with post IDs:

{
  "success": true,
  "scheduled_posts": [
    {
      "post_id": "post_abc123",
      "platform": "instagram",
      "scheduled_for": "2024-01-19 10:00:00",
      "estimated_reach": 4200
    }
  ]
}

At this stage, all products have been written, segmented, and scheduled. Your workflow has completed.

Step 8: Error Handling and Notifications

Wrap each API call in a try-catch block. In n8n, use the "Try-Catch" node:

{
  "node": "Try",
  "actions": [
    {
      "type": "api_call",
      "method": "POST",
      "url": "https://api.postwise.com/v1/schedule"
    }
  ],
  "onError": {
    "notification": "slack",
    "message": "Failed to schedule post for {{ $json.product_name }}. Error: {{ $error.message }}"
  }
}

Send failures to a Slack channel so your team can review and re-run manually if needed.

The Manual Alternative

If you prefer more control over each step, you can use Claude Code to build a custom Python script that calls these APIs sequentially. You'd run the script locally, get output files for review, then decide whether to push to Postwise.

This takes longer (2-3 hours instead of 30 minutes) but gives you full visibility. Download your product specs as CSV, open Claude Code, paste the CSV content, and ask it to build a script that calls AI-Boost, Eye-Type Detector, ChatGPT Writer, and Postwise in sequence.

Claude will generate something like this skeleton:

import requests
import csv
import json

with open('products.csv') as f:
    reader = csv.DictReader(f)
    products = list(reader)

results = []

for product in products:
    # Step 1: Standardise with AI-Boost
    boost_response = requests.post(
        'https://api.ai-boost.com/v1/standardise',
        headers={'Authorization': f'Bearer {BOOST_KEY}'},
        json={'text': f"{product['lens_material']}, {product['uv_protection']}"}
    )
    cleaned = boost_response.json()
    
    # Step 2: Segment with Eye-Type Detector
    segment_response = requests.post(
        'https://api.eye-type-detector.com/v1/segment',
        headers={'Authorization': f'Bearer {DETECTOR_KEY}'},
        json={'lens_material': cleaned['lens_material_normalized']}
    )
    segment = segment_response.json()
    
    # Step 3: Generate copy with ChatGPT Writer
    copy_response = requests.post(
        'https://api.chatgpt-writer.com/v1/generate',
        headers={'Authorization': f'Bearer {WRITER_KEY}'},
        json={'prompt': f"Write marketing copy for {product['product_name']}"}
    )
    copy = copy_response.json()
    
    results.append({
        'product': product['product_name'],
        'segment': segment['primary_segment'],
        'copy': copy['generated_copy']
    })

# Save results for review
with open('output.json', 'w') as f:
    json.dump(results, f, indent=2)

print(f"Generated copy for {len(results)} products. Review output.json before posting.")

You then review the output.json file, make tweaks, and manually send to Postwise, or modify the script to auto-submit.

Pro Tips

1. Rate Limiting and Batch Processing

ChatGPT Writer has a rate limit of 100 requests per minute on the free tier. If you have 200 products, spread the workflow across two runs with a 30-minute gap, or upgrade to a paid tier. In n8n, use the "Rate Limit" node to enforce delays:

{
  "node": "RateLimit",
  "requests_per_minute": 90,
  "concurrent_requests": 3
}

This ensures you never hit API limits even with large product datasets.

2. A/B Testing Different Prompts

Run the workflow with three different ChatGPT Writer prompts for the same product and let Postwise's analytics tell you which copy performs best. Store the performance metrics back into a Google Sheet, then use those insights to refine your segment-specific prompts next time.

3. Reuse Generated Copy Across Channels

The Instagram caption from ChatGPT Writer won't work for LinkedIn or email. Instead of regenerating, create channel-specific prompts within the same workflow. Use the "Set" node to shorten captions for Twitter, expand them for blog snippets, and format them for email.

4. Monitor AI-Boost Confidence Scores

AI-Boost returns confidence scores for each normalised field. If the score is below 0.80, flag that product for manual review. Add a filter node in n8n:

{
  "node": "Filter",
  "condition": "confidence_scores.material >= 0.80"
}

Low-confidence products skip automatic scheduling and get sent to a Slack review thread instead.

5. Cost Optimisation: Cache Product Data

If you run this workflow weekly with overlapping products, cache the AI-Boost and Eye-Type Detector responses. Store results in a PostgreSQL database and check it before making API calls. This cuts your API costs by 40-50% on repeat products.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
AI-BoostPro (100K calls/month)£49One call per product spec field
ChatGPT WriterPro (10M tokens/month)£20Approx. 500 tokens per caption
Eye-Type DetectorStarter (1000 segments/month)£29One call per product
PostwiseCreator (unlimited posts)£99Includes scheduling, analytics, 3 platforms
n8nSelf-hosted (free)£0Host on your own server or £19/month cloud
Total£197Scales linearly; add £15-20 per 1000 products

For a 50-product campaign, you're spending roughly £4 per product on tooling. If your team would manually handle this in 16 hours at £25/hour, you're saving £396 in labour while getting the work done in 30 minutes. After your second campaign, the ROI becomes obvious.

More Recipes