{
  "name": "ScriptureFlow - Daily Verse to Email",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "3cd7527c-1b20-4ad8-b878-9f36d899e57d",
      "name": "Every Day at 8 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://scriptureflow-api-preview.pages.dev/api/quick-verse?version=en-kjv",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        }
      },
      "id": "4f1211a7-5564-4bc7-9448-5de2bd33caaa",
      "name": "Get Runtime-Selected Verse",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        0
      ],
      "notes": "Calls ScriptureFlow at run time. Refreshing or running again may select a different verse."
    },
    {
      "parameters": {
        "jsCode": "const data = $json;\n\nif (!data.ok || !data.text || !data.reference || !data.version) {\n  throw new Error(`ScriptureFlow did not return a usable verse: ${data.error || 'unknown API error'}`);\n}\n\nreturn [{\n  json: {\n    subject: `Daily Scripture - ${data.reference} (${data.version})`,\n    emailBody: `${data.reference} (${data.version})\\n\\n${data.text}\\n\\nSource: ScriptureFlow\\nThis verse was selected at request time and a later refresh may return a different verse.`,\n    version: data.version,\n    reference: data.reference,\n    scriptureText: data.text\n  }\n}];"
      },
      "id": "a4fa83d1-e95e-4b4c-93ef-5f0a683421a5",
      "name": "Format Scripture Email",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        0
      ],
      "notes": "Formats only ScriptureFlow response fields. Add generated commentary in a separate field or node if needed."
    },
    {
      "parameters": {
        "fromEmail": "sender@example.com",
        "toEmail": "recipient@example.com",
        "subject": "={{ $json.subject }}",
        "emailFormat": "text",
        "text": "={{ $json.emailBody }}",
        "options": {}
      },
      "id": "4920a960-b040-4717-a80e-900ef9b358e8",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        720,
        0
      ],
      "notes": "Replace the placeholder addresses and configure your own SMTP credential before activation."
    }
  ],
  "pinData": {},
  "connections": {
    "Every Day at 8 AM": {
      "main": [
        [
          {
            "node": "Get Runtime-Selected Verse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Runtime-Selected Verse": {
      "main": [
        [
          {
            "node": "Format Scripture Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Scripture Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4b81f321-ff37-41ca-97be-4401d47f9121",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
