Quick overview
This workflow generates an online reputation report for an attorney, law firm, or local business by querying SearchAPI.io, summarizing and scoring the results with an OpenAI GPT-4o agent, and emailing a formatted HTML report via Microsoft Outlook, either on demand through a webhook or daily from a SharePoint list.
How it works
- Triggers either via a POST webhook request for a single subject or on a daily schedule that pulls active, due clients from a Microsoft SharePoint list using Microsoft Graph.
- Normalizes incoming fields (name, firm, category, location, domains to check, competitors, recipients) and rejects webhook requests that are missing the requestor email or subject name.
- Builds a set of search queries (Google, Bing, Google News, Google Images, and optional site-specific queries) and fetches results from the SearchAPI.io SERP endpoint.
- Aggregates the search responses into a single analysis payload with visibility metrics, platform presence signals, and extracted review indicators.
- Sends the aggregated data to an OpenAI GPT-4o agent to generate a structured JSON reputation report, then validates and falls back to a minimal report if the JSON is invalid.
- Converts the report JSON into an HTML email and sends it to the requestor (with optional CC) through Microsoft Outlook.
- If the run originated from SharePoint, updates the list item with the latest report date and score and continues processing the next client in the batch.
Setup
- Add credentials for SearchAPI.io (HTTP query auth), OpenAI (for the GPT-4o chat model used by the agent), and Microsoft Outlook.
- If you use the daily batch mode, add a Microsoft Graph/SharePoint OAuth2 credential and replace the SharePoint site and list IDs in the Microsoft Graph URLs for fetching clients and updating report status.
- If you use the on-demand mode, copy the webhook URL for the
attorney-reputation-report path into the system that submits report requests and ensure it sends at least requestorEmail and subjectName (or attorneyName).
Requirements
- Self-hosted n8n instance (community and LangChain nodes required)
- Valid API credentials for SearchAPI, OpenAI, Microsoft Outlook, and your CRM or internal system
- Access to SharePoint or other listed resources
Customization
- Customize node parameters to refine search queries
- Tailor AI prompt instructions
- Adjust report formatting.
- Add or remove conditions and processing steps according to your business rules.
- Expand scheduled runs to target different client lists or reporting cadences.
Additional info
This template uses LangChain and community nodes, requiring a self-hosted n8n installation. For support, contact [email protected] (AI Solutions, Inc.).