AutomationFlowsEmail & Gmail › W5: Execution

W5: Execution

W5: Execution. Uses gmail, postgres. Manual trigger; 2 nodes.

Manual trigger★☆☆☆☆ complexity2 nodesGmailPostgres
Email & Gmail Trigger: Manual Nodes: 2 Complexity: ★☆☆☆☆ Added:

This workflow follows the Gmail → Postgres 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
{
  "name": "W5: Execution",
  "nodes": [
    {
      "parameters": {
        "operation": "createDraft",
        "messageId": "={{ $node[\"Fetch Case Details\"].json.source_provider_id }}",
        "threadId": "={{ $node[\"Fetch Case Details\"].json.thread_id }}",
        "emailType": "reply",
        "text": "Hello, \n\nI have found the requested receipt for {{ $node[\"Fetch Case Details\"].json.period }}. Please find it attached.\n\nBest regards,\nAssistant",
        "attachments": "={{ $node[\"Fetch Candidate Attachment\"].json.attachment_id }}"
      },
      "id": "w5-gmail-draft",
      "name": "Create Gmail Draft",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "UPDATE bookkeeping_cases SET status = 'done' WHERE id = $1;",
        "queryParams": "={{ $json.case_id }}"
      },
      "id": "w5-db-update",
      "name": "Mark Done",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 1,
      "position": [
        600,
        300
      ]
    }
  ],
  "connections": {
    "Create Gmail Draft": {
      "main": [
        [
          {
            "node": "Mark Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

W5: Execution. Uses gmail, postgres. Manual trigger; 2 nodes.

Source: https://github.com/perttu/workforce/blob/63589768519d1828d7fae6a1d31563f24eeb4afb/workflows/w5_execution.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

This is a high-security enterprise solution for LegalOps and Compliance departments. It automates the high-stakes process of decrypting batches of legacy, password-protected PDF assets to facilitate f

Postgres, Slack, Google Drive +2
Email & Gmail

AEJaCA — Newsletter Signup (10% discount). Uses postgres, gmail. Webhook trigger; 6 nodes.

Postgres, Gmail
Email & Gmail

Gmail Googledrive. Uses gmail, googleDrive. Manual trigger; 3 nodes.

Gmail, Google Drive
Email & Gmail

Ts Order Ingest. Uses httpRequest, itemLists, stopAndError, airtable. Manual trigger; 52 nodes.

HTTP Request, Item Lists, Stop And Error +4
Email & Gmail

Suspicious_login_detection. Uses postgres, httpRequest, noOp, html. Webhook trigger; 43 nodes.

Postgres, HTTP Request, Gmail +1