{
  "id": "FLUXIEL-DEMO3-REPRISE",
  "name": "Fluxiel Démo 3 — Reprise après validation humaine",
  "nodes": [
    {
      "parameters": {
        "content": "## Reprise après validation humaine\n\nAppelé par admin-api quand un humain a tranché dans l'interface de revue.\n- valider / corriger → le dossier est classé avec les champs (corrigés).\n- rejeter → le dossier est classé comme rejeté (traçabilité conservée).",
        "height": 220,
        "width": 380
      },
      "id": "note-reprise",
      "name": "Note explicative",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        200,
        60
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "reprise-validation",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-reprise",
      "name": "Webhook reprise",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ],
      "webhookId": "fluxiel-demo3-reprise"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.ADMIN_API_URL || 'http://127.0.0.1:8103' }}/dossiers",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ { document_id: $json.body.document_id || $json.document_id, validation_id: $json.body.validation_id || $json.validation_id, fichier: $json.body.fichier || $json.fichier, type_document: ($json.body.decision || $json.decision) === 'rejeter' ? 'rejete' : ($json.body.type_document || $json.type_document), champs: $json.body.champs || $json.champs || {}, decision: $json.body.decision || $json.decision, commentaire: $json.body.commentaire || $json.commentaire || '', chemin_stocke: $json.body.chemin_stocke || $json.chemin_stocke || '' } }}",
        "options": {}
      },
      "id": "classer-dossier",
      "name": "Classer le dossier",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { statut: 'classe', document_id: $json.document_id } }}",
        "options": {}
      },
      "id": "repondre-reprise",
      "name": "Répondre",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        680,
        300
      ]
    }
  ],
  "connections": {
    "Webhook reprise": {
      "main": [
        [
          {
            "node": "Classer le dossier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classer le dossier": {
      "main": [
        [
          {
            "node": "Répondre",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "errorWorkflow": "WF-ERREUR-DEMO3",
    "timezone": "Europe/Paris",
    "saveDataErrorExecution": "all"
  },
  "tags": [
    {
      "name": "fluxiel-demo"
    }
  ]
}