Check Japan Freelance Act compliance on orders with Gemini, Gmail and Sheets
Ready for 3.0What this workflow does
This AI workflow has 24 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, Google Gemini Chat Model, Google Sheets and Slack.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Normalize email order (Edit Fields (Set)): sets 5 fields: orderId, source, subject…
- Normalize form order (Edit Fields (Set)): sets 5 fields: orderId, source, subject…
- Set configuration (Edit Fields (Set)): sets 9 fields: sheetId, auditSheetName, errorSheetName…
- Clean and validate order text (Code): runs custom JavaScript code
- Has auditable text? (If): checks a condition and branches into true / false
- Remove duplicate orders in this run (Remove Duplicates): removes duplicate items
- Skip already audited orders (Remove Duplicates): removes duplicate items
- Extract order terms with Gemini (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini 2.5 Flash model; output parser: Parse order terms JSON
- Check Freelance Act compliance (Code): runs custom JavaScript code
- Format extraction error (Edit Fields (Set)): sets 4 fields: orderId, subject, error…
…plus 8 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Google Sheets + Slack templates (1,314) · Other Gmail + Slack templates (957)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Watch labelled order emails).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (14)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - n8n Form Trigger
n8n-nodes-base.formTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Remove Duplicates
n8n-nodes-base.removeDuplicates - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Slack
n8n-nodes-base.slack - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow ingests freelance order terms from Gmail or an n8n form, uses Google Gemini to extract required contract items, checks them against Japan’s Freelance Act rules, logs results to Google Sheets, and alerts issues via Slack while…