Quick overview
This workflow collects a newsletter brief via an n8n form, uses Tavily web search plus Anthropic Claude to plan and write cited sections, validates links against search results, and then assembles and delivers the finished newsletter as a Gmail draft or sends it directly.
How it works
- Receives a newsletter request from an n8n form with a topic, target audience, tone, and number of sections.
- Searches the web with Tavily for an initial scan of the topic and sends the results to Anthropic Claude to generate a JSON plan with section titles and search queries.
- Iterates through each planned section, runs a focused Tavily search, and has Anthropic Claude write the section using only the provided search results and explicit citations.
- Removes any links Claude included that are not present in Tavily’s returned URLs and sanitizes the section HTML to safe email-friendly tags.
- Combines all sections, deduplicates sources into a single numbered list, and generates a summary of section takeaways.
- Uses Anthropic Claude to write the email subject line, preheader, and intro, then assembles the full HTML newsletter.
- Creates a Gmail draft by default or sends the newsletter email immediately when delivery mode is set to "send".
Setup
- Add an Anthropic credential for the Claude steps used to plan sections, write sections, and generate the subject and intro.
- Create an HTTP Bearer Auth credential with your Tavily API key and select it for both Tavily HTTP requests.
- Connect a Gmail credential for creating drafts and sending emails.
- Update the Settings values (at minimum
send_to, and optionally delivery_mode, sender_name, words_per_section, search_depth, and search_window).
- Open the form trigger URL in n8n and share it only with trusted users, since anyone with the link can submit requests using your API quota.
Requirements
- Anthropic API key, Tavily API key (free tier works) and a Gmail account.
Customization
- Edit the form's tone options, or change section length, search depth and time window in Settings.