{
  "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
          }
        ]
      ]
    }
  }
}