Workflow code
Copy this code to understand the workflow logic. Replace all API keys and credentials with your own before running.
// Triggered when Notion page status changes to "Ready to Repurpose"
// Node 1: Notion Trigger
// Node 2: Get full page content
// Node 3: Claude API — repurpose into 5 formats
const prompt = `
Take this blog post and create:
1. LinkedIn post (200 words, professional tone, end with question)
2. Twitter thread (6 tweets, each standalone)
3. Instagram caption (casual, 10 hashtags)
4. YouTube short script (60 seconds, hook + value + CTA)
5. WhatsApp message (30 words, shareable)
Blog post: ${$json.content}
Return as JSON with keys: linkedin, twitter_thread, instagram, youtube_script, whatsapp
`
// Node 4: Parse JSON response
// Node 5: Buffer — schedule LinkedIn (Tuesday 9am)
// Node 6: Buffer — schedule Twitter thread (Wednesday 12pm)
// Node 7: Buffer — schedule Instagram (Friday 6pm)
// Node 8: Save YouTube script back to Notion
// Node 9: Update Notion page status to "Repurposed"