Automatically detects new Google Form submissions (via a linked Google Sheet), generates a blog post with AI, and pushes it to Substack as a draft.
Rendering mermaid diagram...
std/openai) to generate a full blog post (title + HTML body).POST /api/v1/drafts), authenticated with your substack.sid cookie.In the val's settings (left sidebar → Environment Variables), add these three:
The ID from your Google Sheet URL. For example, if the URL is:
https://docs.google.com/spreadsheets/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ/edit
then the ID is 1aBcDeFgHiJkLmNoPqRsTuVwXyZ.
⚠️ The sheet must be set to "Anyone with the link can view" (unlisted) for the pipeline to read it without Google API credentials.
Your substack.sid cookie, which authenticates API requests as you.
https://substack.comsubstack.sid and copy its Value⚠️ Treat this like a password — it gives full access to your Substack account. It stays valid for months as long as you don't log out.
Your Substack publication hostname, e.g. yourname.substack.com (no https://, just the hostname).
Run test-google-sheet.ts. You should see your column names and a preview of the first few rows. If it fails, double-check:
Run test-substack.ts. This will:
If it succeeds, check your Substack dashboard drafts — you should see a test draft. You can safely delete it.
Once both test scripts pass, the connections are working and we can build the main cron pipeline.
README.md — This filetest-google-sheet.ts — Script to test Google Sheet connectivitytest-substack.ts — Script to test Substack API connectivitymain.ts — (TODO) The main interval cron that ties it all together