{
  "name": "Relay\u25b6Deck \u2014 Verdict Notifications",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "verdict-notification",
        "responseMode": "onReceived",
        "responseCode": 200,
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Verdict Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.DISCORD_WEBHOOK_URL }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ embeds: [{ title: '\u26a1 New Council Verdict', description: $json.question.substring(0, 200), color: $json.confidence >= 0.8 ? 31743 : 14343934, fields: [{ name: 'Councils', value: $json.councils.join(', '), inline: true }, { name: 'Confidence', value: Math.round($json.confidence * 100) + '%', inline: true }, { name: 'Source', value: $json.source || 'council', inline: true }], url: $json.verdictUrl, footer: { text: 'Relay\u25b6Deck \u2014 Council\u25b6Verse' }, timestamp: $json.timestamp }] }) }}",
        "options": {}
      },
      "id": "discord-post",
      "name": "Post to Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        500,
        200
      ]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.userId }}",
        "subject": "Your Council Verdict is Ready",
        "message": "={{ '<h2>Council Verdict</h2><p><strong>Question:</strong> ' + $json.question.substring(0, 300) + '</p><p><strong>Confidence:</strong> ' + Math.round($json.confidence * 100) + '%</p><p><strong>Councils:</strong> ' + $json.councils.join(', ') + '</p><hr/><p>' + $json.verdict.substring(0, 500) + '...</p><p><a href=\"' + $json.verdictUrl + '\">View Full Verdict \u2192</a></p><br/><p style=\"color: #666;\">\u2014 Relay\u25b6Deck by RelayLaunch</p>' }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "gmail-send",
      "name": "Email Verdict Summary",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        500,
        400
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Verdict Webhook": {
      "main": [
        [
          {
            "node": "Post to Discord",
            "type": "main",
            "index": 0
          },
          {
            "node": "Email Verdict Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": [
    {
      "name": "relay-deck"
    },
    {
      "name": "notifications"
    }
  ]
}