AutomationFlowsEmail & Gmail › Generate Paid Rent Receipt to Google Drive

Generate Paid Rent Receipt to Google Drive

Original n8n title: [geston Locative] Génération Quittance - Statut Payé

[Geston locative] Génération quittance - Statut Payé. Uses googleDocs, httpRequest, googleDrive, notion. Event-driven trigger; 13 nodes.

Event trigger★★★★☆ complexity13 nodesGoogle DocsHTTP RequestGoogle DriveNotionGmail
Email & Gmail Trigger: Event Nodes: 13 Complexity: ★★★★☆ Added:

This workflow follows the Gmail → Google Docs recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "active": false,
  "activeVersion": null,
  "activeVersionId": null,
  "connections": {
    "Pr\u00e9parer donn\u00e9es": {
      "main": [
        [
          {
            "node": "Copy file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remplacer balises": {
      "main": [
        [
          {
            "node": "Exporter PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Exporter PDF": {
      "main": [
        [
          {
            "node": "Uploader Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Uploader Drive": {
      "main": [
        [
          {
            "node": "Update a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "R\u00e9cup\u00e9rer Bail": {
      "main": [
        [
          {
            "node": "Locataire",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Locataire": {
      "main": [
        [
          {
            "node": "Logement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Logement": {
      "main": [
        [
          {
            "node": "Pr\u00e9parer donn\u00e9es",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Copy file": {
      "main": [
        [
          {
            "node": "Remplacer balises",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update a database page": {
      "main": [
        [
          {
            "node": "Create a draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Call '[global]Variables temps'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many database pages": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "R\u00e9cup\u00e9rer Bail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a draft": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call '[global]Variables temps'": {
      "main": [
        [
          {
            "node": "Get many database pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2025-11-26T21:52:01.992Z",
  "id": "pH5So3DQJSoFrjlx",
  "isArchived": false,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "[Geston locative] G\u00e9n\u00e9ration quittance - Statut Pay\u00e9",
  "nodes": [
    {
      "parameters": {
        "jsCode": "// ---------- Dates & Mois ----------\nconst now = new Date();\nconst moisCourant = new Date(now.getFullYear(), now.getMonth(), 1);\nconst dernierJour = new Date(now.getFullYear(), now.getMonth() + 1, 0);\n\nconst mois = [\n  'janvier','f\u00e9vrier','mars','avril','mai','juin',\n  'juillet','ao\u00fbt','septembre','octobre','novembre','d\u00e9cembre'\n];\n\n// Mois actuel (ex: \"Novembre\")\nconst moisActuel = mois[now.getMonth()].charAt(0).toUpperCase() + mois[now.getMonth()].slice(1);\n\n// ---------- Utilitaires ----------\nconst getRichText = (prop) =>\n  prop?.rich_text?.[0]?.plain_text ??\n  prop?.rich_text?.[0]?.text?.content ??\n  '';\n\nconst getTitle = (prop) =>\n  prop?.title?.[0]?.plain_text ??\n  prop?.title?.[0]?.text?.content ??\n  '';\n\nconst formatMontant = (val) => (Number(val) || 0).toFixed(2).replace('.', ',');\n\n// ---------- Entr\u00e9es n8n ----------\nconst bailPage       = $node[\"R\u00e9cup\u00e9rer Bail\"]?.json ?? {};\nconst locatairePage  = $node[\"Locataire\"]?.json ?? {};\n\n// Logement : accepte soit items bruts Notion, soit items .json\nconst items = $input.all();\nconst logementPage = (Array.isArray(items) && items.length > 0)\n  ? (items[0].json ?? items[0])\n  : {};\n\n// ---------- Proprio ----------\nconst nomProprietaire = 'Huguet Camille';\nconst adresseProprietaire = '8 rue Leyla Zana 93000 Bobigny';\n\n// ---------- Dates texte ----------\nconst dateDebut = `1er ${mois[moisCourant.getMonth()]} ${moisCourant.getFullYear()}`;\nconst dateFin = `${dernierJour.getDate()} ${mois[moisCourant.getMonth()]} ${moisCourant.getFullYear()}`;\nconst dateSignature = `${now.getDate()} ${mois[now.getMonth()]} ${now.getFullYear()}`;\n\n// ---------- Montants depuis Notion (nouvelle structure .properties) ----------\nconst p = bailPage?.properties ?? {};\nconst loyerNumber   = p?.[\"Montant du loyer HC\"]?.number;\nconst chargesNumber = p?.[\"Montant des charges\"]?.number;\n\n// Fallback sur anciennes cl\u00e9s si tu en as encore besoin\nconst montantLoyer   = (typeof loyerNumber === 'number' ? loyerNumber : bailPage.property_montant_du_loyer_hc || 0);\nconst montantCharges = (typeof chargesNumber === 'number' ? chargesNumber : bailPage.property_montant_des_charges || 0);\nconst montantTotal   = (Number(montantLoyer) || 0) + (Number(montantCharges) || 0);\n\n// ---------- Liens Notion ----------\nconst lienBail = p?.[\"lien du bail\"]?.rich_text?.[0]?.text?.content || '';\n\n// ---------- Locataire (nouvelle structure .properties) ----------\nconst locProps = locatairePage?.properties ?? {};\nconst nomLocataire = getTitle(locProps?.Name);\nconst adresseLocataire = getRichText(locProps?.Address);\nconst lienStockage = locProps?.[\"Lien de stockage des documents\"]?.url || '';\n\n// ---------- Logement (nouvelle structure fournie) ----------\nconst logProps = logementPage?.properties ?? {};\nconst adresseLogement = getRichText(logProps?.Adresse);\nconst nomLogement = getTitle(logProps?.Name);\n\n// ---------- Sortie ----------\nreturn [\n  {\n    json: {\n      nom_proprietaire: nomProprietaire,\n      adresse_proprietaire: adresseProprietaire,\n\n      nom_logement: nomLogement,\n      adresse_logement: adresseLogement,\n\n      nom_locataire: nomLocataire,\n      adresse_locataire: adresseLocataire,\n\n      montant_total:   formatMontant(montantTotal),\n      montant_loyer:   formatMontant(montantLoyer),\n      montant_charges: formatMontant(montantCharges),\n\n      date_debut: dateDebut,\n      date_fin: dateFin,\n      date_signature: dateSignature,\n\n      lien_stockage: lienStockage,\n      lien_bail: lienBail,\n\n      mois_actuel: moisActuel,\n      // Conserve l'underscore si tu l'utilises en nom de fichier\n      mois_annee: `${mois[moisCourant.getMonth()]}_${moisCourant.getFullYear()}`\n    }\n  }\n];\n"
      },
      "id": "764242f2-dc91-4d8e-9f4b-906b4946ef8a",
      "name": "Pr\u00e9parer donn\u00e9es",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        176
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "operation": "update",
        "documentURL": "={{ $json.id }}",
        "simple": false,
        "actionsUi": {
          "actionFields": [
            {
              "action": "replaceAll",
              "text": "nom_proprietaire",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.nom_proprietaire }}"
            },
            {
              "action": "replaceAll",
              "text": "nom_locataire",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.nom_locataire }}"
            },
            {
              "action": "replaceAll",
              "text": "adresse_locataire",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.adresse_locataire }}"
            },
            {
              "action": "replaceAll",
              "text": "date_debut",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.date_debut }}"
            },
            {
              "action": "replaceAll",
              "text": "date_fin",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.date_fin }}"
            },
            {
              "action": "replaceAll",
              "text": "montant_loyer",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.montant_loyer }}"
            },
            {
              "action": "replaceAll",
              "text": " montant_charges",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.montant_charges }}"
            },
            {
              "action": "replaceAll",
              "text": "date_signature",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.date_signature }}"
            },
            {
              "action": "replaceAll",
              "text": "montant_total",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.montant_total }}"
            },
            {
              "action": "replaceAll",
              "text": "adresse_logement",
              "replaceText": "={{ $('Pr\u00e9parer donn\u00e9es').item.json.adresse_logement }}"
            }
          ]
        }
      },
      "id": "13415919-1102-48fb-9012-eabe2d494682",
      "name": "Remplacer balises",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1328,
        176
      ],
      "typeVersion": 2,
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://www.googleapis.com/drive/v3/files/{{ $('Copy file').item.json.id }}/export?mimeType=application/pdf",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "options": {}
      },
      "id": "28898335-2a3e-4870-8714-0102cf634b34",
      "name": "Exporter PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1552,
        176
      ],
      "typeVersion": 4.2,
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        },
        "googleOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "=Quittance loyer {{ $('Locataire').item.json.properties.Name.title[0].text.content }} {{ $('Pr\u00e9parer donn\u00e9es').item.json.mois_actuel }} 2025",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('Locataire').item.json.properties['Lien de stockage des documents'].url }}",
          "mode": "url"
        },
        "options": {}
      },
      "id": "10e548f5-fe04-4011-9517-57079cd1fba4",
      "name": "Uploader Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1776,
        176
      ],
      "typeVersion": 3,
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "get",
        "pageId": {
          "__rl": true,
          "value": "={{ $json.properties.bail.relation[0].id }}",
          "mode": "id"
        },
        "simple": false
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        48,
        176
      ],
      "id": "cfa0475b-4574-436e-bd0a-59a232191e0e",
      "name": "R\u00e9cup\u00e9rer Bail",
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "get",
        "pageId": {
          "__rl": true,
          "value": "={{ $json.properties.Locataires.relation[0].id }}",
          "mode": "id"
        },
        "simple": false
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        208,
        176
      ],
      "id": "89307f1b-5202-4ebe-9ceb-8e8ce9fa2389",
      "name": "Locataire",
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "get",
        "pageId": {
          "__rl": true,
          "value": "={{ $('R\u00e9cup\u00e9rer Bail').item.json.properties.Logement.relation[0].id }}",
          "mode": "id"
        },
        "simple": false
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        432,
        176
      ],
      "id": "63a0c6df-d0df-4cb4-b310-85098c7d5470",
      "name": "Logement",
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "copy",
        "fileId": {
          "__rl": true,
          "value": "1ZXbJIoVjvae2ghwT10cqdryO9WHaLJYvizVImeLwsEk",
          "mode": "list",
          "cachedResultName": "Mod\u00e8le quittance de loyer ",
          "cachedResultUrl": "https://docs.google.com/document/d/1ZXbJIoVjvae2ghwT10cqdryO9WHaLJYvizVImeLwsEk/edit?usp=drivesdk"
        },
        "name": "=Quittance loyer {{ $('Locataire').item.json.properties.Name.title[0].text.content }} {{ $json.mois_actuel }} 2026",
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1104,
        176
      ],
      "id": "3c80fed6-9b94-43bd-818c-761fa9a5bf9b",
      "name": "Copy file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "draft",
        "subject": "={{ $('Uploader Drive').item.json.name }}",
        "message": "=Bonjour,\n\nSuite au r\u00e8glement du loyer au {{ $('Logement').item.json.properties.Adresse.rich_text[0].text.content }}, je vous prie de trouver la quittance du mois de {{ $('Pr\u00e9parer donn\u00e9es').item.json.mois_actuel }} :  {{ $('Uploader Drive').item.json.webContentLink }}\n\nEn vous souhaitant bonne r\u00e9ception,\n\nCordialement,\n\nCamille HUGUET",
        "options": {
          "sendTo": "={{ $('Locataire').item.json.properties.Email.rich_text[0].text.content }}"
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        2224,
        176
      ],
      "id": "68eccd19-6bee-4de5-b593-0a7466116d13",
      "name": "Create a draft",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "update",
        "pageId": {
          "__rl": true,
          "value": "={{ $('Get many database pages').item.json.id }}",
          "mode": "id"
        },
        "simple": false,
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Lien quittance|url",
              "urlValue": "={{ $json.webViewLink }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        2000,
        176
      ],
      "id": "4115cd13-4ba0-4c2b-bc3d-9bea274ee4c6",
      "name": "Update a database page",
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -464,
        176
      ],
      "id": "eeb59797-bd4a-400b-9f9d-d2dcd1ebc806",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": {
          "__rl": true,
          "value": "29c02d84-a064-807b-8f5f-f10110646245",
          "mode": "list",
          "cachedResultName": "Paiement des loyers",
          "cachedResultUrl": "https://www.notion.so/29c02d84a064807b8f5ff10110646245"
        },
        "returnAll": true,
        "simple": false,
        "filterType": "manual",
        "filters": {
          "conditions": [
            {
              "key": "Mois|date",
              "condition": "on_or_after",
              "date": "={{ $json.lastMonth }}"
            }
          ]
        },
        "options": {
          "sort": {
            "sortValue": [
              {
                "timestamp": true,
                "key": "created_time",
                "direction": "descending"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        -240,
        176
      ],
      "id": "a02f2cd4-3e54-49e5-94a5-84a239b2e70b",
      "name": "Get many database pages",
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        0,
        0
      ],
      "id": "c467949f-a67b-4476-8d0d-5f52d3b41678",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "qoaFlL1Ma6bL7oKB",
          "mode": "list",
          "cachedResultUrl": "/workflow/qoaFlL1Ma6bL7oKB",
          "cachedResultName": "[global]Variables temps"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {}
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        -336,
        -112
      ],
      "id": "1ffb75d5-ae1e-4a34-b9ad-931d22f86e2e",
      "name": "Call '[global]Variables temps'"
    }
  ],
  "origin": "n8n",
  "repo": {
    "owner": "kamiyechung",
    "name": "Sauvegarde-n8n"
  },
  "settings": {
    "executionOrder": "v1"
  },
  "shared": [
    {
      "updatedAt": "2025-11-26T21:52:01.992Z",
      "createdAt": "2025-11-26T21:52:01.992Z",
      "role": "workflow:owner",
      "workflowId": "pH5So3DQJSoFrjlx",
      "projectId": "ou1B4ZLA3LmPCUHk"
    }
  ],
  "staticData": null,
  "tags": [
    {
      "updatedAt": "2025-11-26T21:50:45.750Z",
      "createdAt": "2025-11-26T21:50:45.750Z",
      "id": "bVdv5uZuvSz9pfPC",
      "name": "OK"
    },
    {
      "updatedAt": "2025-11-26T21:50:45.756Z",
      "createdAt": "2025-11-26T21:50:45.756Z",
      "id": "TfKV0Tw6506gk5QE",
      "name": "Gestion locative"
    }
  ],
  "triggerCount": 0,
  "updatedAt": "2026-01-06T13:07:56.189Z",
  "versionId": "02bec0e1-f772-460e-a4b3-8efe60c80aea"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

[Geston locative] Génération quittance - Statut Payé. Uses googleDocs, httpRequest, googleDrive, notion. Event-driven trigger; 13 nodes.

Source: https://github.com/kamiyechung/Sauvegarde-n8n/blob/5d2786762774dc1bcf37b8a6466ea4bc7b349280/8hoocGPnyaRiZGb0.json — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

[Geston locative] Génération quittance - Statut Payé. Uses googleDocs, httpRequest, googleDrive, notion. Event-driven trigger; 14 nodes.

Google Docs, HTTP Request, Google Drive +2
Email & Gmail

Client Form → Draft → Approve → Sign → Deliver, fully automated

Jot Form Trigger, Gmail, Google Drive +4
Email & Gmail

AICARE Email Blast System. Uses googleDrive, httpRequest, googleSheets, gmail. Event-driven trigger; 39 nodes.

Google Drive, HTTP Request, Google Sheets +2
Email & Gmail

Tiktok to video copy (paylaşılacak). Uses httpRequest, googleDrive, googleSheets, gmail. Event-driven trigger; 39 nodes.

HTTP Request, Google Drive, Google Sheets +1
Email & Gmail

Recruiting agency. Uses typeformTrigger, airtable, httpRequest, googleDrive. Event-driven trigger; 36 nodes.

Typeform Trigger, Airtable, HTTP Request +4