AutomationFlowsAI & RAG › Agente RAG

Agente RAG

Agente_RAG. Uses supabase, embeddingsOpenAi, documentDefaultDataLoader, textSplitterCharacterTextSplitter. Chat trigger; 50 nodes.

Chat trigger trigger★★★★★ complexityAI-powered50 nodesSupabaseOpenAI EmbeddingsDocument Default Data LoaderText Splitter Character Text SplitterShopifyChat TriggerAgentOpenAI Chat
AI & RAG Trigger: Chat trigger Nodes: 50 Complexity: ★★★★★ AI nodes: yes Added:

This workflow follows the Agent → Chat Trigger 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
{
  "active": false,
  "activeVersion": null,
  "activeVersionId": null,
  "connections": {
    "Supabase2": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "Monta Informa\u00e7\u00f5es",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace Me2": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Insere Dado Vecto Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader2": {
      "ai_document": [
        [
          {
            "node": "Insere Dado Vecto Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter2": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader2",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Shopify": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Supabase3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Replace Me3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Replace Me3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Supabase4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase3": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [],
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace Me3": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase4": {
      "main": [
        [
          {
            "node": "Replace Me3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI3": {
      "ai_embedding": [
        [
          {
            "node": "Atualiza Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI4": {
      "ai_embedding": [
        [
          {
            "node": "consulta_produtos",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "consulta_produtos": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Monta FAQ": {
      "main": [
        [
          {
            "node": "Monta_Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monta Informa\u00e7\u00f5es": {
      "main": [
        [
          {
            "node": "Monta FAQ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monta_Info": {
      "main": [
        [
          {
            "node": "busca_produto_base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "busca_produto_base": {
      "main": [
        [
          {
            "node": "verifica se j\u00e1 existe produto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "verifica se j\u00e1 existe produto": {
      "main": [
        [
          {
            "node": "pega_qea",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "pega_qea_atualiza_prod",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "pega_qea": {
      "main": [
        [
          {
            "node": "Insere Dado Vecto Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insere Dado Vecto Store": {
      "main": [
        [
          {
            "node": "Supabase6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "pega_qea_atualiza_prod": {
      "main": [
        [
          {
            "node": "Atualiza Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Atualiza Vector Store": {
      "main": [
        [
          {
            "node": "Replace Me2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase5": {
      "main": [
        [
          {
            "node": "Replace Me2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase6": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Supabase5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "consulta_preco_url": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Shopify1": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase7": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase": {
      "main": [
        [
          {
            "node": "Supabase1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Roda todo dia 01:00": {
      "main": [
        [
          {
            "node": "Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Roda 1x semana 02:00": {
      "main": [
        [
          {
            "node": "Supabase2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Roda 1x semana 00:00": {
      "main": [
        [
          {
            "node": "Shopify1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Supabase7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "info_empresa",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "info_empresa": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2025-07-08T18:58:17.498Z",
  "id": "211Lk8Gn9ArkFxFK",
  "isArchived": false,
  "meta": null,
  "name": "Agente_RAG",
  "nodes": [
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "produtos_pincbar",
        "returnAll": true
      },
      "id": "18306faa-efd2-4df2-87f4-598d102f1f6e",
      "name": "Supabase2",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        400,
        700
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "0761948c-2003-41a8-bce1-27f7feb47121",
      "name": "Loop Over Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        620,
        700
      ]
    },
    {
      "parameters": {},
      "id": "26004a51-3511-4f87-afe2-480d41b948d4",
      "name": "Replace Me2",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        2820,
        1660
      ]
    },
    {
      "parameters": {
        "model": "text-embedding-3-small",
        "options": {}
      },
      "id": "f3f145d8-104a-409f-bf63-5faa1867a553",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [
        1580,
        1220
      ]
    },
    {
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "=id_produto",
                "value": "={{ $('Monta_Info').item.json.id }}"
              },
              {
                "name": "=titulo_produto",
                "value": "={{ $('Monta_Info').item.json.titulo_produto }}"
              },
              {
                "name": "status_produto",
                "value": "={{ $('Monta_Info').item.json.status_produto }}"
              }
            ]
          }
        }
      },
      "id": "061bcac7-dcb9-4edb-a85e-0a101b56eb68",
      "name": "Default Data Loader2",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        1820,
        1200
      ]
    },
    {
      "parameters": {
        "chunkSize": 8000
      },
      "id": "10e3a274-aa65-4914-b438-fc246a69e9cb",
      "name": "Character Text Splitter2",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        1780,
        1340
      ]
    },
    {
      "parameters": {
        "content": "# MONTA FAQ\n",
        "height": 1382,
        "width": 3058
      },
      "id": "33bbbdef-210f-422f-b668-010a2d2a730e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        580
      ]
    },
    {
      "parameters": {
        "authentication": "accessToken",
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "additionalFields": {}
      },
      "id": "34cb235f-7301-4a52-b1a6-2f026da0a235",
      "name": "Shopify",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        380,
        120
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "34a2d18f-889c-4a25-b177-313a72fde586",
              "leftValue": "={{ $json.status }}",
              "rightValue": "active",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "be136998-43f2-4c1d-8490-6d7a783abc45",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        620,
        120
      ]
    },
    {
      "parameters": {
        "jsCode": "// Fun\u00e7\u00e3o para remover tags HTML\nfunction removeHtmlTags(input) {\n    if (!input || typeof input !== 'string') {\n        return input;\n    }\n\n    // Remove todas as tags HTML\n    let cleanedText = input.replace(/<[^>]*>/g, '');\n\n    // Remove espa\u00e7os extras e novas linhas duplicadas\n    cleanedText = cleanedText.replace(/\\s+/g, ' ').trim();\n\n    return cleanedText;\n}\n\n// Obter o texto do campo body_html\nconst htmlInput = $json[\"body_html\"]; // Substitua pelo caminho correto se necess\u00e1rio\nif (!htmlInput) {\n    throw new Error(\"O campo body_html n\u00e3o foi encontrado.\");\n}\n\n// Processar o texto\nconst cleanedText = removeHtmlTags(htmlInput);\n\n// Retornar o resultado como objeto compat\u00edvel com o n8n\nreturn {\n    cleaned_body: cleanedText // O texto limpo ser\u00e1 retornado no campo \"cleaned_body\"\n};"
      },
      "id": "9aef0445-651d-4880-96f1-5863631a2dc8",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1700,
        40
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "b70e9668-227e-48a1-9597-8e44d44d4cf1",
              "leftValue": "={{ $json.body_html }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              }
            },
            {
              "id": "017efd28-3d82-4db6-a8f8-87d08039a745",
              "leftValue": "={{ $json.body_html }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1320,
        120
      ],
      "id": "d3adc397-18c7-4ead-8d2d-7ab1c90ae71f",
      "name": "If1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "292ac560-1532-4e18-ad30-9ab750d78ee2",
              "leftValue": "={{ $json }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        2180,
        40
      ],
      "id": "f32c220d-c637-4c7c-9476-fccc14a78687",
      "name": "If2"
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "produtos_pincbar",
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "condition": "eq",
              "keyValue": "={{ $('Shopify').item.json.id }}"
            }
          ]
        },
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "id",
              "fieldValue": "={{ $node['Loop Over Items3'].json.id }}"
            },
            {
              "fieldId": "titulo_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.title }}"
            },
            {
              "fieldId": "descricao_produto",
              "fieldValue": "={{ $json.cleaned_body }}"
            },
            {
              "fieldId": "data_criacao",
              "fieldValue": "={{ $node['Loop Over Items3'].json.created_at }}"
            },
            {
              "fieldId": "url_do_produto",
              "fieldValue": "=https://pincbar.com.br/products/{{ $node['Loop Over Items3'].json.handle }}"
            },
            {
              "fieldId": "status_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.status }}"
            },
            {
              "fieldId": "data_ultima_atualizacao",
              "fieldValue": "={{ $node['Loop Over Items3'].json.updated_at }}"
            },
            {
              "fieldId": "preco_produto",
              "fieldValue": "=R$ {{ $node['Loop Over Items3'].json.variants[0].price.replaceAll('.',',') }}"
            },
            {
              "fieldId": "url_imagem_01",
              "fieldValue": "="
            },
            {
              "fieldId": "tipo_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.product_type }}"
            },
            {
              "fieldId": "estoque_atual",
              "fieldValue": "={{ $node['Loop Over Items3'].json.variants[0].inventory_quantity }}"
            }
          ]
        }
      },
      "id": "24227bbb-fbe8-47f4-a621-a6479e6b88d5",
      "name": "Supabase3",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1940,
        40
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "ff5ddaab-7007-4d5d-b545-a6093f3bbf36",
      "name": "Loop Over Items3",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1040,
        100
      ]
    },
    {
      "parameters": {},
      "id": "09139fa1-c37f-4100-9cbe-244c16afe0ca",
      "name": "Replace Me3",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        2600,
        280
      ]
    },
    {
      "parameters": {
        "content": "# ATUALIZA BASE DE PRODUTOS",
        "height": 510,
        "width": 3047,
        "color": 4
      },
      "id": "69c46b6e-ff86-41f0-97ef-56245fd54dc2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "tableId": "produtos_pincbar",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "id",
              "fieldValue": "={{ $node['Loop Over Items3'].json.id }}"
            },
            {
              "fieldId": "titulo_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.title }}"
            },
            {
              "fieldId": "descricao_produto",
              "fieldValue": "={{ $('Code').item.json.cleaned_body }}"
            },
            {
              "fieldId": "data_criacao",
              "fieldValue": "={{ $node['Loop Over Items3'].json.created_at }}"
            },
            {
              "fieldId": "url_do_produto",
              "fieldValue": "=https://pincbar.com.br/products/{{ $node['Loop Over Items3'].json.handle }}"
            },
            {
              "fieldId": "status_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.status }}"
            },
            {
              "fieldId": "data_ultima_atualizacao",
              "fieldValue": "={{ $node['Loop Over Items3'].json.updated_at }}"
            },
            {
              "fieldId": "preco_produto",
              "fieldValue": "=R$ {{ $node['Loop Over Items3'].json.variants[0].price.replaceAll('.',',') }}"
            },
            {
              "fieldId": "url_imagem_01",
              "fieldValue": "="
            },
            {
              "fieldId": "tipo_produto",
              "fieldValue": "={{ $node['Loop Over Items3'].json.product_type }}"
            },
            {
              "fieldId": "estoque_atual",
              "fieldValue": "={{ $node['Loop Over Items3'].json.variants[0].inventory_quantity }}"
            }
          ]
        }
      },
      "id": "bf9a40a1-20ca-4f76-a9bd-988866c07d88",
      "name": "Supabase4",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2600,
        40
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        1980,
        1660
      ],
      "id": "9361bb5c-719f-421b-9248-4069afc00ab4",
      "name": "Embeddings OpenAI3"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        2020,
        2180
      ],
      "id": "e0c0040f-a6fe-4473-a281-5c3d0885626c",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=Voc\u00ea \u00e9 um agente de ia chamado pincsuporte que faz o atendimento do e-commerce da pincbar para clientes.\n\nutilize a tool \"consulta_produtos\" para ver informa\u00e7\u00f5es sobre produtos (exceto lista de produtos pre\u00e7o e url)\nutilize a tool \"consulta_url_preco\" para ver pre\u00e7o, lista de produtos e url de produtos\nutilize a tool \"info_empresa\" para ver informa\u00e7\u00f5es sobre a empresa, troca e devolu\u00e7\u00e3o, parcerias, lojistas, influenciadores etc.\n\nResponda de uma maneira divertida, leve, simp\u00e1tica, discontraida com emojis e que n\u00e3o passe 400 caracteres."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        2320,
        2180
      ],
      "id": "d1789aff-7863-4222-9e71-ccde5ffee8bd",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        2180,
        2380
      ],
      "id": "a5098100-8c9e-444c-abbc-892bdba25de3",
      "name": "OpenAI Chat Model"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        2340,
        2360
      ],
      "id": "1e2b8b9c-7754-4a0f-b3a1-4093c2dd45bf",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        2500,
        2560
      ],
      "id": "2035ac5c-277b-4ee2-a6f2-db7c4e73619e",
      "name": "Embeddings OpenAI4"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "consulta_produtos",
        "toolDescription": "\u00datil para consulta de informa\u00e7\u00f5es sobre produtos (exceto lista de produtos, pre\u00e7os e url)",
        "tableName": {
          "__rl": true,
          "value": "base_produtos_pincbar",
          "mode": "list",
          "cachedResultName": "base_produtos_pincbar"
        },
        "topK": 15,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1.1,
      "position": [
        2540,
        2380
      ],
      "id": "6548ce31-0f9d-497e-98b7-2b5197fcd10f",
      "name": "consulta_produtos"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini-2024-07-18",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI-2024-07-18"
        },
        "messages": {
          "values": [
            {
              "content": "=Voc\u00ea \u00e9 um modelo avan\u00e7ado de IA especializado em criar conte\u00fado baseado em dados fornecidos. Receber\u00e1 informa\u00e7\u00f5es detalhadas sobre um produto e precisar\u00e1 gerar **30 perguntas e respostas (Q&A)** que clientes possam fazer sobre esse produto.\n\nUse as informa\u00e7\u00f5es fornecidas para criar perguntas e respostas claras e \u00fateis. Inclua detalhes sobre t\u00edtulo e  descri\u00e7\u00e3o. As perguntas devem cobrir poss\u00edveis d\u00favidas de clientes sobre o produto e suas caracter\u00edsticas. As respostas devem ser em tom leve, curto, carism\u00e1tico e em algumas respostas utilize emojis.\n\n**Exemplo do formato esperado**:\nQ: pergunta01  \nA: pergunta01\n---\nQ: pergunta02  \nA: pergunta02\n---\nQ: pergunta03 \nA: pergunta03\n\n**Instru\u00e7\u00f5es adicionais**:\n1. Use todas as informa\u00e7\u00f5es fornecidas no contexto.\n2. Certifique-se de que as perguntas sejam diversificadas e \u00fateis para diferentes cen\u00e1rios.\n3. Inclua perguntas sobre as principais caracter\u00edsticas do produto, seus benef\u00edcios e como us\u00e1-lo.\n\nAgora, gere as 30 perguntas e respostas com base nas seguintes informa\u00e7\u00f5es:\n- T\u00edtulo: {{ $('Loop Over Items2').item.json.titulo_produto }}\n- Descri\u00e7\u00e3o: {{ $('Loop Over Items2').item.json.descricao_produto }}\n\n\nSua resposta somente deve ser a pergunta e a resposta.",
              "role": "assistant"
            }
          ]
        },
        "options": {}
      },
      "id": "3ec82b7a-fe15-4f38-8481-f881b5e33131",
      "name": "Monta FAQ",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.6,
      "position": [
        1620,
        720
      ]
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini-2024-07-18",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI-2024-07-18"
        },
        "messages": {
          "values": [
            {
              "content": "=Voc\u00ea \u00e9 um modelo avan\u00e7ado de IA especializado em criar conte\u00fado baseado em dados fornecidos. Receber\u00e1 informa\u00e7\u00f5es detalhadas sobre um produto e precisar\u00e1 gerar **5 frases** formatadas de forma clara e organizada, utilizando os dados fornecidos.\n\nCada frase deve incluir informa\u00e7\u00f5es espec\u00edficas sobre o t\u00edtulo, descri\u00e7\u00e3o, URL, status, pre\u00e7o e tipo do produto, seguindo o formato abaixo:\n\n1. O t\u00edtulo do produto \u00e9 {{ $json.titulo_produto }}.  \n2. A descri\u00e7\u00e3o do produto \u00e9: {{ $json.descricao_produto }}.  \n3. A URL do produto \u00e9: {{ $json.url_do_produto }}.  \n4. O status do produto \u00e9: {{ $json.status_produto }}.  \n5. O pre\u00e7o do produto \u00e9: {{ $json.preco_produto }} podendo ser parcelado em 4x de R$ (calcule) sem juros.  \n6. O tipo do produto \u00e9: {{ $json.tipo_produto }}.  \n\n**Instru\u00e7\u00f5es adicionais**:\n1. Utilize as informa\u00e7\u00f5es fornecidas no contexto para criar as frases.  \n2. Certifique-se de que o formato siga exatamente o modelo apresentado.  \n3. Seja direto e espec\u00edfico, sem adicionar perguntas, respostas ou interpreta\u00e7\u00f5es extras.  \n\nCom base nas seguintes informa\u00e7\u00f5es: \n- T\u00edtulo: {{ $json.titulo_produto }}  \n- Descri\u00e7\u00e3o: {{ $json.descricao_produto }}  \n- URL: {{ $json.url_do_produto }}  \n- Status: {{ $json.status_produto }}  \n- Pre\u00e7o: {{ $json.preco_produto }}  \n- Tipo: {{ $json.tipo_produto }}  \n\nGere as 6 frases no formato especificado.\n\nN\u00e3o diminua texto nem corte frases. Deixe as informa\u00e7\u00f5es completas.",
              "role": "assistant"
            }
          ]
        },
        "options": {}
      },
      "id": "ae318786-bc99-4478-a88c-9240628376a3",
      "name": "Monta Informa\u00e7\u00f5es",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.6,
      "position": [
        940,
        720
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5151a44d-dd2b-444a-98db-f3aa736671d2",
              "name": "descricao_produto",
              "value": "={{ $('Monta Informa\u00e7\u00f5es').item.json.message.content }}",
              "type": "string"
            },
            {
              "id": "6f31b596-aa73-4457-9997-054295e0d12f",
              "name": "titulo_produto",
              "value": "={{ $('Loop Over Items2').item.json.titulo_produto }}",
              "type": "string"
            },
            {
              "id": "acbf91a1-84c8-4a63-b9d6-c4b2c3dafe38",
              "name": "id",
              "value": "={{ $('Loop Over Items2').item.json.id }}",
              "type": "number"
            },
            {
              "id": "699ddd15-4c79-40a1-9491-e3da8157c060",
              "name": "faq",
              "value": "={{ $json.message.content }}",
              "type": "string"
            },
            {
              "id": "a040d1b6-4dc7-4844-ba75-ea2321a6bca2",
              "name": "status_produto",
              "value": "={{ $('Supabase2').item.json.status_produto }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "8b04a75e-4238-4319-ba93-774049e607a6",
      "name": "Monta_Info",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        2140,
        720
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "base_produtos_pincbar",
        "returnAll": true,
        "filters": {
          "conditions": [
            {
              "keyName": "id_produto",
              "condition": "eq",
              "keyValue": "={{ $json.id }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2620,
        720
      ],
      "id": "3d6932a9-a920-4f22-9ffa-cf2b139e98cc",
      "name": "busca_produto_base",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6fac2bec-2800-4d23-9d53-1f1c293e1e1f",
              "leftValue": "={{ $('busca_produto_base').item.json }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "empty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        720,
        1160
      ],
      "id": "0f7c0f39-8117-457f-8c15-43bce64eedd5",
      "name": "verifica se j\u00e1 existe produto"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "55492526-7a7f-4892-8496-d0eba411715e",
              "name": "Q&A",
              "value": "=[DESCRICAO]\n\n{{ $('Monta_Info').item.json.descricao_produto }}\n\n[FAQ]\n\n{{ $('Monta_Info').item.json.faq }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "19996b09-e0ed-4862-8e07-fb18a81d42ac",
      "name": "pega_qea",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1320,
        1000
      ]
    },
    {
      "parameters": {
        "mode": "insert",
        "tableName": {
          "__rl": true,
          "value": "base_produtos_pincbar",
          "mode": "list",
          "cachedResultName": "base_produtos_pincbar"
        },
        "options": {
          "queryName": "match_base_produtos_pincbar"
        }
      },
      "id": "3d77ffcd-5ab1-4311-bc9c-a81bd49bdd7f",
      "name": "Insere Dado Vecto Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1,
      "position": [
        1660,
        1000
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1387919c-c9c1-487c-81f6-e6aea342d9cc",
              "name": "Q&A",
              "value": "=[DESCRICAO]\n\n{{ $('Monta_Info').item.json.descricao_produto }}\n\n[FAQ]\n\n{{ $('Monta_Info').item.json.faq }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1280,
        1500
      ],
      "id": "af2ab26e-8231-45f2-b0c1-bf1c17e66bd3",
      "name": "pega_qea_atualiza_prod"
    },
    {
      "parameters": {
        "mode": "update",
        "tableName": {
          "__rl": true,
          "value": "base_produtos_pincbar",
          "mode": "list",
          "cachedResultName": "base_produtos_pincbar"
        },
        "id": "={{ $('verifica se j\u00e1 existe produto').item.json.id }}",
        "options": {
          "queryName": "match_base_produtos_pincbar"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1.1,
      "position": [
        2100,
        1500
      ],
      "id": "08dfff26-7ba7-4d2a-afa1-e1a22faed4a5",
      "name": "Atualiza Vector Store"
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "base_produtos_pincbar",
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "condition": "eq",
              "keyValue": "={{ $json.id }}"
            }
          ]
        },
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "id_produto",
              "fieldValue": "={{ $json.metadata.id_produto }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2540,
        1000
      ],
      "id": "9a070f29-493f-483b-be93-f4b880e08fad",
      "name": "Supabase5"
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "base_produtos_pincbar",
        "returnAll": true,
        "filterType": "none"
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        2120,
        1000
      ],
      "id": "9ab83792-b472-4109-a1bd-50274bad7756",
      "name": "Supabase6"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "3ac9c5d7-aebe-48ac-8398-e8173a182a0b",
              "leftValue": "={{ $json.metadata.id_produto }}",
              "rightValue": "={{ $('Insere Dado Vecto Store').item.json.metadata.id_produto }}",
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        2340,
        1000
      ],
      "id": "b4e9b014-8a42-4b1e-bbec-d9faf5b7ba94",
      "name": "Filter"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "\u00fatil para consultar pre\u00e7o e url de produto",
        "operation": "getAll",
        "tableId": "produtos_pincbar",
        "returnAll": true
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        2920,
        2280
      ],
      "id": "ca9a662f-e1a4-4ee7-a013-77aafe2b6c96",
      "name": "consulta_preco_url"
    },
    {
      "parameters": {
        "authentication": "accessToken",
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "additionalFields": {}
      },
      "id": "14041106-4249-413e-9ebb-19f0a558905c",
      "name": "Shopify1",
      "type": "n8n-nodes-base.shopify",
      "typeVersion": 1,
      "position": [
        440,
        2160
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "base_produtos_pincbar",
        "returnAll": true
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        440,
        2380
      ],
      "id": "349d77f3-a9e3-4aa9-9953-b7a90e183632",
      "name": "Supabase7",
      "executeOnce": true
    },
    {
      "parameters": {
        "mode": "combine",
        "advanced": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "id",
              "field2": "id_produto"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.1,
      "position": [
        1040,
        2200
      ],
      "id": "548bae93-c499-4ce7-8260-dd18297585ff",
      "name": "Merge"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f2d038dd-4e3e-416a-9f9a-e488e607b785",
              "leftValue": "={{ $json.status }}",
              "rightValue": "draft",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        720,
        2160
      ],
      "id": "a81ba717-9b2e-49ec-a4c0-56c2d2bd5fe7",
      "name": "Filter1"
    },
    {
      "parameters": {
        "operation": "delete",
        "tableId": "base_produtos_pincbar",
        "filters": {
          "conditions": [
            {
              "keyName": "id_produto",
              "condition": "eq",
              "keyValue": "={{ $json.id_produto }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1260,
        2200
      ],
      "id": "2bed1ea3-d42e-429d-bfba-17da72e174b0",
      "name": "Supabase"
    },
    {
      "parameters": {
        "operation": "delete",
        "tableId": "produtos_pincbar",
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "condition": "eq",
              "keyValue": "={{ $('Merge').item.json.id_produto }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1480,
        2200
      ],
      "id": "52cb7aef-7ae2-4a9c-8434-414f97d67d9c",
      "name": "Supabase1"
    },
    {
      "parameters": {
        "content": "# EXCLUI PRODUTOS EM RASCUNHO\n",
        "height": 582,
        "width": 1778,
        "color": 6
      },
      "id": "3d692998-8d5a-4860-825b-ec8a7e89b60d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        2020
      ]
    },
    {
      "parameters": {
        "content": "# TESTA RAG",
        "height": 742,
        "width": 1358,
        "color": 3
      },
      "id": "6b152e80-6094-439b-8031-bba4f90d96c9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1840,
        2020
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 1
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        100,
        120
      ],
      "id": "83d79a20-5b10-44e4-a6c4-2115c3b1703a",
      "name": "Roda todo dia 01:00"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtHour": 2
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        120,
        700
      ],
      "id": "cd0dfdf4-9845-4b9c-b95e-16798ef0f977",
      "name": "Roda 1x semana 02:00"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        160,
        2200
      ],
      "id": "dd78c64b-c5d9-42c7-a80b-2897f1f7de31",
      "name": "Roda 1x semana 00:00"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        2760,
        2620
      ],
      "id": "1ad0a134-59be-4d3b-bbc0-2fce0e38b4a5",
      "name": "Embeddings OpenAI1"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "info_empresa",
        "toolDescription": "\u00fatil para consultar informa\u00e7\u00f5es sobre: empresa, troca e devolu\u00e7\u00e3o, lojista, influenciadores, parcerias etc..",
        "tableName": {
          "__rl": true,
          "value": "documents",
          "mode": "list",
          "cachedResultName": "documents"
        },
        "topK": 15,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1.1,
      "position": [
        2860,
        2480
      ],
      "id": "d63faecb-371b-4b49-a315-8b3411257535",
      "name": "info_empresa"
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "shared": [
    {
      "updatedAt": "2025-07-08T18:58:17.498Z",
      "createdAt": "2025-07-08T18:58:17.498Z",
      "role": "workflow:owner",
      "workflowId": "211Lk8Gn9ArkFxFK",
      "projectId": "o60HadikmqrvYZ9Z"
    }
  ],
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-07-08T18:58:17.498Z",
  "versionId": "e9db1e99-f733-48eb-a70b-17c88850f320"
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Agente_RAG. Uses supabase, embeddingsOpenAi, documentDefaultDataLoader, textSplitterCharacterTextSplitter. Chat trigger; 50 nodes.

Source: https://github.com/diegohugo570/backup-n8n/blob/4b35f5dcf0af947eeb77275d3dcc3f4ff1d296b7/workflows/Agente_RAG.json — 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 workflow acts as a 24/7 sales agent, engaging leads across WhatsApp, Instagram, Facebook, Telegram, and your website. It intelligently transcribes audio messages, answers questions using a knowle

Chat Trigger, Memory Postgres Chat, Tool Workflow +20
AI & RAG

• Create a Google Drive folder to watch. • Connect your Google Drive account in n8n and authorize access. • Point the Google Drive Trigger node to this folder (new/modified files trigger the flow).

Agent, Chat Trigger, Memory Buffer Window +14
AI & RAG

The workflow operates through a three-step process that handles incoming chat messages with intelligent tool orchestration: Message Trigger: The node triggers whenever a user message arrives and passe

Chat Trigger, Memory Postgres Chat, OpenAI Embeddings +16
AI & RAG

Build an All-Source Knowledge Assistant with Claude, RAG, Perplexity, and Drive. Uses chatTrigger, memoryPostgresChat, embeddingsOpenAi, rerankerCohere. Chat trigger; 40 nodes.

Chat Trigger, Memory Postgres Chat, OpenAI Embeddings +16
AI & RAG

Advanced Ai Demo Presented At Ai Developers 14 Meetup. Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14