Skip to main content

Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini

Workflow preview

Workflow preview
100%
Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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,...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.formtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.if, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Yaron Been.

Original n8n.io source

1.1 Workflow description

Title
Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini
Workflow name
Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini

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

Section Purpose Key Nodes Benefit
⚑ Capture Brief Collect product info & prep prompt FormTrigger, Set Structured AI input
✍️ Draft Headline Generate first headline LLM_HeadlineWriterModel, Agent_HeadlineWriter Instant creative draft
πŸ“‹ Define Criteria Build scoring rubric LLM_EvalCriteriaModel, Agent_EvalCriteriaBuilder Objective evaluation
πŸ” Evaluate Headline Score headline & summarize LLM_HeadlineEvaluatorModel, Agent_HeadlineEvaluator Transparent quality check
πŸ”„ Decide & Iterate Accept or refine headline LLM_BottomLineModel, Agent_IterationDecision, If Only good results move forward
πŸ“© Deliver Result Share the final copy Gmail Automates 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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send a message

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 2 - FormTrigger_CopywritingBrief

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 3 - Set_PromptForHeadline

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - LLM_HeadlineWriterModel

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - Agent_HeadlineWriter

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 6 - LLM_EvalCriteriaModel

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - LLM_HeadlineEvaluatorModel

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 8 - LLM_BottomLineModel

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - Agent_IterationDecision

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 10 - If_NeedMoreIterations

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - Agent_HeadlineEvaluator

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 12 - Agent_EvalCriteriaBuilder

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 13 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini
Complexity intermediate
Nodes 14
Categories Content Creation, Multimodal AI
Author Yaron Been
Published 17 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6081/6081.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini do?

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,...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.