{
 "name": "New paying client onboarding: Drive folder, welcome email, Trello card (AutomateRecipes)",
 "nodes": [
  {
   "parameters": {
    "httpMethod": "POST",
    "path": "stripe-paid",
    "responseMode": "onReceived",
    "options": {}
   },
   "id": "992623c5-5f54-44f8-8aff-14551c26e8e6",
   "name": "Stripe webhook",
   "type": "n8n-nodes-base.webhook",
   "typeVersion": 2,
   "position": [
    0,
    0
   ],
   "webhookId": "3d2873ac-dfcc-4138-a895-a87fd551708f"
  },
  {
   "parameters": {},
   "id": "3f5ddfa9-fa15-4e17-b463-a7a660e0a913",
   "name": "Run manually (test)",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    200
   ]
  },
  {
   "parameters": {
    "jsCode": "return [{json:{body:{type:'checkout.session.completed',data:{object:{customer_details:{name:'Lina Haddad',email:'lina@example.com'},amount_total:150000,currency:'sar'}}}}},{json:{body:{type:'customer.updated',data:{object:{}}}}}];"
   },
   "id": "4473e09f-3708-47ba-a628-5c674e190736",
   "name": "Sample Stripe event",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    220,
    200
   ]
  },
  {
   "parameters": {
    "jsCode": "// In Stripe, send checkout.session.completed to this webhook. Add signature checking before production use.\nreturn $input.all().map(i=>i.json.body||i.json).filter(b=>b.type==='checkout.session.completed').map(b=>{const o=b.data.object,c=o.customer_details||{};if(!c.email)throw new Error('No customer email in Stripe event');return {json:{name:c.name||c.email,email:c.email,amount:(o.amount_total/100).toFixed(2)+' '+String(o.currency||'').toUpperCase()}}});"
   },
   "id": "e7c71bc5-39a1-45e9-a9b6-85cad9cd1b84",
   "name": "Only completed payments",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    440,
    100
   ]
  },
  {
   "parameters": {
    "resource": "folder",
    "name": "={{ $json.name }} \u2013 client",
    "driveId": {
     "__rl": true,
     "mode": "list",
     "value": "My Drive"
    },
    "folderId": {
     "__rl": true,
     "mode": "list",
     "value": "root"
    },
    "options": {}
   },
   "id": "883cc033-e40a-48b1-be15-d3631974aae3",
   "name": "Google Drive: client folder",
   "type": "n8n-nodes-base.googleDrive",
   "typeVersion": 3,
   "position": [
    660,
    100
   ]
  },
  {
   "parameters": {
    "sendTo": "={{ $('Only completed payments').item.json.email }}",
    "subject": "=Welcome aboard, {{ $('Only completed payments').item.json.name }}!",
    "emailType": "text",
    "message": "=Hi {{ $('Only completed payments').item.json.name }},\n\nThanks for your payment. Please fill in our short intake form: https://YOUR-INTAKE-FORM-LINK\n\nTalk soon!",
    "options": {}
   },
   "id": "08077af3-1dd9-41c1-83c9-0e52946de9c0",
   "name": "Gmail: welcome email",
   "type": "n8n-nodes-base.gmail",
   "typeVersion": 2.1,
   "position": [
    880,
    100
   ]
  },
  {
   "parameters": {
    "listId": "YOUR_TRELLO_LIST_ID",
    "name": "=Onboard {{ $('Only completed payments').item.json.name }}",
    "description": "=Email: {{ $('Only completed payments').item.json.email }}\nPaid: {{ $('Only completed payments').item.json.amount }}",
    "additionalFields": {}
   },
   "id": "854a6cac-849e-4244-8708-0696f1d7ac00",
   "name": "Trello: onboarding card",
   "type": "n8n-nodes-base.trello",
   "typeVersion": 1,
   "position": [
    1100,
    100
   ]
  }
 ],
 "connections": {
  "Stripe webhook": {
   "main": [
    [
     {
      "node": "Only completed payments",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Run manually (test)": {
   "main": [
    [
     {
      "node": "Sample Stripe event",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Sample Stripe event": {
   "main": [
    [
     {
      "node": "Only completed payments",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Only completed payments": {
   "main": [
    [
     {
      "node": "Google Drive: client folder",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Google Drive: client folder": {
   "main": [
    [
     {
      "node": "Gmail: welcome email",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Gmail: welcome email": {
   "main": [
    [
     {
      "node": "Trello: onboarding card",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "active": false,
 "settings": {
  "executionOrder": "v1"
 },
 "pinData": {}
}