Quick overview
This workflow runs weekly to test whether fairyfrills.in is cited in OpenAI answers to 15 shopping queries, logs citation details to Google Sheets, and emails a weekly HTML visibility report via Gmail, with optional Slack alerts on workflow errors.
How it works
- Runs once a week on a schedule and generates 15 predefined shopping queries along with the target domain, brand name, and competitor domains.
- Sends each query to two OpenAI models in parallel: gpt-4o-mini (no browsing) and gpt-4o-search-preview (web search with URLs).
- Splits the two AI answers into separate items per platform and uses OpenAI to extract citation data (target-domain URLs, competitor citations, citation position, and totals) as structured JSON.
- Parses the extracted citation JSON, formats key fields (including URL lists, counts, and a response preview), and appends one log row per query and platform to a Google Sheets “Citation Log” sheet.
- After the final query (ID 15) completes, fetches the logged results from Google Sheets, calculates weekly citation metrics and breakdowns, and generates an HTML report.
- Sends the weekly citation report email through Gmail to the configured recipient.
- If any node fails, posts an error alert to a configured Slack channel.
Setup
- Add an OpenAI API credential for the OpenAI nodes (gpt-4o-mini and gpt-4o-search-preview).
- Create a Google Sheet with a “Citation Log” tab, add the required columns to match the append-field mapping, and replace YOUR_GOOGLE_SHEET_ID in both Google Sheets nodes.
- Connect a Gmail OAuth2 credential and set the recipient email address for the weekly report.
- (Optional) Connect a Slack OAuth2 credential and replace YOUR_SLACK_CHANNEL_ID to receive workflow error alerts.
- Update the query list, domain/brand, and competitor domains in the query-builder code if you want to monitor a different site or market.