-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPDF Reader.json
More file actions
160 lines (160 loc) · 4.48 KB
/
Copy pathPDF Reader.json
File metadata and controls
160 lines (160 loc) · 4.48 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
{
"name": "PDF Reader",
"nodes": [
{
"parameters": {
"resource": "file",
"fileId": "={{ $json.message.document.file_id }}"
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [176, 0],
"name": "Get File"
},
{
"parameters": {
"updates": ["*"]
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.2,
"position": [0, 0],
"name": "Telegram Trigger"
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.text }}",
"options": {
"systemMessage": "Extract transaction data (UTR, amount, method, mode, account number) from bank statement text and return structured JSON. Ask user if any required field is missing."
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 2.2,
"position": [2336, 0],
"name": "AI Agent"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Telegram Trigger').item.json.message.from.id }}"
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [2256, 304],
"name": "Memory"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [2080, 288],
"name": "Chat Model"
},
{
"parameters": {
"conditions": {
"conditions": [
{
"leftValue": "={{ $json.text }}",
"operator": {
"type": "string",
"operation": "notEmpty"
}
}
]
}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [848, 0],
"name": "Check Text"
},
{
"parameters": {
"operation": "sendChatAction",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [2896, 0],
"name": "Typing Indicator"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{ $('AI Agent').item.json.output }}"
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [3104, 0],
"name": "Send Response"
},
{
"parameters": {
"jsonSchemaExample": "{\n \"transactionUTR\": \"string\",\n \"amount\": 0,\n \"payMethod\": \"string\",\n \"mode\": \"string\",\n \"agentRemark\": \"string\",\n \"accountNumber\": \"string\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.3,
"position": [2544, 304],
"name": "Structured Output Parser"
},
{
"parameters": {
"method": "POST",
"url": "https://your-api-endpoint.com/callback",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ $json.output }}"
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [2688, 0],
"name": "Send to API"
},
{
"parameters": {
"operation": "pdf"
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [384, 0],
"name": "Extract PDF Text"
}
],
"connections": {
"Telegram Trigger": {
"main": [[{ "node": "Get File", "type": "main", "index": 0 }]]
},
"Get File": {
"main": [[{ "node": "Extract PDF Text", "type": "main", "index": 0 }]]
},
"Extract PDF Text": {
"main": [[{ "node": "Check Text", "type": "main", "index": 0 }]]
},
"Check Text": {
"main": [[{ "node": "AI Agent", "type": "main", "index": 0 }]]
},
"AI Agent": {
"main": [[{ "node": "Send to API", "type": "main", "index": 0 }]]
},
"Send to API": {
"main": [[{ "node": "Typing Indicator", "type": "main", "index": 0 }]]
},
"Typing Indicator": {
"main": [[{ "node": "Send Response", "type": "main", "index": 0 }]]
},
"Memory": {
"ai_memory": [[{ "node": "AI Agent", "type": "ai_memory", "index": 0 }]]
},
"Chat Model": {
"ai_languageModel": [[{ "node": "AI Agent", "type": "ai_languageModel", "index": 0 }]]
},
"Structured Output Parser": {
"ai_outputParser": [[{ "node": "AI Agent", "type": "ai_outputParser", "index": 0 }]]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
}
}