L&D Cohort Automation
Automates the 11-step post-session SOP for The Bradbury Group’s L&D Cohort program. Files are renamed and routed, sheets and docs are populated, transcripts are analyzed by AI, facilitator notes are generated, and follow-up drafts are created — all automatically. Humans review and release.
runPipelineManual(weekNum, sessionLetter) and persists state to Script Properties.Overview
After every L&D Cohort session, Paige manually runs an 11-step SOP: rename recording & transcript files, move them to Drive folders, link them in the Schedule Sheet, run the transcript through Walter (AI) for homework/analysis, populate Facilitator Notes, update the Hub doc, and notify learners. This automation handles all of it — from file drop to Gmail draft — in a single pipeline triggered by runPipelineManual(weekNum, sessionLetter).
Architecture
Pipeline Flow
graph TD
START["Files dropped in
00_Incoming"] --> FM
subgraph Phase1["Phase 1 — File Management"]
FM["Detect file type
recording vs transcript"] --> RN["Rename per convention
LD-C1_W03A_Recording_2026-04-28"]
RN --> MV["Move to destination
01_Recordings / 02_Transcripts"]
MV --> SC["Create shortcuts
in 00_SHARED subfolders"]
SC --> EX["Extract transcript text"]
end
EX --> SU
subgraph Phase2["Phase 2 — Sheet Updates"]
SU["Find session row
in Schedule Sheet"] --> LK["Write recording &
transcript links"]
LK --> MS["Mark SOP steps
complete"]
end
MS --> HU
subgraph Phase3["Phase 3 — Hub Doc"]
HU["Append session entry
to 00_START_HERE"]
end
HU --> WA
subgraph Phase4["Phase 4 — Walter AI Analysis"]
WA["Send transcript to
Claude or Gemini API"] --> JP["Parse structured
JSON response"]
JP --> AD["Create formatted
Analysis Doc in Drive"]
end
AD --> DP
subgraph Phase5["Phase 5 — FN Population"]
DP["Copy FN template"] --> PH["Replace placeholders
with Walter data"]
end
PH --> GD
subgraph Phase6["Phase 6 — Notifications"]
GD["Create Gmail draft
with links & analysis"]
GD --> CU["Create ClickUp
review tasks"]
end
CU --> DONE["Pipeline Complete"]
classDef p1 fill:#EAF2F9,stroke:#2F6FA8,color:#241A12,stroke-width:1.5px
classDef p2 fill:#ECE6FB,stroke:#7C3AED,color:#241A12,stroke-width:1.5px
classDef p3 fill:#E4F1EE,stroke:#0E7C6E,color:#241A12,stroke-width:1.5px
classDef p4 fill:#E9E7FB,stroke:#4F46E5,color:#241A12,stroke-width:1.5px
classDef p5 fill:#FAF0DC,stroke:#A5650A,color:#241A12,stroke-width:1.5px
classDef p6 fill:#FBEBEA,stroke:#C23A30,color:#241A12,stroke-width:1.5px
classDef start fill:#E4F1EE,stroke:#0E7C6E,color:#241A12,stroke-width:1.5px
classDef done fill:#D9F3EC,stroke:#0E7C6E,color:#241A12,stroke-width:2.5px
class START start
class FM,RN,MV,SC,EX p1
class SU,LK,MS p2
class HU p3
class WA,JP,AD p4
class DP,PH p5
class GD,CU p6
class DONE done
Data Flow & Pipeline State
graph LR
subgraph State["PIPELINE_W03A
Script Properties"]
S1["transcriptText"]
S2["recordingUrl"]
S3["transcriptUrl"]
S4["walterJson"]
S5["analysisUrl"]
S6["fnDocUrl"]
S7["synopsis"]
S8["draftId"]
end
FM2["FileManager"] -->|"writes"| S1
FM2 -->|"writes"| S2
FM2 -->|"writes"| S3
WA2["WalterApi"] -->|"reads"| S1
WA2 -->|"writes"| S4
WA2 -->|"writes"| S5
WA2 -->|"writes"| S7
DP2["DocPopulator"] -->|"reads"| S4
DP2 -->|"writes"| S6
GD2["GmailDrafter"] -->|"reads"| S4
GD2 -->|"reads"| S2
GD2 -->|"reads"| S3
GD2 -->|"reads"| S6
GD2 -->|"writes"| S8
HU2["HubUpdater"] -->|"reads"| S2
HU2 -->|"reads"| S3
HU2 -->|"reads"| S7
classDef state fill:#E9E7FB,stroke:#4F46E5,color:#241A12,stroke-width:1.5px
classDef mod fill:#ECE6FB,stroke:#7C3AED,color:#241A12,stroke-width:1.5px
class S1,S2,S3,S4,S5,S6,S7,S8 state
class FM2,WA2,DP2,GD2,HU2 mod
Pipeline state is persisted to PIPELINE_{sessionId} in Script Properties as a JSON string. Each phase reads what it needs and writes what downstream phases will consume. If the 5-minute limit is approaching, the Orchestrator saves state and schedules a continuation trigger.
Naming Convention
LD-C1_W03A_Recording_2026-04-28
LD-C1W03Ayyyy-MM-ddHuman-in-the-Loop Model
Schedule Sheet links & status
Hub doc session entry
Walter AI transcript analysis
Analysis doc in Drive
Facilitator Notes population
Gmail follow-up draft
ClickUp review tasks
Edit Facilitator Notes before sharing
Review & send Gmail draft
Confirm deliverables in sheet
Check ClickUp tasks for completeness
Setup Guide
npm install -g @google/claspclasp login (opens browser for Google OAuth)https://script.google.com/home/usersettingsclasp create --type standalone --title "LD Cohort Automation"clasp push (confirm manifest overwrite)clasp open — run setupScriptProperties()setClaudeApiKey() or setGeminiApiKey() (paste key in function body first)testSprint0() to verify foundationtestFullPipeline() for end-to-end verificationFEATURE_FLAGS JSON in Script PropertiesScript Properties Reference
All Script Properties
| Property | Purpose | Source |
|---|---|---|
FOLDER_INCOMING | Drive ID: 00_Incoming folder | Drive URL |
FOLDER_RECORDINGS | Drive ID: 01_Recordings folder | Drive URL |
FOLDER_TRANSCRIPTS | Drive ID: 02_Transcripts folder | Drive URL |
FOLDER_FN | Drive ID: 03_FacilitatorNotes folder | Drive URL |
FOLDER_ANALYSIS | Drive ID: 05_Analysis folder | Drive URL |
FOLDER_SHARED | Drive ID: 00_SHARED folder (with subfolders) | Drive URL |
SCHEDULE_SHEET_ID | Schedule Sheet spreadsheet ID | Sheet URL |
HUB_DOC_ID | 00_START_HERE overview doc ID | Doc URL |
FN_TEMPLATE_ID | Facilitator Notes template doc ID | Doc URL |
CLAUDE_API_KEY | Anthropic API key (checked first) | console.anthropic.com |
GEMINI_API_KEY | Google AI key (fallback) | aistudio.google.com |
CLICKUP_API_KEY | ClickUp API token (optional) | ClickUp settings |
CLICKUP_LIST_ID | ClickUp list for review tasks | ClickUp URL |
FACILITATOR_EMAIL | Email for Gmail drafts | Manual |
COHORT_PREFIX | Naming prefix (e.g., LD-C1) | Manual |
EXECUTION_LOG_SHEET | Sheet ID for _ExecutionLog tab | Sheet URL |
FEATURE_FLAGS | JSON: which phases are enabled | Manual |
Feature Flags JSON
{
"fileManagement": false,
"sheetUpdater": false,
"hubUpdater": false,
"walterApi": false,
"docPopulator": false,
"gmailDrafter": false,
"clickUpApi": false,
"weeklyBam": false
}
Set to true one at a time as you validate each phase with real data.