{
  "name": "Firma lui Dan EP7: comenzi WhatsApp în tabel",
  "nodes": [
    {
      "id": "f434b4df-dcb1-4cf5-b909-57f628e23b8e",
      "name": "WhatsApp: mesaj nou",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        -1400,
        0
      ],
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "",
          "name": "De conectat"
        }
      },
      "webhookId": "99ecbf9d-cec8-41a1-aeed-ad152d8ea879"
    },
    {
      "id": "ec89f4a0-1796-48bf-9433-3af586408422",
      "name": "Test: mesaj WhatsApp",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -1400,
        220
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "firma-lui-dan-whatsapp-test",
        "responseMode": "lastNode",
        "responseData": "allEntries",
        "options": {}
      },
      "webhookId": "18a7ce68-de53-4bec-9c2d-d0749bef50d3"
    },
    {
      "id": "e2749214-21d0-43f7-88b1-79d9bb88b1d8",
      "name": "Setări",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1180,
        100
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "94c3edb6-f887-4ab8-b99b-dcbf80c737a5",
              "name": "tabelId",
              "value": "PUNE_AICI_ID_TABEL",
              "type": "string"
            },
            {
              "id": "6f35bb33-23e8-4629-98ea-88e6a353cce0",
              "name": "foaie",
              "value": "Comenzi",
              "type": "string"
            },
            {
              "id": "95318e33-3b26-4ac3-85fd-d9c7917c760e",
              "name": "phoneNumberId",
              "value": "PUNE_AICI_PHONE_NUMBER_ID",
              "type": "string"
            },
            {
              "id": "9c3237c8-8138-4ec4-bea1-7a0c3fcc3758",
              "name": "trimiteConfirmarea",
              "value": true,
              "type": "boolean"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      }
    },
    {
      "id": "1ba601fb-d49c-401f-b666-4ac32478b124",
      "name": "Citește mesajul",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -960,
        100
      ],
      "parameters": {
        "jsCode": "// Un rând pentru fiecare mesaj text primit pe WhatsApp (sau trimis la webhook-ul de test).\nconst out = [];\n$input.all().forEach((it, i) => {\n  let v = it.json;\n  const test = Boolean(v.webhookUrl);\n  if (test) v = v.body || {};\n  if (v.entry) v = v.entry[0].changes[0].value; // payload brut de la Meta\n  const msg = (v.messages || [])[0];\n  if (!msg || msg.type !== 'text') return; // statusuri, poze, audio: le ignorăm\n  const contact = (v.contacts || [])[0] || {};\n  out.push({\n    json: {\n      test,\n      mesaj_id: msg.id,\n      telefon: msg.from,\n      client: (contact.profile && contact.profile.name) || '',\n      text: msg.text.body,\n      primit_la: new Date(Number(msg.timestamp) * 1000).toISOString(),\n    },\n    pairedItem: i,\n  });\n});\nreturn out;\n"
      }
    },
    {
      "id": "742191b3-0d9c-437f-8c4a-daa98b5c5363",
      "name": "Înțelege mesajul (AI)",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "typeVersion": 1.2,
      "position": [
        -740,
        100
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "schemaType": "manual",
        "inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n  \"este_comanda\": {\n   \"type\": \"boolean\",\n   \"description\": \"true doar dacă clientul cere produse (cu sau fără cantități). Salutul, mulțumirile, întrebările de preț sau reclamațiile nu sunt comenzi.\"\n  },\n  \"produse\": {\n   \"type\": \"array\",\n   \"description\": \"Produsele cerute\",\n   \"items\": {\n    \"type\": \"object\",\n    \"properties\": {\n     \"produs\": {\n      \"type\": \"string\",\n      \"description\": \"Doar numele produsului, fără ambalaj, ex. roșii, apă plată. Mărimea ambalajului merge în paranteză, ex. cartofi (10 kg)\"\n     },\n     \"cantitate\": {\n      \"type\": \"number\",\n      \"description\": \"Câte bucăți sau ambalaje cere; 1 dacă nu spune\"\n     },\n     \"unitate\": {\n      \"type\": \"string\",\n      \"description\": \"Unitatea sau ambalajul, acordat cu cantitatea, ex. kg, l, buc, bax/baxuri, ladă/lăzi, sac/saci\"\n     }\n    },\n    \"required\": [\n     \"produs\",\n     \"cantitate\",\n     \"unitate\"\n    ]\n   }\n  },\n  \"data_livrare\": {\n   \"type\": \"string\",\n   \"description\": \"Când vrea livrarea, cum a scris clientul (ex. mâine dimineață, joi). Gol dacă nu spune.\"\n  },\n  \"observatii\": {\n   \"type\": \"string\",\n   \"description\": \"Alte detalii utile (adresă, factură pe firmă etc.). Gol dacă nu există.\"\n  }\n },\n \"required\": [\n  \"este_comanda\",\n  \"produse\",\n  \"data_livrare\",\n  \"observatii\"\n ]\n}",
        "options": {
          "systemPromptTemplate": "Ești asistentul unei firme mici de distribuție din România. Citești mesaje de WhatsApp de la clienți și extragi comanda. Nu inventa produse sau cantități care nu apar în mesaj. Un produs apare o singură dată. Exemplu: „3 saci cartofi de 10 kg” înseamnă produs „cartofi (10 kg)”, cantitate 3, unitate „saci”."
        }
      }
    },
    {
      "id": "ba6dc553-5deb-410e-830c-d53c789cb389",
      "name": "Model AI (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -740,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "De conectat"
        }
      }
    },
    {
      "id": "8aaf4f2f-398f-491e-9b1a-6f5f2015a23c",
      "name": "Combină",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -520,
        100
      ],
      "parameters": {
        "jsCode": "// Rezultatul AI lângă mesajul original.\nconst mesaje = $('Citește mesajul').all();\nreturn $input.all().map((it, i) => ({\n  json: { ...mesaje[i].json, ...(it.json.output || {}) },\n  pairedItem: i,\n}));\n"
      }
    },
    {
      "id": "ca8064f1-1c55-4b7c-babc-d6a495c6c871",
      "name": "E comandă?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -300,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "9b5c579e-8706-4441-b2e6-fc588db395a5",
              "leftValue": "={{ $json.este_comanda === true && ($json.produse || []).length > 0 }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "044352b8-8fe3-470b-bf65-6a4319221c9b",
      "name": "Nu e comandă",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -80,
        280
      ],
      "parameters": {
        "jsCode": "return $input.all().map((it, i) => ({ json: { status: 'ignorat', mesaj: it.json.text }, pairedItem: i }));"
      }
    },
    {
      "id": "e3732c4d-72e2-4d5f-a2c0-a1620f14fbaf",
      "name": "Citește comenzile",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -80,
        0
      ],
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Setări').first().json.tabelId }}"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Setări').first().json.foaie }}"
        },
        "options": {}
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "De conectat"
        }
      },
      "executeOnce": true,
      "alwaysOutputData": true,
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "id": "b0231953-83a9-4f43-831f-10e0caf71683",
      "name": "Număr și dubluri",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        140,
        0
      ],
      "parameters": {
        "jsCode": "// Numărul comenzii și verificarea dublurilor (WhatsApp poate retrimite același mesaj).\nconst randuri = $('Citește comenzile').all().map(r => r.json).filter(r => r.mesaj_id);\nconst vazute = new Set(randuri.map(r => String(r.mesaj_id)));\nlet ultimul = randuri.reduce((m, r) => Math.max(m, Number(r.nr_comanda) || 0), 1000);\nconst fmt = (p) => `${p.cantitate} ${p.unitate || 'buc'} ${p.produs}`.replace(/\\s+/g, ' ').trim();\n\nreturn $('E comandă?').all().map((it, i) => {\n  const c = it.json;\n  if (vazute.has(String(c.mesaj_id))) {\n    return { json: { ...c, status: 'duplicat' }, pairedItem: i };\n  }\n  vazute.add(String(c.mesaj_id));\n  ultimul += 1;\n  const produse = (c.produse || []).map(fmt).join('; ');\n  return {\n    json: {\n      ...c,\n      status: 'noua',\n      nr_comanda: ultimul,\n      data: c.primit_la.slice(0, 10),\n      produse_text: produse,\n    },\n    pairedItem: i,\n  };\n});\n"
      }
    },
    {
      "id": "cec5fbf1-4686-4351-ac84-727cc6e82ca9",
      "name": "E nouă?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        360,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "a465d944-8e90-40d7-8ba5-ac011c7ed951",
              "leftValue": "={{ $json.status }}",
              "rightValue": "noua",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "033f68b8-766b-470a-be00-6aa2c2a1697c",
      "name": "Dublură, nu o mai trec",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        580,
        180
      ],
      "parameters": {
        "jsCode": "return $input.all().map((it, i) => ({ json: { status: 'duplicat', mesaj_id: it.json.mesaj_id }, pairedItem: i }));"
      }
    },
    {
      "id": "58988976-aed3-4d66-9ff6-18a1eb5eeb7f",
      "name": "Adaugă în tabel",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        580,
        -60
      ],
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Setări').first().json.tabelId }}"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Setări').first().json.foaie }}"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "nr_comanda": "={{ $json.nr_comanda }}",
            "data": "={{ $json.data }}",
            "client": "={{ $json.client }}",
            "telefon": "={{ $json.telefon }}",
            "produse": "={{ $json.produse_text }}",
            "observatii": "={{ [$json.data_livrare ? 'Livrare: ' + $json.data_livrare : '', $json.observatii].filter(Boolean).join(' | ') }}",
            "status": "înregistrată",
            "mesaj_original": "={{ $json.text }}",
            "mesaj_id": "={{ $json.mesaj_id }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "nr_comanda",
              "displayName": "nr_comanda",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "data",
              "displayName": "data",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "telefon",
              "displayName": "telefon",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "produse",
              "displayName": "produse",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "observatii",
              "displayName": "observatii",
              "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": "mesaj_original",
              "displayName": "mesaj_original",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mesaj_id",
              "displayName": "mesaj_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "De conectat"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "id": "d92e409b-3bf5-45d8-ba68-5e5f146e06cc",
      "name": "Textul confirmării",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        800,
        -60
      ],
      "parameters": {
        "jsCode": "// Textul confirmării pentru client.\nreturn $('E nouă?').all().map((it, i) => {\n  const c = it.json;\n  const nume = c.client ? ', ' + c.client.split(' ')[0] : '';\n  const livrare = c.data_livrare ? `Livrare: ${c.data_livrare}.` : 'Revenim cu ora de livrare.';\n  const text = `Mulțumim${nume}! Comanda dumneavoastră e ${c.nr_comanda}: ${c.produse_text}. ${livrare}`;\n  return { json: { ...c, confirmare: text }, pairedItem: i };\n});\n"
      }
    },
    {
      "id": "6f8a56a2-6b0a-4090-b999-6de3fbbd9ffd",
      "name": "Trimit pe WhatsApp?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1020,
        -60
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "70e9a0f7-4955-4d36-a87c-bbb31a00577e",
              "leftValue": "={{ $('Setări').first().json.trimiteConfirmarea === true && !$json.test }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "68ce0d56-d8e5-4ecd-9448-5b3ce971180a",
      "name": "Trimite confirmarea",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        1240,
        -160
      ],
      "parameters": {
        "operation": "send",
        "phoneNumberId": "={{ $('Setări').first().json.phoneNumberId }}",
        "recipientPhoneNumber": "={{ $json.telefon }}",
        "textBody": "={{ $json.confirmare }}",
        "additionalFields": {},
        "requestOptions": {}
      },
      "credentials": {
        "whatsAppApi": {
          "id": "",
          "name": "De conectat"
        }
      },
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 3000
    },
    {
      "id": "e26f385a-208e-4304-86f1-facb55f39fc8",
      "name": "Status: confirmată",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1460,
        -160
      ],
      "parameters": {
        "jsCode": "return $('Trimit pe WhatsApp?').all(0).map((it, i) => ({ json: { ...it.json, status_nou: 'confirmată' }, pairedItem: i }));"
      }
    },
    {
      "id": "9a8c8ae0-b10c-4814-94c9-66b465336cba",
      "name": "Status: test",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1240,
        60
      ],
      "parameters": {
        "jsCode": "return $input.all().map((it, i) => ({ json: { ...it.json, status_nou: 'test (confirmare netrimisă)' }, pairedItem: i }));"
      }
    },
    {
      "id": "18429c96-1d13-4c63-9941-0dcb4d6dd216",
      "name": "Actualizează statusul",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1680,
        -60
      ],
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Setări').first().json.tabelId }}"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Setări').first().json.foaie }}"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "mesaj_id": "={{ $json.mesaj_id }}",
            "status": "={{ $json.status_nou }}"
          },
          "matchingColumns": [
            "mesaj_id"
          ],
          "schema": [
            {
              "id": "nr_comanda",
              "displayName": "nr_comanda",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "data",
              "displayName": "data",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "telefon",
              "displayName": "telefon",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "produse",
              "displayName": "produse",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "observatii",
              "displayName": "observatii",
              "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": "mesaj_original",
              "displayName": "mesaj_original",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mesaj_id",
              "displayName": "mesaj_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "De conectat"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "id": "319d57ca-de2b-45d1-b18e-9c503ea437b5",
      "name": "Rezultat",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1900,
        -60
      ],
      "parameters": {
        "jsCode": "const c = $('Textul confirmării').all().map(i => i.json);\nreturn [{ json: { comenzi_noi: c.length, detalii: c.map(x => ({ nr: x.nr_comanda, client: x.client, produse: x.produse_text, confirmare: x.confirmare })) } }];"
      }
    },
    {
      "id": "7d58df02-5b12-41c9-9cda-a85b0a1c94f4",
      "name": "Notă",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1460,
        -460
      ],
      "parameters": {
        "width": 620,
        "height": 420,
        "content": "## Comenzi de pe WhatsApp într-un singur tabel (Firma lui Dan, EP7)\n\n**Ce face:** fiecare mesaj de comandă primit pe WhatsApp devine un rând în Google Sheets, cu număr de comandă, iar clientul primește confirmarea: „Comanda dumneavoastră e 1048…”. Mesajele care nu sunt comenzi („Bună ziua”, „Mulțumesc”) sunt ignorate.\n\n**Verificări:** e comandă (are produse și cantități)? a mai fost înregistrată (WhatsApp poate retrimite același mesaj)?\n\n**Configurare:**\n1. Conectează WhatsApp Business Cloud API (Meta), Google Sheets și OpenAI (sau alt model AI).\n2. Fă o copie a tabelului cu coloanele: nr_comanda, data, client, telefon, produse, observatii, status, mesaj_original, mesaj_id.\n3. În **Setări** pune ID-ul tabelului, numele foii și Phone Number ID-ul din Meta.\n4. Activează workflow-ul.\n\nAtenție: o aplicație Meta are un singur webhook. Dacă ai deja alt flow pe același număr, combină-le.\n\n**Test fără WhatsApp:** trimite prin POST la webhook-ul „Test: mesaj WhatsApp” un JSON în formatul Meta. În test, confirmarea nu se trimite, apare doar în tabel și în răspuns.\n"
      }
    }
  ],
  "connections": {
    "WhatsApp: mesaj nou": {
      "main": [
        [
          {
            "node": "Setări",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test: mesaj WhatsApp": {
      "main": [
        [
          {
            "node": "Setări",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setări": {
      "main": [
        [
          {
            "node": "Citește mesajul",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Citește mesajul": {
      "main": [
        [
          {
            "node": "Înțelege mesajul (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Model AI (OpenAI)": {
      "ai_languageModel": [
        [
          {
            "node": "Înțelege mesajul (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Înțelege mesajul (AI)": {
      "main": [
        [
          {
            "node": "Combină",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combină": {
      "main": [
        [
          {
            "node": "E comandă?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "E comandă?": {
      "main": [
        [
          {
            "node": "Citește comenzile",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Nu e comandă",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Citește comenzile": {
      "main": [
        [
          {
            "node": "Număr și dubluri",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Număr și dubluri": {
      "main": [
        [
          {
            "node": "E nouă?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "E nouă?": {
      "main": [
        [
          {
            "node": "Adaugă în tabel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Dublură, nu o mai trec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adaugă în tabel": {
      "main": [
        [
          {
            "node": "Textul confirmării",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Textul confirmării": {
      "main": [
        [
          {
            "node": "Trimit pe WhatsApp?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trimit pe WhatsApp?": {
      "main": [
        [
          {
            "node": "Trimite confirmarea",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Status: test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trimite confirmarea": {
      "main": [
        [
          {
            "node": "Status: confirmată",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status: confirmată": {
      "main": [
        [
          {
            "node": "Actualizează statusul",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status: test": {
      "main": [
        [
          {
            "node": "Actualizează statusul",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Actualizează statusul": {
      "main": [
        [
          {
            "node": "Rezultat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Bucharest"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "pinData": {}
}