Send post-purchase email sequences with Postgres, Gmail and OpenAI
Ready for 3.0What this workflow does
This AI workflow has 14 nodes and runs on a schedule (every 2 minutes). Along the way it connects Gmail, Postgres and OpenAI.
How it runs
Trigger: On a schedule (every 2 minutes).
- Execute a SQL query (Postgres): run a query
- Order Placed Ack. (Gmail): uses Gmail
- Wait: waits 7 days
- Select rows from a table (Postgres): select
- If: checks a condition and branches into true / false
- Message a model (OpenAI): uses OpenAI
- Wait: waits 1 days
- Format AI response (Code): runs custom JavaScript code
- Send Tips to User (Gmail): uses Gmail
- Wait: waits 14 days
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Wait
n8n-nodes-base.wait - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - OpenAI
@n8n/n8n-nodes-langchain.openAi
From the author
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…