{
  "updatedAt": "2025-12-08T13:51:04.000Z",
  "createdAt": "2025-12-07T15:58:40.946Z",
  "id": "ZD3zNntna6R07naM",
  "name": "Practica 6: Ejercicio 3",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "519da9a5-3277-4835-b62f-58979afc9cb9",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        80
      ],
      "id": "25d55389-c3a3-408d-97fd-5b5cf2792c2e",
      "name": "Webhook"
    },
    {
      "parameters": {
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "task",
          "mode": "list",
          "cachedResultName": "task"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "done": false,
            "title": "={{ $json.body.title }}",
            "description": "={{ $json.body.description }}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "displayName": "description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "done",
              "displayName": "done",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        448,
        -16
      ],
      "id": "fd2ff1ad-06df-4ead-839c-dfa320352581",
      "name": "Insert rows in a table",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "queue": "task_created",
        "sendInputData": false,
        "message": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.rabbitmq",
      "typeVersion": 1.1,
      "position": [
        672,
        -16
      ],
      "id": "c586480e-228d-403e-acca-f42db3130863",
      "name": "RabbitMQ",
      "credentials": {
        "rabbitmq": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "92d203e4-5ca1-491e-bfe2-15b21ca6c6c5",
              "leftValue": "={{ $json.body.title }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        224,
        80
      ],
      "id": "7b176453-7dcb-4a5e-9bc1-4e241f85b3e6",
      "name": "If"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"error\": \"Falta el campo title\", \"status\": \"Bad Request\" } }}",
        "options": {
          "responseCode": 400
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        448,
        176
      ],
      "id": "ac326045-1d2e-40d1-950e-4de576a37f50",
      "name": "Respond to Webhook"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 201
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        880,
        -16
      ],
      "id": "55c49482-1dba-458c-998f-6eb2547daefe",
      "name": "Respond to Webhook1"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert rows in a table": {
      "main": [
        [
          {
            "node": "RabbitMQ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Insert rows in a table",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RabbitMQ": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "e8d80c3b-8a40-407f-ad0e-c1d6e479958b",
  "activeVersionId": null,
  "versionCounter": 4,
  "triggerCount": 0,
  "tags": [],
  "shared": [
    {
      "updatedAt": "2025-12-07T15:58:40.956Z",
      "createdAt": "2025-12-07T15:58:40.956Z",
      "role": "workflow:owner",
      "workflowId": "ZD3zNntna6R07naM",
      "projectId": "jEpZT8mLa3eTbWzT",
      "project": {
        "updatedAt": "2025-11-07T16:30:44.943Z",
        "createdAt": "2025-11-07T16:25:40.556Z",
        "id": "jEpZT8mLa3eTbWzT",
        "name": "Anass El Jabiry <aek676@inlumine.ual.es>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "685a70bc-7fcf-484c-be50-a33cd8a1716e"
      }
    }
  ]
}