AutomationFlowsAI & RAG › Generate & Email Personalized Jokes with Gpt-4o-mini and Gmail

Generate & Email Personalized Jokes with Gpt-4o-mini and Gmail

ByOriol Seguí @oxsr11 on n8n.io

This fun workflow automates the generation and delivery of personalized jokes by email based on the names or objects entered in the form. The process works as follows:

Event trigger★★★☆☆ complexityAI-powered8 nodesForm TriggerOpenAIGmail
AI & RAG Trigger: Event Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #5525 — we link there as the canonical source.

This workflow follows the Form Trigger → Gmail 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "8803d5e4-bab6-43bc-95f1-8f15b8919ce2",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -40,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "Chistes generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Nombre 1",
              "placeholder": "Juan"
            },
            {
              "fieldLabel": "Nombre 2",
              "placeholder": "laptop"
            },
            {
              "fieldLabel": "Nombre 3",
              "placeholder": "Maria"
            }
          ]
        },
        "formDescription": "Generador de chistes, introduce tres nombres o objetos que quieras que aparezcan en su chiste y a continuaci\u00f3n se generar\u00e1 un chiste en base a ellos."
      },
      "typeVersion": 2.2
    },
    {
      "id": "265d6261-94ad-4b5b-8d23-aa21acd2a691",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        480,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Tu tarea es generar un chiste que contenga estas palabras:\n{{ $('On form submission').item.json['Nombre 1'] }}\n{{ $('On form submission').item.json['Nombre 2'] }}\ny {{ $('On form submission').item.json['Nombre 3'] }}\n\nHaz el chiste ne este idioma:  {{ $json.language }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "25520990-e524-4a50-a580-3baa66a00743",
      "name": "LANG",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "02b8c348-8a91-4483-a892-9295fb47e94c",
              "name": "language",
              "type": "string",
              "value": "spanish / espa\u00f1ol"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ec32b07e-c564-4fad-89b4-4f6c404ce431",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 300,
        "content": "### Set the output language\n"
      },
      "typeVersion": 1
    },
    {
      "id": "923419eb-d92a-4427-baa3-f0cc81e2d8b6",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        900,
        0
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.message.content }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "Joke generator"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f0669408-d067-48be-b7e4-0628ea36cf1a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 260,
        "height": 100,
        "content": "### Prompt message (approx. using 200 tokens)"
      },
      "typeVersion": 1
    },
    {
      "id": "e08b2c13-b945-425c-b77a-d44a5749b6d8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 300,
        "content": "### Configure email send"
      },
      "typeVersion": 1
    },
    {
      "id": "e52cbc9f-a7dd-496a-a3d9-8793e33f28c5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 300,
        "content": "Modify the fields as you wish, add more if necessary to make the joke more creative.\n\n\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "LANG": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "LANG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

This fun workflow automates the generation and delivery of personalized jokes by email based on the names or objects entered in the form. The process works as follows:

Source: https://n8n.io/workflows/5525/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

This template is designed for content creators, podcasters, businesses, and researchers who need to transcribe long audio recordings that exceed OpenAI Whisper's 25 MB file size limit (~20 minutes of

Form Trigger, HTTP Request, OpenAI +1
AI & RAG

An n8n-based automation that generates client proposals from a form, lets you review everything in one place, and sends the proposal only when you approve it.

Form Trigger, Google Sheets Trigger, OpenAI +4
AI & RAG

Automatically gather hundreds of real customer reviews from five major platforms in one run using Thordata API and Proxy — Trustpilot, Capterra, Chrome Web Store, TrustRadius, and Product Hunt — then

HTTP Request, OpenAI, Form Trigger +1
AI & RAG

This workflow enables seamless speech-to-text transcription, AI-powered summarization, sentiment analysis, and automated email delivery. It supports two different input modes: Form Upload (Local File)

HTTP Request, OpenAI, Gmail +2
AI & RAG

This workflow automates weather forecast delivery by collecting city names, fetching 5-day forecasts from OpenWeatherMap, and generating professionally formatted HTML emails using GPT-4. The AI create

Gmail, OpenWeatherMap, HTTP Request +2