{
  "name": "Practica8 - Trabajo Guiado",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -832,
        144
      ],
      "id": "1894061a-f939-4333-af6b-544dc0b1dd68",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "url": "https://v2.jokeapi.dev/joke/Programming,Misc,Dark?type=single&amount=10",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -624,
        144
      ],
      "id": "a074e143-0cca-495e-8b74-30612c521b4d",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "fieldToSplitOut": "jokes",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -416,
        144
      ],
      "id": "cda85469-71ab-46c1-b966-2f6f29aeca76",
      "name": "Split Out"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.category }}",
                    "rightValue": "Programming",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "0a15a84e-08f3-49f1-87eb-9984f9b18557"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "9b1782d6-1051-43fa-9027-565961b82ba4",
                    "leftValue": "={{ $json.category }}",
                    "rightValue": "Misc",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "32c62644-0a6d-452a-ae5c-b37c8525265b",
                    "leftValue": "={{ $json.category }}",
                    "rightValue": "Dark",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        -224,
        128
      ],
      "id": "e84f2bd9-493f-4b1c-b3cd-b8871ca64ea2",
      "name": "Switch"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $env.SHEET_ID_CHISTES }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $env.SHEET_NAME_PROG }}"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ID": "={{ $json.id }}",
            "Chiste": "={{ $json.joke }}",
            "Fecha de Procesamiento": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Chiste",
              "displayName": "Chiste",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Fecha de Procesamiento",
              "displayName": "Fecha de Procesamiento",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        0,
        0
      ],
      "id": "13c6566a-b43c-4163-8586-2d8082a11066",
      "name": "Programming",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "numberInputs": 3
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        208,
        128
      ],
      "id": "e3f0da20-9d13-456e-957a-11b054942588",
      "name": "Merge"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $env.SHEET_ID_CHISTES }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $env.SHEET_NAME_MISC }}"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ID": "={{ $json.id }}",
            "Chiste": "={{ $json.joke }}",
            "Fecha de Procesamiento": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Chiste",
              "displayName": "Chiste",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Fecha de Procesamiento",
              "displayName": "Fecha de Procesamiento",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        0,
        144
      ],
      "id": "31f81d57-f798-40fc-aaa4-59a720dddd4a",
      "name": "Misc",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "={{ $env.SHEET_ID_CHISTES }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $env.SHEET_NAME_DARK }}"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ID": "={{ $json.id }}",
            "Chiste": "={{ $json.joke }}",
            "Fecha de Procesamiento": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Chiste",
              "displayName": "Chiste",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Fecha de Procesamiento",
              "displayName": "Fecha de Procesamiento",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        0,
        288
      ],
      "id": "f6681aac-f8f5-4061-8d8f-74abc7a81c21",
      "name": "Dark",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Programming",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Misc",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Dark",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Programming": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Misc": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Dark": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cb121b81-7f41-4654-a788-652de6bfaa3d",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "A0IncCmoyrPvJiG9",
  "tags": []
}