{
  "updatedAt": "2026-03-30T16:32:35.096Z",
  "createdAt": "2026-03-30T16:32:35.096Z",
  "id": "Nj1PoXovBDZhrmrO",
  "name": "NC Content Auto-Processor",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Check Every 30 Min",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        400
      ]
    },
    {
      "parameters": {
        "jsCode": "// Check Google Drive folder for new video files\n// Uses the Emerson North workspace MCP credentials via direct API call\nconst FOLDER_ID = '1XJWezcdCAlz-SJBs2eDJN9IjyFsFCnve';\nconst GHL_KEY = \"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\";\n\n// Get files from Drive folder using Google Drive API\n// We use the MCP proxy approach - call the EN workspace list_folder equivalent\n// Since we don't have Drive OAuth in n8n, we'll check via GHL contact notes\n// or use a simpler approach: webhook notification\n\n// For now, send a Telegram alert when this runs so Bryce can check\n// The actual video processing will be triggered manually until Drive OAuth is set up\n\n// Check for new files by listing folder contents\n// This is a placeholder - needs Google Drive OAuth credential added to n8n\n// TODO: Add googleDriveOAuth2Api credential and use Google Drive node\n\nreturn [{ json: { \n  status: 'polling',\n  folderId: FOLDER_ID,\n  message: 'Drive folder check - needs Google Drive OAuth credential in n8n to auto-detect new files. For now, Bryce triggers processing manually via webhook.',\n  timestamp: new Date().toISOString()\n}}];"
      },
      "id": "check-drive",
      "name": "Check Drive Folder",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        400
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "nc-process-video",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "manual-webhook",
      "name": "Manual Trigger (Bryce)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        600
      ],
      "webhookId": "nc-process-video"
    },
    {
      "parameters": {
        "jsCode": "// Process video: generate title, description, hashtags, schedule\nconst body = $input.first().json.body || $input.first().json;\nconst videoTitle = body.title || 'Nurse Charles - New Video';\nconst videoTopic = body.topic || '';\nconst platform = body.platform || 'all'; // tiktok, instagram, youtube, all\nconst scheduleDate = body.scheduleDate || ''; // ISO date string, empty = next available slot\n\n// Generate platform-specific content\nconst baseHashtags = '#NurseCharles #ERNurse #NurseTok #HealthEducation #ERStories';\n\nconst tiktokDesc = videoTopic \n  ? videoTopic + '\n\nText QUIT to 470-672-7008 for my free 5-day challenge.\n\n' + baseHashtags + ' #QuitSmoking #HealthTok'\n  : videoTitle + '\n\nText QUIT to 470-672-7008 for my free 5-day challenge.\n\n' + baseHashtags;\n\nconst igDesc = videoTopic\n  ? videoTopic + '\n\n37 years in the ER. Real stories. Real talk.\n\nText QUIT to 470-672-7008 or DM me QUIT for my free 5-day challenge.\n\n' + baseHashtags + ' #Instagram #Reels #NurseLife'\n  : videoTitle + '\n\n' + baseHashtags + ' #Instagram #Reels';\n\nconst ytDesc = videoTopic\n  ? videoTitle + '\n\n' + videoTopic + '\n\nNurse Charles | 37+ years in the ER\n\nText QUIT to 470-672-7008 for the free 5-Day Smoke-Free Challenge\n\nFollow me:\nTikTok: @nursecharlesmedia\nInstagram: @nursecharlesmedia\nWebsite: nursecharlesmedia.com\n\n' + baseHashtags\n  : videoTitle + '\n\nNurse Charles | nursecharlesmedia.com\n\n' + baseHashtags;\n\nconst linkedinDesc = videoTopic\n  ? videoTopic + '\n\nAfter 37 years in emergency medicine, I share what I see on the ER floor -- the stories, the lessons, and the truth about healthcare.\n\n' + '#NurseCharles #Healthcare #NurseLife #EmergencyMedicine'\n  : videoTitle + '\n\n#NurseCharles #Healthcare #EmergencyMedicine';\n\n// Send Telegram notification to Bryce with the generated content\nconst TELEGRAM_TOKEN = '7928conveniently_removed';\nconst TELEGRAM_CHAT_ID = 'BRYCE_CHAT_ID';\n\n// For now, return the generated content for review\nreturn [{\n  json: {\n    videoTitle,\n    videoTopic,\n    platforms: {\n      tiktok: { description: tiktokDesc, hashtags: baseHashtags + ' #QuitSmoking #HealthTok' },\n      instagram: { description: igDesc, hashtags: baseHashtags + ' #Instagram #Reels #NurseLife' },\n      youtube: { description: ytDesc, hashtags: baseHashtags },\n      linkedin: { description: linkedinDesc, hashtags: '#NurseCharles #Healthcare #EmergencyMedicine' }\n    },\n    scheduleDate,\n    status: 'ready_for_review',\n    message: 'Content generated for all platforms. Review and approve in GHL Social Planner or post manually.'\n  }\n}];"
      },
      "id": "process-video",
      "name": "Generate Platform Content",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        600
      ]
    },
    {
      "parameters": {
        "jsCode": "// Post to GHL Social Planner via API\nconst GHL_KEY = \"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\";\nconst LOCATION_ID = 'VMK8SyHTd8uCMgcJ7I2A';\nconst data = $input.first().json;\n\n// GHL Social Planner API - schedule posts\n// Note: GHL social posting API may require the social media accounts to be connected in GHL\n// The post will appear in GHL Social Planner for review before publishing\n\nconst results = [];\n\n// For each platform, create a scheduled post in GHL\nfor (const [platform, content] of Object.entries(data.platforms)) {\n  try {\n    const post = await this.helpers.httpRequest({\n      method: 'POST',\n      url: 'https://services.leadconnectorhq.com/social-media-posting/post',\n      headers: {\n        'Authorization': 'Bearer ' + GHL_KEY,\n        'Version': '2021-07-28',\n        'Content-Type': 'application/json'\n      },\n      body: {\n        locationId: LOCATION_ID,\n        type: 'post',\n        status: 'draft', // draft so Bryce can review before publishing\n        summary: content.description,\n        media: [], // video URL would go here\n        scheduledAt: data.scheduleDate || undefined\n      },\n      json: true\n    });\n    results.push({ platform, status: 'drafted', postId: post.id || 'created' });\n  } catch(e) {\n    results.push({ platform, status: 'error', error: e.message });\n  }\n}\n\nreturn [{ json: { results, message: 'Posts drafted in GHL Social Planner for review' } }];"
      },
      "id": "schedule-posts",
      "name": "Draft in GHL Social Planner",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        600
      ]
    }
  ],
  "connections": {
    "Check Every 30 Min": {
      "main": [
        [
          {
            "node": "Check Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger (Bryce)": {
      "main": [
        [
          {
            "node": "Generate Platform Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Platform Content": {
      "main": [
        [
          {
            "node": "Draft in GHL Social Planner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": {
    "node:Check Every 30 Min": {
      "recurrenceRules": []
    }
  },
  "meta": null,
  "pinData": null,
  "versionId": "c3fd8f23-e9d5-49bc-ae56-e2c728ee2dda",
  "activeVersionId": null,
  "versionCounter": 6,
  "triggerCount": 2,
  "shared": [
    {
      "updatedAt": "2026-03-30T16:32:35.099Z",
      "createdAt": "2026-03-30T16:32:35.099Z",
      "role": "workflow:owner",
      "workflowId": "Nj1PoXovBDZhrmrO",
      "projectId": "91dLj8Hg37i136qG",
      "project": {
        "updatedAt": "2026-03-22T06:53:28.112Z",
        "createdAt": "2026-02-12T18:32:53.056Z",
        "id": "91dLj8Hg37i136qG",
        "name": "Bryce Folsom <bfolsom@emersonnorth.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "17d3676f-3e74-4586-8363-5c1f4d237ed7"
      }
    }
  ],
  "tags": [],
  "activeVersion": null
}