mails2notion V2
Configured with Agent, Airtable, Filter, Gmail, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- AI & models
- Integration
- Transform
- Messaging
- Routing
- Data store
- Web / API
- Trigger
- Code
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Calculator | Integration | Tool Calculator | See node parameters |
| Structured Output Parser | Transform | Output Parser Structured | See node parameters |
| Add Label "Processed" | Messaging | Gmail | addLabels |
| Active Routes Only | Routing | Filter | See node parameters |
| Extract Route ID | Transform | Edit Fields | See node parameters |
| Deactivate Route | Data store | Airtable | update |
| Add Label "Error" | Messaging | Gmail | addLabels |
| Send notification about deactivated route | Messaging | Gmail | See node parameters |
| Send notification about missing route | Messaging | Gmail | See node parameters |
| Get Route by ID | Data store | Airtable | get |
| Create Notion Page | Web / API | HTTP Request | POST |
| Gmail Trigger | Trigger | Gmail Trigger | See node parameters |
| Filter for unprocessed mails | Routing | Filter | See node parameters |
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Required labels | Routing | Filter | See node parameters |
| Globals | Transform | Edit Fields | See node parameters |
| No Operation, do nothing | Routing | No Op | See node parameters |
| Format Notion Page Blocks | Code | Code | See node parameters |
| Get all labels | Messaging | Gmail | label |
| Structured Output Parser1 | Transform | Output Parser Structured | See node parameters |
| Calculator1 | Integration | Tool Calculator | See node parameters |
| OpenAI Chat Model1 | AI & models | OpenAI Chat Model | See node parameters |
| Generate Actionable Task | AI & models | Agent | See node parameters |
| Get Summary & Meta Data | AI & models | Agent | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
airtableTokenApigmailOAuth2openAiApi
Workflow notes
Setup
Setup
- Disable the Gmail Trigger and enable the manual trigger here
- Execute the workflow once
- Copy the Gmail Label IDs from the output of the "Required labels" node to the "Globals" node
- Disable the manual trigger here and and enable the Gmail Trigger again
- Activate the workflow, so it runs automatically in the background
Set Globals
Set Globals
Use the setup instructions below to retrieve the values for both errorLabelID and processedLabelID
Select Base
Select Base
Select the database and the table where the "Routes" are defined
Sticky Note3
The Gmail inbox is checked every minute for new entries
Sticky Note4
Extract the Airtable Row ID from the Email address
Sticky Note5
Filter by labels to prohibit double-processing
Sticky Note6
Dynamically build request body for Notion, since dynamic auth, and content with optional fields require a custom request
Sticky Note7
The custom built request including the user specific authentication is sent to Notion to create a new Page inside of a database
Sticky Note8
The Email is processed in multiple ways:
- An actionable task is being generated based on the content, consisting of a short title, a short description and optionally a few details as bullet points
- A detailed Email summary is being generated
- Meta data is being extracted - so the user has a reference to find the original Email again
- To get more stable results, the tasks are devided between two Agents
Sticky Note9
Skip disabled routes (determined by a checkbox attribute in Airtable)
Sticky Note10
Send custom Email notifications back to sender, containing an error message and suggestions to fix it
Sticky Note11
Add labels which prevent from double-processing
Sticky Note12
Disable a checkbox attribute in Airtable which determines if a route is active
mails2notion V2
mails2notion V2
Purpose and structure
This folder contains the mails2notion V2 workflow. Its executable nodes use agent, airtable, code, filter, gmail, gmailTrigger, httpRequest, lmChatOpenAi, manualTrigger, noOp, outputParserStructured, set, toolCalculator. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Gmail Trigger, When clicking ‘Test workflow’
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1921_Code_Filter_Automation_Webhook.json MIT; preserve source notices.