# Automated template delivery system with Stripe and Gmail: n8n workflow

> Started by a clock, and works across Gmail, Google Sheets and Stripe. It hands the judgement calls to Azure OpenAI.

Source: https://millionrounds.com/workflow/automated-template-delivery-system-with-stripe-and-gmail (Millionrounds; every figure on the page links to its filing or article)

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

# Automated template delivery system with Stripe and Gmail

Started by a clock, and works across Gmail, Google Sheets and Stripe. It hands the judgement calls to Azure OpenAI. 25 steps, 4 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Azure OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomated-template-delivery-system-with-stripe-and-gmail)

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

**4** Branches: places the flow splits

**1** Loop or waits

**3** Services it connects to

## The flow

Starts it 1 Model 6 Logic 11 Service 7

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

- 1 **Azure OpenAI Chat Model** Lm Chat Azure Open Ai *Model*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **Azure OpenAI Chat Model1** Lm Chat Azure Open Ai *Model*
- 4 **Structured Output Parser1** Output Parser Structured *Model*
- 5 **Get row(s) in sheet in Google Sheets** Google Sheets Tool *Service*
- 6 **Schedule Trigger Daily** Schedule trigger *Starts it*
- 7 **AI Agent – Email Composer** Agent *Model*
- 8 **AI Agent → Google Sheets Lookup** Agent *Model*
- 9 **Stripe Data Collection** Stripe *Service*
- 10 **Send a message (Gmail)** Gmail *Service*
- 11 **Check Match Found** If *Logic*
- 12 **Filter – Successful Charges** Filter *Logic*
- 13 **Append or update row in sheet For Tracking** Google Sheets *Service*
- 14 **Combine Stripe + Sheet Data** Merge *Logic*
- 15 **Get Payment Intent (From Charge)** Http Request *Service*
- 16 **Merge Charge + PaymentIntent + Product** Merge *Logic*
- 17 **Loop Over Items of New Purchases** Split In Batches *Logic*
- 18 **Customer matching** Code *Logic*
- 19 **Get row(s) in sheet – Purchase Sheet Lookup** Google Sheets *Service*
- 20 **If1** If *Logic*
- 21 **Merge Logic Format Data** Code *Logic*
- 22 **SQL Combine** Merge *Logic*
- 23 **Get Product Details (from Payment Intent)** Http Request *Service*
- 24 **Check Required Fields** If *Logic*
- 25 **Check Automation Exists** If *Logic*

## How it's built

- **Starts on:** A clock
- **Steps:** 25, with 4 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets, Stripe
- **Model:** Azure OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets and Stripe accounts, and a key for Azure OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

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

How long does it take to set up?

Take your time. At 25 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 25 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%2Fautomated-template-delivery-system-with-stripe-and-gmail)
- **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.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Stripe](https://millionrounds.com/workflows?service=Stripe#library)

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**Create AI proposals from Fireflies transcripts with OpenAI** 25 steps · calls a model · Gmail, Google Docs](https://millionrounds.com/workflow/create-ai-proposals-from-fireflies-transcripts-with-openai)
- [**Create cinematic quote videos with Gemini** 25 steps · calls a model · Google Cloud Storage, Google Sheets](https://millionrounds.com/workflow/create-cinematic-quote-videos-with-gemini)
- [**Extract Amazon invoice data with Airtop and OpenAI** 25 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/extract-amazon-invoice-data-with-airtop-and-openai)
- [**Track receipt expenses from Telegram with Gemini** 25 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/track-receipt-expenses-from-telegram-with-gemini)
- [**Generate and track invoices with HubSpot and Gmail** 25 steps · Gmail, Google Sheets](https://millionrounds.com/workflow/generate-and-track-invoices-with-hubspot-and-gmail)
- [**Generate service quotes with OpenAI and Telegram** 26 steps · calls a model · Gmail, Telegram](https://millionrounds.com/workflow/generate-service-quotes-with-openai-and-telegram)
