Auto-Generate Procurement Category Strategies with n8n (OpenAI + Google Docs + Gmail)
Webhook trigger → fetch category & supplier data → OpenAI generates strategy → write to Google Docs → Gmail notifies category manager
- Who
- Procurement managers, supply chain analysts, n8n users who need automated category strategy documents
- You get
- When triggered by an external system via webhook, the workflow aggregates category spend and supplier/market data, generates a structured strategy JSON with AI, parses it into a Google Doc, and emails the category manager
- You need
- n8n · gmail · google-docs
Constraints
Prerequisites: n8n instance (cloud or self-hosted), OpenAI API key (gpt-4o-mini must be available), Google OAuth credentials (Google Docs + Gmail access), category/supplier data API endpoints. Costs: OpenAI per-token pricing; n8n cloud per-execution pricing. Known limitations: template uses dummyjson.com placeholder URLs that must be replaced; email recipient must be configured manually; no error-retry or data-validation nodes are included.
What they did
Author weblineindia published a workflow template in the n8n template library: it receives a category review request via webhook, fetches category spend and supplier/market data in sequence, calls OpenAI gpt-4o-mini to generate a structured strategy JSON, parses it into 11 fields, creates and updates a Google Docs document, and notifies the category manager via Gmail.
How it went
The source does not report actual runtime results or ROI for this template (author_report missing). The template shows as published on n8n with 14 views.
Worth knowing
The template uses dummyjson.com as placeholder data sources; production requires replacing them with real APIs. The email recipient is hardcoded as [email protected] and must be changed. No data validation, error retry, or resend logic is built in; consider adding these for production use. The Google Drive folderId is also an example and must be replaced with an actual folder ID.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Generate Category Strategy node: connect OpenAI API credentials.
Configuration to replace
- Source template is n8n public workflow #20377 (~17 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Configure trigger and credentials
After importing the template into n8n, set up three credentials: 1) OpenAI API credential, confirming gpt-4o-mini is available on your account; 2) Google Docs OAuth credential, and note the target Google Drive folder ID; 3) Gmail OAuth credential, and prepare the recipient email address. Then enable the Webhook node, copy the generated Webhook URL, and configure your upstream system to send a POST request to this URL to trigger a category review.
Replace data source endpoints
Replace the dummyjson.com placeholder URLs in both the 'Fetch Category Data' and 'Fetch Supplier + Market Data' HTTP Request nodes with your real category spend, supplier performance, and market data endpoints. If your APIs require authentication, add the required headers or credentials in the corresponding node's Authentication section.
Configure the AI strategy generation node
Open the 'Generate Category Strategy' OpenAI node and confirm the model is set to gpt-4o-mini. The node includes built-in system and user prompts that define the role and output format, and reference the JSON data from the previous two steps. If you need to adjust output fields, modify the prompts accordingly and同步 update the parsing expressions in the next step.
Execution prompt · Source text。OpenAI node system prompt field
You are an expert procurement category manager. Your task is to generate an actionable category strategy based only on the category spend data, supplier data, and market data provided. Do not invent data. Do not use Markdown. Do not use headings. Do not use ```json. Do not include any explanation outside the JSON. The strategy must identify: - Current category situation - Strategic objectives - Cost-saving opportunities - Supplier strategy - Negotiation levers - Risks - Recommended actions - Timeline - Expected savings The output must be practical and suitable for a Category Manager.
Execution prompt · Source text。OpenAI node user prompt field
=Create a category strategy for the following procurement category. CATEGORY DATA: {{ JSON.stringify($node["Fetch Category Data"].json) }} SUPPLIER AND MARKET DATA: {{ JSON.stringify($node["Fetch Supplier + Market Data"].json) }} Generate an actionable strategy. The strategy must contain: 1. Category 2. Executive Summary 3. Current Situation 4. Strategic Objectives 5. Opportunities 6. Supplier Strategy 7. Negotiation Levers 8. Risks 9. Action Plan 10. Timeline 11. Expected Savings Do not use Markdown. Do not use headings. Do not use ```json. Do not include any explanation outside the JSON. Do not add information that is not supported by the provided data.Configure structured output and document creation
The 'Structure Strategy Output' node uses JSON.parse to extract 11 fields from the AI response (category, executive_summary, etc.). Then 'Create Category Strategy Document' creates a new Google Doc named after the category, and 'Update Category Strategy Document' inserts the parsed fields into the document body. To adjust document formatting, modify the text parameter in the Update node.
Execution prompt · Source text。Update Category Strategy Document node text field
=CATEGORY STRATEGY Category: {{ $('Structure Strategy Output').item.json.category }} Executive Summary: {{ $('Structure Strategy Output').item.json.executive_summary }} Current Situation: {{ $('Structure Strategy Output').item.json.current_situation }} Strategic Objectives: {{ $('Structure Strategy Output').item.json.strategic_objectives }} Opportunities: {{ $('Structure Strategy Output').item.json.opportunities }} Supplier Strategy: {{ $('Structure Strategy Output').item.json.supplier_strategy }} Negotiation Levers: {{ $('Structure Strategy Output').item.json.negotiation_levers }} Risks: {{ $('Structure Strategy Output').item.json.risks }} Action Plan: {{ $('Structure Strategy Output').item.json.action_plan }} Timeline: {{ $('Structure Strategy Output').item.json.timeline }} Expected Savings: {{ $('Structure Strategy Output').item.json.expected_savings }}Configure email notification and test
In the 'Notify Category Manager' Gmail node, set the recipient email, subject, and message body. Both subject and body reference structured output fields. Save the workflow, then run a manual execution with sample data to verify that the Google Doc is created correctly and the email is delivered. Once confirmed, activate the workflow and configure your upstream system to trigger it according to business needs.
Execution prompt · Source text。Notify Category Manager node message field
=Hello, The AI-generated category strategy has been created successfully. Category: {{ $('Structure Strategy Output').item.json.category }} Expected Savings: {{ $('Structure Strategy Output').item.json.expected_savings }} Key Opportunities: {{ $('Structure Strategy Output').item.json.opportunities }} Key Risks: {{ $('Structure Strategy Output').item.json.risks }} The complete category strategy document has been created and is ready for review. Regards, Procurement Strategy SystemExecution prompt · Source text。Notify Category Manager node subject field
=AI Category Strategy Generated - {{ $('Structure Strategy Output').item.json.category }}
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are setting up an n8n workflow that auto-generates procurement category strategy documents from spend and supplier/market data. Please confirm in order: 1) Do you have an n8n instance and OpenAI/Google OAuth credentials? 2) Are your category data and supplier data API endpoints available? 3) Do you need to adjust AI output fields or document formatting? Once confirmed, I will provide the node configuration essentials and prompts.
Used to start a setup conversation, not a node runtime instruction
Source
Generate procurement category strategies with OpenAI, Google Docs, and Gmail · weblineindia · n8n.io · 2026-10-03
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.