Send post-purchase email sequences with Postgres, Gmail and OpenAI
How it works
This workflow automates customer communication after an order is placed. It detects new orders, sends a confirmation email, waits until delivery is completed, and then follows up with AI-generated product tips. Finally, it sends AI-powered upsell recommendations after a defined delay. The workflow runs on a schedule and requires no manual handling.
Step-by-step
Step 1 — Order detection and confirmation**
Schedule Trigger – Runs at a fixed interval to check for new orders.
Postgres – Execute a SQL query – Fetches recently created orders from the database.
Gmail – Send message – Sends an order confirmation email to the customer.
Step 2 — Delivery status monitoring**
Wait – Pauses the workflow until the expected delivery window.
Postgres – Select rows – Checks the delivery status of the order.
If – Verifies whether the product is marked as delivered.
Wait – Delays one day and repeats the check if delivery is not completed.
Step 3 — Product usage tips (AI)**
OpenAI – Message a model – Generates short and practical usage tips for the product.
Code – Formats the AI output into clean HTML bullet points.
Gmail – Send message – Emails the usage tips to the customer.
Step 4 — Upsell recommendations (AI)**
Wait – Delays for two weeks after tips are sent.
OpenAI – Message a model – Creates complementary product recommendations.
Code – Formats the recommendations for email delivery.
Gmail – Send message – Sends the upsell email to the customer.
Why use this?
Ensures timely and relevant customer communication
Prevents sending tips before the product is delivered
Improves onboarding with AI-generated usage guidance
Increases repeat purchases through smart upsell emails
Fully automated using database, email, and AI integrations
Related Templates
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
⚡ AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Instagram Full Profile Scraper with Apify and Google Sheets
📸 Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Compare Lists and Identify Common Items & Differences Using Custom Keys
This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments