{
  "name": "PostWorker",
  "nodes": [
    {
      "parameters": {
        "queue": "Crud_Post",
        "options": {}
      },
      "type": "n8n-nodes-base.rabbitmqTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "b4da9cf0-477c-4ae8-ac1f-c1dd0ebd0dc3",
      "name": "RabbitMQ Trigger",
      "credentials": {
        "rabbitmq": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const returnItems = [];\n\nfor (const item of $input.all()) {\n  try {\n    const contentString = item.json.content;\n    \n    const parsedData = JSON.parse(contentString);\n    \n    const cleanData = parsedData.validated_data;\n    \n    returnItems.push({\n      json: cleanData\n    });\n\n  } catch (error) {\n    item.json.error_on_parse = error.message;\n    returnItems.push(item);\n  }\n}\n\nreturn returnItems;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        208,
        0
      ],
      "id": "ceb7a7f7-1d90-4629-b2a4-0d0e60ee9f50",
      "name": "json_Extract"
    },
    {
      "parameters": {
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "messages",
          "mode": "list",
          "cachedResultName": "messages"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "body",
              "displayName": "body",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "author",
              "displayName": "author",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            },
            {
              "id": "updated_at",
              "displayName": "updated_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        416,
        0
      ],
      "id": "31c4584a-3bd2-4bb0-9efb-9ba3bd3dbca2",
      "name": "insert_Rows_In_A_Table",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "RabbitMQ Trigger": {
      "main": [
        [
          {
            "node": "json_Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "json_Extract": {
      "main": [
        [
          {
            "node": "insert_Rows_In_A_Table",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0718b801-d69f-4c05-a054-10421d5bc7c1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "Ku0l0YNTDNHmYcIs",
  "tags": []
}