{
  "name": "TrustField Workflow Sample Bridge",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "trustfield-workflow-sample",
        "responseMode": "onReceived"
      },
      "id": "wh",
      "name": "Sample Stage Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const b = $input.first().json.body || $input.first().json;\nreturn [{ json: { chain: 'workflow_sample', slug: b.slug, stage: b.stage, stage_index: b.stage_index, decision: b.decision || null, client: b.client || null, at: b.at || new Date().toISOString() } }];"
      },
      "id": "norm",
      "name": "Normalize Sample Event",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "chatId": "={{$env.TELEGRAM_CHANNEL_ID}}",
        "text": "=Sample {{$json.slug}} \u2192 {{$json.stage}}{{$json.decision ? ' \u00b7 ' + $json.decision : ''}}"
      },
      "id": "tg",
      "name": "Optional Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        720,
        300
      ]
    }
  ],
  "connections": {
    "Sample Stage Webhook": {
      "main": [
        [
          {
            "node": "Normalize Sample Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Sample Event": {
      "main": [
        [
          {
            "node": "Optional Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "description": "Receives proxied sample stage events from web /api/workflow-sample-n8n when N8N_WORKFLOW_SAMPLE_WEBHOOK_URL is set."
  }
}