L&D Cohort Automation
google apps script • clasp cli • the bradbury group
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.
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).
Config.gsUtils.gsFileManager.gsSheetUpdater.gsHubUpdater.gsWalterApi.gsDocPopulator.gsGmailDrafter.gsClickUpApi.gsOrchestrator.gsTriggers.gsTestHarness.gsTestData.gsgraph 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:#f472b622,stroke:#f472b6,stroke-width:2px classDef p2 fill:#a78bfa22,stroke:#a78bfa,stroke-width:2px classDef p3 fill:#34d39922,stroke:#34d399,stroke-width:2px classDef p4 fill:#60a5fa22,stroke:#60a5fa,stroke-width:2px classDef p5 fill:#fbbf2422,stroke:#fbbf24,stroke-width:2px classDef p6 fill:#f8717122,stroke:#f87171,stroke-width:2px classDef start fill:#818cf822,stroke:#818cf8,stroke-width:2px classDef done fill:#34d39944,stroke:#34d399,stroke-width:3px 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
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:#60a5fa22,stroke:#60a5fa,stroke-width:2px classDef mod fill:#a78bfa22,stroke:#a78bfa,stroke-width:2px 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.
LD-C1W03Ayyyy-MM-ddAuto-generated
- File renaming & routing
- 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
Human reviews & releases
- Review Walter analysis accuracy
- Edit Facilitator Notes before sharing
- Review & send Gmail draft
- Confirm deliverables in sheet
- Check ClickUp tasks for completeness
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 PropertiesAll 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.