[
  {
    "updatedAt": "2026-10-31T19:58:15.000Z",
    "createdAt": "2026-10-31T19:58:09.842Z",
    "id": "errorAlertDemo01",
    "name": "Alerte d'échec (workflow d'erreur, démo Memo Labs)",
    "description": null,
    "active": true,
    "isArchived": false,
    "nodes": [
      {
        "parameters": {},
        "name": "Exécution en échec",
        "type": "n8n-nodes-base.errorTrigger",
        "typeVersion": 1,
        "position": [
          0,
          300
        ],
        "id": "e9dcc8b5-6586-4a02-b1e8-4e44f43d1062"
      },
      {
        "parameters": {
          "jsCode": "// Déclenché par n8n à chaque exécution en échec d'un workflow qui désigne celui-ci comme\n// workflow d'erreur. Il ne corrige rien : il prévient, avec de quoi reprendre tout de suite.\nconst e = $input.first().json;\nconst ex = e.execution || {};\nconst inc = {\n  workflow: (e.workflow && e.workflow.name) || 'inconnu',\n  execution_id: ex.id || null,\n  failed_node: ex.lastNodeExecuted || null,\n  error: (ex.error && ex.error.message) || 'erreur sans message',\n  mode: ex.mode || null,\n  url: ex.url || null,\n};\ninc.text = `Échec du flux « ${inc.workflow} » à l'étape « ${inc.failed_node} » (exécution ${inc.execution_id}) : ${inc.error}. `\n  + 'Rien n\\'est perdu : le formulaire a reçu une erreur et la même soumission peut être rejouée sans doublon.';\nreturn [{ json: inc }];"
        },
        "name": "Mettre en forme l'incident",
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          220,
          300
        ],
        "id": "b31ed0b8-f288-440e-a51f-8b879462da8e"
      },
      {
        "parameters": {
          "method": "POST",
          "url": "http://fakes-partenaire-automation:8080/ops/incident",
          "sendHeaders": true,
          "headerParameters": {
            "parameters": [
              {
                "name": "Idempotency-Key",
                "value": "={{ 'incident:' + $json.execution_id }}"
              }
            ]
          },
          "sendBody": true,
          "specifyBody": "json",
          "jsonBody": "={{ JSON.stringify($json) }}",
          "options": {
            "timeout": 5000
          }
        },
        "name": "Journal des incidents (simulé)",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          440,
          300
        ],
        "retryOnFail": true,
        "maxTries": 3,
        "waitBetweenTries": 1000,
        "id": "8e2df629-98ef-40f2-ae9d-78f7169bd9ac"
      },
      {
        "parameters": {
          "method": "POST",
          "url": "http://fakes-partenaire-automation:8080/slack/post",
          "sendHeaders": true,
          "headerParameters": {
            "parameters": [
              {
                "name": "Idempotency-Key",
                "value": "={{ 'alert:' + $('Mettre en forme l\\'incident').first().json.execution_id }}"
              }
            ]
          },
          "sendBody": true,
          "specifyBody": "json",
          "jsonBody": "={{ JSON.stringify({ channel: '#ops-alertes', text: $('Mettre en forme l\\'incident').first().json.text }) }}",
          "options": {
            "timeout": 5000
          }
        },
        "name": "Slack : alerte #ops-alertes (simulé)",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          660,
          300
        ],
        "retryOnFail": true,
        "maxTries": 3,
        "waitBetweenTries": 1000,
        "id": "56bd185f-1178-4dc6-93d3-2529a9826475"
      }
    ],
    "connections": {
      "Exécution en échec": {
        "main": [
          [
            {
              "node": "Mettre en forme l'incident",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Mettre en forme l'incident": {
        "main": [
          [
            {
              "node": "Journal des incidents (simulé)",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Journal des incidents (simulé)": {
        "main": [
          [
            {
              "node": "Slack : alerte #ops-alertes (simulé)",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    },
    "settings": {
      "executionOrder": "v1",
      "timezone": "Europe/Zurich",
      "saveDataSuccessExecution": "all"
    },
    "staticData": null,
    "meta": null,
    "nodeGroups": [],
    "pinData": {},
    "versionId": "6f3515d2-cf89-4561-9ebe-ab04a5aec5d4",
    "activeVersionId": "6f3515d2-cf89-4561-9ebe-ab04a5aec5d4",
    "versionCounter": 1,
    "triggerCount": 0,
    "sourceWorkflowId": null,
    "tags": [],
    "shared": [
      {
        "updatedAt": "2026-10-31T19:58:09.855Z",
        "createdAt": "2026-10-31T19:58:09.855Z",
        "role": "workflow:owner",
        "workflowId": "errorAlertDemo01",
        "projectId": "7LTUHtgnonN2RDaB",
        "project": {
          "updatedAt": "2026-10-31T19:58:08.601Z",
          "createdAt": "2026-10-31T19:58:08.601Z",
          "id": "7LTUHtgnonN2RDaB",
          "name": "Unnamed Project",
          "type": "personal",
          "icon": null,
          "description": null,
          "customTelemetryTags": [],
          "creatorId": "a4795032-97a2-4039-8298-4e00747bfdf7"
        }
      }
    ],
    "versionMetadata": {
      "name": null,
      "description": null
    }
  }
]