π Generate & distribute market reports with Google Docs, Sheets, and Gmail
β‘ 94 views Β· π Market Research & Insights
Description
How It Works βοΈ
This workflow is a powerful automation engine for your marketing efforts. On a set schedule, it automatically generates a professional market report and distributes it to your client list, positioning you as a market expert with zero manual effort.
- 0. Cron (Monthly Schedule): β° The workflow is triggered automatically on the first day of every month at a specified time (e.g., 8:00 AM).
- 1. HTTP Request (Get Market Data): π It connects to an external market data API to fetch the latest raw statistics and trends for your region.
- 2. Function (Process Data): π This node processes the raw API data, formats it, and calculates key metrics (e.g., total sales, average price) to be used in the final report.
- 3. Google Docs (Create Report): π Using a pre-designed Google Docs template, the workflow dynamically creates a new report document, filling in the placeholders with the data processed in the previous step.
- 4. Google Sheets (Get Client List): π It fetches your client mailing list from a Google Sheet, which acts as your central database for client contacts.
- 5. Split In Batches: π This node ensures that each client from the mailing list is processed individually, preventing any issues with bulk emailing.
- 6. Gmail (Send Report): π§ For each client, a personalized email is sent with the newly generated market report attached as a PDF, completing the distribution process.
How to Set Up π οΈ
Setting up this complex workflow requires careful configuration of each node and external services.
-
Import Workflow JSON:
- Open your n8n instance.
- Click on βWorkflowsβ in the left sidebar.
- Click the β+β button or βNewβ to create a new workflow.
- Click the ββ¦β (More Options) icon in the top right.
- Select βImport from JSONβ and paste the entire JSON code for this workflow.
-
Prepare Your Data & Tools:
- Market Data API: Obtain an API key or access for a market data service that provides the data you need. This could be a public service or an internal one.
- Google Docs Template: Create a Google Docs template for your market report. Use placeholders like
{{ averagePrice }},{{ totalSales }}, and{{ reportMonth }}for the data you want to insert. - Client Mailing List: Create a Google Sheet with a list of your clients. It must have columns like
Client NameandClient Email. - n8n Credentials: Ensure you have configured OAuth2 credentials for both Google Sheets and Google Docs.
-
Configure 0. Cron (Monthly Schedule):
- The node is pre-configured to run on the 1st of every month at 8 AM. You can adjust the
hourordayOfMonthif needed.
- The node is pre-configured to run on the 1st of every month at 8 AM. You can adjust the
-
Configure 1. HTTP Request (Get Market Data):
- Locate the β1. HTTP Request (Get Market Data)β node.
- URL: Replace
https://api.your-market-data-service.com/data/monthly?region=Jakartawith the actual URL of your market data API endpoint. - Authentication: Configure the authentication (e.g.,
Header Authfor an API key) according to your API providerβs documentation.
-
Configure 2. Function (Process Data):
- Locate the β2. Function (Process Data)β node.
- Data Mapping: The code is an example. You MUST update the code inside this node to correctly parse the JSON data coming from your specific API call and extract the metrics you need.
- Expressions: Ensure the variable names (
totalSales,averagePrice, etc.) match the placeholders in your Google Docs template.
-
Configure 3. Google Docs (Create Report):
- Locate the β3. Google Docs (Create Report)β node.
- Credentials: Select your Google Docs OAuth2 credential.
- Document ID: Replace
YOUR_GOOGLE_DOCS_TEMPLATE_IDwith the ID of the template you created. - Template Variables: Ensure the
variablenames (averagePrice,totalSales, etc.) perfectly match the placeholders in your Google Docs template.
-
Configure 4. Google Sheets (Get Client List):
- Locate the β4. Google Sheets (Get Client List)β node.
- Credentials: Select your Google Sheets OAuth2 credential.
- Spreadsheet ID: Replace
YOUR_CLIENT_MAILING_LIST_SPREADSHEET_IDwith the ID of your client list sheet. - Sheet Name: Enter the exact name of the sheet (tab) containing your client data.
-
Configure 5. Split In Batches:
- This node requires no configuration. It will automatically process each client from the Google Sheets list one by one.
-
Configure 6. Gmail (Send Report):
- Locate the β6. Gmail (Send Report)β node.
- Credentials: Select your Gmail OAuth2 credential.
- From Email: Replace
your-agency-email@example.comwith the email address you want to send from. - To Email:
={{ $json['Client Email'] }}(This pulls the email from the current batch item). - Attachments: The node is set up to attach the file created by the Google Docs node. No changes are needed here unless you want to customize the file name.
-
Review and Activate:
- Thoroughly review all node configurations. This is a complex workflow, so be meticulous.
- Click βSaveβ and then toggle the βInactiveβ switch to βActiveβ to enable your workflow. π’ Your automated marketing engine is now live!
π Nodes Used
Cron, Function, Google Sheets, HTTP Request, Gmail, Google Docs
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File