# Facebook ads generator with Gemini and OpenAI: n8n workflow

> Started by another system calling it, and works across Airtable. It hands the judgement calls to Gemini and OpenAI.

Source: https://millionrounds.com/workflow/facebook-ads-generator-with-gemini-and-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Facebook ads generator with Gemini and OpenAI

Started by another system calling it, and works across Airtable. It hands the judgement calls to Gemini and OpenAI. 51 steps, 6 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ffacebook-ads-generator-with-gemini-and-openai)

**51 steps** Large: read it before trusting it with anything live

**6** Branches: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 3 Model 10 Logic 18 Service 20

The steps in the order they run, from what starts it.

- 1 **Webhook** Webhook *Starts it*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **Schedule Trigger2** Schedule trigger *Starts it*
- 4 **Webhook1** Webhook *Starts it*
- 5 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 6 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 7 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 8 **Google Gemini Chat Model2** Lm Chat Google Gemini *Model*
- 9 **Switch** Switch *Logic*
- 10 **Parsing** Chain Llm *Model*
- 11 **Get FB Ad Accounts** Facebook Graph Api *Service*
- 12 **Airtable10** Airtable *Service*
- 13 **Generate Angles** Chain Llm *Model*
- 14 **Basic LLM Chain1** Chain Llm *Model*
- 15 **Basic LLM Chain2** Chain Llm *Model*
- 16 **Get Product** Airtable *Service*
- 17 **Get Product1** Airtable *Service*
- 18 **Get Script** Airtable *Service*
- 19 **Get Script1** Airtable *Service*
- 20 **Edit Fields** Set *Logic*
- 21 **Split Out6** Split Out *Logic*
- 22 **Facebook Graph API10** Facebook Graph Api *Service*
- 23 **Update Script** Airtable *Service*
- 24 **Update Script1** Airtable *Service*
- 25 **Edit Fields2** Set *Logic*
- 26 **Split Out** Split Out *Logic*
- 27 **Get Ad Campaigns** Facebook Graph Api *Service*
- 28 **Edit Fields5** Set *Logic*
- 29 **Product Overview & Customer Research** Http Request *Service*
- 30 **Create Angles** Airtable *Service*
- 31 **Split Out7** Split Out *Logic*
- 32 **HTTP Request1** Http Request *Service*
- 33 **Update Product Details** Airtable *Service*
- 34 **Update Product** Airtable *Service*
- 35 **If9** If *Logic*
- 36 **Edit Fields7** Set *Logic*
- 37 **Get FB Ad Sets** Facebook Graph Api *Service*
- 38 **Code1** Code *Logic*
- 39 **Split Out8** Split Out *Logic*
- 40 **If7** If *Logic*
- 41 **If10** If *Logic*
- 42 **HTTP Request** Http Request *Service*
- 43 **Wait** Wait *Logic*
- 44 **OpenAI** Open Ai *Model*
- 45 **Get FB Ad Contents** Facebook Graph Api *Service*
- 46 **Airtable11** Airtable *Service*
- 47 **Split Out9** Split Out *Logic*
- 48 **If11** If *Logic*
- 49 **If6** If *Logic*
- 50 **Edit Fields6** Set *Logic*
- 51 **Airtable9** Airtable *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 51, with 6 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Airtable
- **Model:** Gemini, OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Airtable account, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls Gemini and OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 51 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 51 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ffacebook-ads-generator-with-gemini-and-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Airtable](https://millionrounds.com/workflows?service=Airtable#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Scrape query from Serper API than add Airtable and ZEP** 43 steps · calls a model · Airtable](https://millionrounds.com/workflow/scrape-query-from-serper-api-than-add-airtable-and-zep)
- [**AI data extraction with Airtable** 36 steps · calls a model · Airtable](https://millionrounds.com/workflow/ai-data-extraction-with-airtable)
- [**Daily agenda reminder in Airtable - WhatsApp - Evolution** 33 steps · calls a model · Airtable](https://millionrounds.com/workflow/aviso-de-agenda-diaria-en-airtable-whatsapp-evolution)
- [**Extract information from a logo sheet with Airtable** 33 steps · calls a model · Airtable](https://millionrounds.com/workflow/extract-information-from-a-logo-sheet-with-airtable)
- [**Fetch hierarchical data records from Airtable** 32 steps · Airtable](https://millionrounds.com/workflow/fetch-hierarchical-data-records-from-airtable)
- [**AI agent to chat with Airtable** 30 steps · calls a model · Airtable](https://millionrounds.com/workflow/ai-agent-to-chat-with-airtable)
