{
  "name": "My workflow",
  "nodes": [
    {
      "parameters": {},
      "id": "b570c3ae-3cf3-4195-bfdc-b13cc962e210",
      "name": "Ao Clicar (Teste)",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        160,
        160
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "id": "02536eec-8c01-4b60-8e61-df138aeee2ab",
      "name": "Todo Dia (Produ\u00e7\u00e3o)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        160,
        368
      ],
      "disabled": true,
      "notes": "Ative este gatilho apenas em produ\u00e7\u00e3o"
    },
    {
      "parameters": {
        "operation": "getAll",
        "limit": 100,
        "options": {}
      },
      "id": "a2544dfc-5f22-48df-9e35-1d2560743842",
      "name": "WooCommerce Cliente",
      "type": "n8n-nodes-base.wooCommerce",
      "typeVersion": 1,
      "position": [
        400,
        272
      ],
      "credentials": {
        "wooCommerceApi": {
          "name": "<your credential>"
        }
      },
      "notes": "Configure a Credencial do Cliente aqui"
    },
    {
      "parameters": {
        "jsCode": "// Padroniza o JSON para o formato que o Bot Python entende\nreturn items.map(item => {\n  const p = item.json;\n  \n  // Remove HTML da descri\u00e7\u00e3o\n  let desc = p.short_description || p.description || \"\";\n  desc = desc.replace(/<[^>]*>?/gm, '');\n\n  return {\n    json: {\n      nome: p.name,\n      preco: `R$ ${p.price}`,\n      descricao: desc\n    }\n  }\n});"
      },
      "id": "9f7e5b9c-00b0-4145-ac3b-b978de66b7f4",
      "name": "Formatar Dados",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        624,
        272
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://host.docker.internal:5000/api/sync/produtos",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Admin-Token",
              "value": "senha_segura_n8n"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $('Formatar Dados').all().map(i => i.json) }}",
        "options": {}
      },
      "id": "f36df037-fa8e-4a79-88e9-eed50c225194",
      "name": "Enviar para Bot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        848,
        272
      ],
      "executeOnce": true,
      "notes": "host.docker.internal conecta no bot rodando no mesmo PC"
    }
  ],
  "connections": {
    "Ao Clicar (Teste)": {
      "main": [
        [
          {
            "node": "WooCommerce Cliente",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todo Dia (Produ\u00e7\u00e3o)": {
      "main": [
        [
          {
            "node": "WooCommerce Cliente",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WooCommerce Cliente": {
      "main": [
        [
          {
            "node": "Formatar Dados",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Formatar Dados": {
      "main": [
        [
          {
            "node": "Enviar para Bot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fe497be8-d73a-4bb5-8f1c-1f9d50a48b64",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "8pgUrpTgiKVJP7l5",
  "tags": []
}