F&B Insights Stream
Trình đọc và Phân loại Tài liệu F&B từ GCS
Workflow starts instantly when a new file is created in Google Cloud Storage.
Proceeds only if the file name contains "articles/". Stops otherwise.
Fetches the raw content of the uploaded file.
Gemini AI analyzes the content to score its relevance to the F&B industry on a scale of 1-10.
You are an extremely strict and logical F&B news analyst...
Return ONLY a single valid JSON object:
{
"chain_of_thought": "...",
"relevance_score": 10,
"reason": "..."
}Extracts the structured data, including 'relevance_score', from the AI's response.
Router: Based on Relevance Score
The workflow splits based on the AI-generated score.
For highly relevant articles, Gemini AI extracts specific business data points.
You are an API specialized in data extraction...
Required JSON structure:
{
"meta": { "u": "...", "d": "..." },
"data": [ { "v": "...", "m": "...", "b": "..." } ]
}Error Handling
On failure, a message is sent to the #mktfnb channel and the error is ignored.
Parses the extracted meta and data array.
Loops through each data point in the 'data' array.
Compiles all data rows into a single SQL VALUES string, cleaning each value.
Inserts the aggregated data into the 'us_fnb_so_lieu_thi_truong' table.
INSERT INTO `us_fnb_so_lieu_thi_truong` (...) VALUES (...)Error Handling
Retries once with a 1-second delay on failure.
Summarizes less relevant articles to extract key information.
You are an expert F&B news analyst...
Required JSON structure:
{
"noi_dung_chinh": "...",
"thuong_hieu": "...",
"url_bai_viet": "...",
"ngay_bai_viet": "..."
}Parses the summarized content.
Parallel Actions
Saves the summary to the 'us_fnb_tom_tat_bai_viet' table.
Error Handling
On failure, sends a notification and ignores the error.
Shares the summary and link to the 'Mktfnb' Facebook page.
Shares a formatted post to LinkedIn.
Disabled
This step is currently disabled in the workflow.