-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle-drive-parserdata.json
More file actions
202 lines (202 loc) · 5.16 KB
/
google-drive-parserdata.json
File metadata and controls
202 lines (202 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
{
"name": "Google Drive → Parserdata Extract → JSON",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"value": "YOUR_INPUT_FOLDER_ID",
"mode": "list",
"cachedResultName": "INPUT_FOLDER",
"cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_INPUT_FOLDER_ID"
},
"event": "fileCreated",
"options": {}
},
"name": "Google Drive Trigger (New file in folder)",
"type": "n8n-nodes-base.googleDriveTrigger",
"typeVersion": 1,
"position": [
-640,
-32
],
"id": "6d288148-adb5-4bb3-aee6-be7334d07dd3"
},
{
"parameters": {
"operation": "download",
"fileId": "={{$json[\"id\"]}}",
"options": {}
},
"name": "Google Drive (Download file)",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 2,
"position": [
-384,
-32
],
"id": "53d16e16-2392-4fa0-8261-3004949c15f3"
},
{
"parameters": {
"method": "POST",
"url": "https://api.parserdata.com/v1/extract",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "prompt",
"value": "Extract invoice number, invoice date, supplier name, total amount, and line items (description, quantity, unit price, net amount)."
},
{
"name": "options",
"value": "{\"return_schema\":false,\"return_selected_fields\":false}"
},
{
"parameterType": "formBinaryData",
"name": "file",
"inputDataFieldName": "data"
}
]
},
"options": {
"timeout": 300000
}
},
"name": "HTTP Request (Parserdata Extract)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
-128,
-32
],
"id": "f66c4499-d438-4bcb-82a6-f8647cd73e84"
},
{
"parameters": {
"jsCode": "const api = $json;\n\n// Nice output name\nconst inputName = (api.file_name || api.result?.fileName || 'document').toString();\nconst base = inputName.replace(/\\.[^.]+$/, '');\nconst outName = `${base}_extracted.json`;\n\n// Save ONLY the extracted payload (this matches the prompt output)\nreturn [{\n json: {\n outName,\n payload: api.result ?? api, // fallback just in case\n }\n}];"
},
"name": "Code (Build JSON file content)",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
144,
-32
],
"id": "c01d5434-1fdc-4115-b6aa-fbc9c6014c55"
},
{
"parameters": {
"mode": "jsonToBinary",
"options": {
"fileName": "={{$json.outName}}",
"keepSource": true,
"mimeType": "application/json"
}
},
"name": "Move Binary Data (JSON -> binary)",
"type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1,
"position": [
400,
-32
],
"id": "8cb8b36b-a4a3-4af8-9246-ca80f77a30d3"
},
{
"parameters": {
"binaryData": true,
"name": "={{$binary.data.fileName}}",
"parents": [
"=YOUR_OUTPUT_FOLDER_ID"
],
"options": {}
},
"name": "Google Drive (Upload extracted JSON)",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 2,
"position": [
672,
-32
],
"id": "7e1dc69b-6d67-4c8b-bce2-bbf95742f8cf"
}
],
"pinData": {},
"connections": {
"Google Drive Trigger (New file in folder)": {
"main": [
[
{
"node": "Google Drive (Download file)",
"type": "main",
"index": 0
}
]
]
},
"Google Drive (Download file)": {
"main": [
[
{
"node": "HTTP Request (Parserdata Extract)",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request (Parserdata Extract)": {
"main": [
[
{
"node": "Code (Build JSON file content)",
"type": "main",
"index": 0
}
]
]
},
"Code (Build JSON file content)": {
"main": [
[
{
"node": "Move Binary Data (JSON -> binary)",
"type": "main",
"index": 0
}
]
]
},
"Move Binary Data (JSON -> binary)": {
"main": [
[
{
"node": "Google Drive (Upload extracted JSON)",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"availableInMCP": false
},
"versionId": "47d49aae-f773-42a8-a45d-bf561f737e4e",
"meta": {},
"tags": []
}