Automation · Playbook 04

Archive curated articles into the right company folder.

Every article (or YouTube transcript) saved to the firm's article database lands as a file in the matching company's document folder — routed by an LLM against the live list of company folders, with no keyword maps to maintain.

Thematic Work

Reference build

Someone on the team saves an article — a piece of research, a competitor announcement, a YouTube interview with a founder. A row lands in the firm's article database. A few seconds later the article (or, for YouTube, the full transcript) is sitting as a file inside the right company folder in the document store, ready to be picked up by every downstream workflow that reads from those folders.

The article database in Module 5 of the Thematic Work playbook is the contract this automation runs against — it doesn't listen to Reader, Slack, or browser extensions directly. They all funnel into the database first, and this Zap fires off the database row.

Flow
01 · Trigger
New row in the article database
Notion 'Thematic Work Article Database' — captures whatever the team saved (article, video, newsletter)
02 · Hydrate
Re-read the row by Title
Search Notion for the full row so every property is available downstream (the trigger payload is sometimes thin)
03 · Branch on URL
Path A: YouTube · Path B: everything else
`URL icontains youtube` — the only thing that decides which path runs
Path A · YouTube
A.1
Apify transcript actor
run-sync with the YouTube URL, targetLanguage = en
A.2
Delay (small buffer)
Cover the gap between run-sync returning and the dataset being ready
A.3
Fetch dataset items
Pull the transcript chunks the actor produced
A.4
JS — flatten transcript
Code-by-Zapier turns the chunked output into a single text body
A.5
Append transcript to the Notion page
DB row becomes the canonical searchable copy
Path B · Article
B.1
JS — shape the article body
Title + URL + saved notes assembled into a single text blob
No transcript fetch needed — the body is whatever the team captured into the DB.
04 · AI folder picker
Claude picks the company folder by name
Prompt = article title + URL + the firm's list of known company folder names; output = the matching folder or 'none'
05 · Find folder in SharePoint
Look up the resolved folder name on the firm's SharePoint drive
If the search misses, the upload is skipped — the article still lives in the DB
06 · Upload file
SharePoint 'Upload a File' into the company folder
Filename = article title; body = the text blob from step A.4 or B.1
07 · Stop
DB row + SharePoint file now in sync
DB is the source of truth, SharePoint is the projection downstream workflows read from

Fields the workflow reads

FieldWhat it holds
TitleArticle title. Drives the filename in SharePoint and the prompt context for the folder picker.
URLSource URL. Used by the branch step (`icontains youtube`) and embedded into the file body.
Body / NotesWhatever the user captured at save time — clipped article text, summary, personal note. Becomes the file contents for non-YouTube items.
TranscriptPopulated only on the YouTube path. Apify pulls the captions, JS flattens them into a single text block, the result is appended to the Notion page AND used as the file body.
Company (derived)Not a DB field — derived at runtime by Claude from the title + URL + the firm's known company-folder list. This is the routing key.

Why this collapsed two automations into one

There used to be two Zaps here — one that filed an article into a specific company folder when there was a clear match, and a sibling that dumped articles into a general document store when there wasn't. They shared the same trigger, same body-shaping logic, and same SharePoint upload step.

They're now one workflow. The AI folder picker IS the routing. When it returns a known company, the file lands in that company's folder. When it returns 'none' (or the SharePoint search misses), the upload step is skipped and the article stays in the database — which is the right behaviour: the DB is the durable record, SharePoint is the projection.

Gotchas

  • 01The article database is the contract. This Zap doesn't accept arbitrary inputs — it only fires when a row lands in the firm's article DB. Anything that gets a row in (Reader save → DB, browser extension, Slack /save command, manual paste) flows through here for free. Anything that doesn't land in the DB is invisible to the workflow.
  • 02YouTube needs a transcript fetch; everything else doesn't. The branch on `URL icontains youtube` is the whole reason this Zap has two paths. The youtube path adds: transcript-actor run, a delay (because run-sync isn't reliably synchronous), a dataset fetch, and a JS step to flatten the transcript chunks into one body. Articles go straight to the AI folder picker.
  • 03Apify run-sync still needs a delay step after it. The actor can return before the dataset is materialized; the delay is a small price for not having to poll.
  • 04Transcript is also written back into the Notion page. So the database row becomes the canonical, searchable copy of the transcript — useful for memo generation later. SharePoint gets the same content as a file so it lives in the company folder alongside other artifacts.
  • 05The LLM picks the company folder by name match against a known list, not by free-form judgement. The Anthropic step is given the firm's roster of company folder names as context; its job is to pick the closest match or say 'none'. Keeping the prompt narrow is what makes this reliable — the model is a classifier, not an analyst.
  • 06Two LLM calls + two SharePoint lookups, one per branch. Both paths run the same 'pick folder → find folder → upload' tail. They're duplicated rather than merged because Zapier paths don't rejoin — keep them in sync when you change one.
  • 07Single SharePoint site / drive. Both branches write to the same site + drive; the only variable is the directory (the company folder). If you fan out to multiple sites, the folder picker needs to return a {site, drive, folder} tuple.
  • 08Filename collisions are handled by the upload action's conflict behavior. Default is replace/version — fine for re-saves of the same article, less fine if two different articles share a title. Title-suffix with the date or domain if collisions matter.
  • 09No company folder match = no file. If the LLM returns 'none' or the SharePoint search misses, the upload step is skipped and the article still lives in the DB. That's the right failure mode: the DB row is the source of truth, SharePoint is the projection.
  • 10This is why the 'specific company folder' and 'general document store' automations collapsed into one. Earlier versions had a separate Zap that uploaded to a generic SharePoint folder when no company matched. We folded that into this Zap — the AI folder picker IS the routing, and 'no match' is the general-store case in disguise.

Swap matrix