n8nflow.net logo

Generate and Auto-Evaluate Facebook Ad Headlines using GPT-4o-mini

by Yaron Beenβ€’Updated: Last update 23 days agoβ€’Source: n8n.io
Loading workflow viewer...

Getting Started

Generate and Auto-Evaluate Facebook Ad Headlines using GPT-4o-mini

Built with n8n + OpenAI

This workflow captures a product description, generates ad headlines, evaluates them with custom criteria, decides whether another draft is needed, and finally sends the best version via Gmail.


⚑ Section 1: Capture the Brief & Build the Prompt

  • πŸ“ FormTrigger_CopywritingBrief β†’ A simple form asks: β€œWhat is your product about?”
  • βš™οΈ Set_PromptForHeadline β†’ Prepares the input by appending the instruction:
    β€œWrite a Facebook ad headline for this product:”

Benefit: Ensures consistent, structured prompts so the AI receives clear context every time.


✍️ Section 2: Draft the Headline

  • πŸ’¬ LLM_HeadlineWriterModel β†’ GPT-4o-mini model provides the intelligence.
  • ✍️ Agent_HeadlineWriter β†’ Generates a first-pass Facebook ad headline.

Benefit: Produces creative copy instantly without waiting on a human writer.


πŸ“‹ Section 3: Define Scoring Criteria

  • πŸ’¬ LLM_EvalCriteriaModel β†’ Calls GPT-4o-mini again.
  • πŸ“‘ Agent_EvalCriteriaBuilder β†’ Suggests 5 scoring parameters (scale 1-10).
    Example: Clarity, Relevance, Hook Strength, Brand Voice, Scroll-Stoppage.

Benefit: Builds an objective, repeatable evaluation rubric automatically.


πŸ” Section 4: Evaluate the Headline

  • πŸ’¬ LLM_HeadlineEvaluatorModel β†’ Supplies reasoning power.

  • πŸ” Agent_HeadlineEvaluator β†’ Applies the 5 criteria to the generated headline and outputs:

    • JSON with scores per parameter
    • An average score
    • A plain-language bottom-line

Benefit: Turns subjective copy quality into measurable numbers.


πŸ”„ Section 5: Decide & Iterate (if needed)

  • πŸ’¬ LLM_BottomLineModel β†’ Interprets the evaluation results.

  • πŸ€” Agent_IterationDecision β†’ Decides:

    • Return NO β†’ headline is acceptable.
    • Return YES + feedback β†’ headline should be rewritten.
  • πŸ”€ If_NeedMoreIterations β†’ Branches:

    • If NO β†’ continue workflow.
    • If YES β†’ (loop wiring possible) headline can be regenerated with feedback.

Benefit: Keeps iterating until the AI headline meets your standards.


πŸ“© Section 6: Deliver the Result

  • πŸ“§ Send a message (Gmail node) β†’ Sends the accepted headline via email.

Benefit: Automates delivery of the polished, AI-approved headline to your inbox or team.


πŸ“Š Workflow Overview

SectionPurposeKey NodesBenefit
⚑ Capture BriefCollect product info & prep promptFormTrigger, SetStructured AI input
✍️ Draft HeadlineGenerate first headlineLLM_HeadlineWriterModel, Agent_HeadlineWriterInstant creative draft
πŸ“‹ Define CriteriaBuild scoring rubricLLM_EvalCriteriaModel, Agent_EvalCriteriaBuilderObjective evaluation
πŸ” Evaluate HeadlineScore headline & summarizeLLM_HeadlineEvaluatorModel, Agent_HeadlineEvaluatorTransparent quality check
πŸ”„ Decide & IterateAccept or refine headlineLLM_BottomLineModel, Agent_IterationDecision, IfOnly good results move forward
πŸ“© Deliver ResultShare the final copyGmailAutomates delivery

βœ… Final Benefits

  • πŸš€ One-click workflow: from product description to tested headline.
  • πŸ“Š Automatic rubric: objective scoring each time.
  • πŸ”„ Self-improving: poor headlines can auto-iterate with feedback.
  • πŸ“§ Direct integration: approved headlines land in Gmail instantly.
  • 🧩 Fully modular: easy to extend with Google Sheets, Slack, or CRM nodes.