Quick Overview
This workflow is triggered by a webhook, pulls category spend plus supplier and market data via HTTP requests, uses OpenAI to generate a procurement category strategy, writes it into a Google Docs document, and emails the Category Manager via Gmail.
How it works
- Receives a POST request on a webhook endpoint to start a category review.
- Fetches category spend and related procurement data from an external API using HTTP requests.
- Fetches supplier performance and market conditions from a second external API using HTTP requests.
- Sends the combined data to OpenAI (gpt-4o-mini) to generate a structured JSON category strategy.
- Parses the AI response into individual fields like opportunities, risks, action plan, timeline, and expected savings.
- Creates a new Google Docs file named after the category and inserts the generated strategy content.
- Sends an email via Gmail to the Category Manager with key highlights from the strategy.
Setup
- Add an OpenAI API credential and ensure the selected model (gpt-4o-mini) is available to your account.
- Add Google Docs OAuth credentials and set the destination Google Drive folder ID for where strategy documents are created.
- Add Gmail OAuth credentials and update the recipient email address and subject/message text as needed.
- Replace the two dummyjson.com HTTP request URLs with your real category, supplier, and market data endpoints (and add any required authentication headers).
- Copy the webhook URL and configure the source system to send a POST request to it when a category review is requested.