-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathai-agent-workflow.json
More file actions
139 lines (139 loc) · 4.91 KB
/
Copy pathai-agent-workflow.json
File metadata and controls
139 lines (139 loc) · 4.91 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
{
"workflow": {
"id": "ai-agent-automation",
"name": "AI Agent Workflow with Google and OpenRouter",
"nodes": [
{
"id": "trigger",
"name": "Manual Trigger",
"type": "executor-nodes-base.webhook",
"position": [0, 0],
"parameters": {}
},
{
"id": "data_processor",
"name": "Data Processor",
"type": "executor-nodes-base.code",
"position": [200, 0],
"parameters": {
"code": "const userQuery = $json.query || 'Analyze this data'; const contextData = { timestamp: new Date(), input: $json }; return { query: userQuery, context: contextData, processedBy: 'executor' };"
}
},
{
"id": "google_ai",
"name": "Google AI Analysis",
"type": "executor-nodes-base.googleAI",
"position": [400, -100],
"parameters": {
"model": "gemini-1.5-flash",
"systemPrompt": "You are an expert data analyst. Analyze the provided data and give insights.",
"prompt": "Analyze the context data and provide detailed insights",
"temperature": 0.7,
"maxTokens": 500,
"apiKey": "YOUR_GOOGLE_API_KEY"
}
},
{
"id": "openrouter_ai",
"name": "OpenRouter AI Processing",
"type": "executor-nodes-base.openRouter",
"position": [400, 100],
"parameters": {
"model": "anthropic/claude-3-haiku",
"systemPrompt": "You are a helpful assistant that processes data efficiently.",
"prompt": "Process and summarize the data provided",
"temperature": 0.5,
"maxTokens": 300,
"apiKey": "YOUR_OPENROUTER_API_KEY"
}
},
{
"id": "ai_agent_with_tools",
"name": "AI Agent with Tools",
"type": "executor-nodes-base.aiAgent",
"position": [600, 0],
"parameters": {
"provider": "openai",
"model": "gpt-3.5-turbo",
"systemPrompt": "You are an AI assistant with access to tools. Use them to help solve problems.",
"prompt": "Based on the previous AI analyses, make an HTTP request to get additional data if needed",
"useTools": true,
"temperature": 0.6,
"maxTokens": 800,
"apiKey": "YOUR_OPENAI_API_KEY"
}
},
{
"id": "final_processor",
"name": "Final Result Processor",
"type": "executor-nodes-base.code",
"position": [800, 0],
"parameters": {
"code": "const googleResult = $items.find(item => item.json.provider === 'google')?.json; const openrouterResult = $items.find(item => item.json.provider === 'openrouter')?.json; const aiAgentResult = $items.find(item => item.json.provider)?.json; return { finalAnalysis: { google: googleResult?.response, openrouter: openrouterResult?.response, aiAgent: aiAgentResult?.response, summary: 'Combined AI analysis completed', timestamp: new Date(), totalTokens: (googleResult?.usage?.total_tokens || 0) + (openrouterResult?.usage?.total_tokens || 0) + (aiAgentResult?.usage?.total_tokens || 0) } };"
}
},
{
"id": "webhook_response",
"name": "Send Response",
"type": "executor-nodes-base.httpRequest",
"position": [1000, 0],
"parameters": {
"url": "https://webhook.site/your-unique-url",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"status": "success",
"analysis": "{{ $json.finalAnalysis }}",
"executedBy": "automation-executor"
}
}
}
],
"connections": {
"Manual Trigger": {
"main": [[{ "node": "Data Processor", "type": "main", "index": 0 }]]
},
"Data Processor": {
"main": [
[
{ "node": "Google AI Analysis", "type": "main", "index": 0 },
{ "node": "OpenRouter AI Processing", "type": "main", "index": 0 }
]
]
},
"Google AI Analysis": {
"main": [[{ "node": "AI Agent with Tools", "type": "main", "index": 0 }]]
},
"OpenRouter AI Processing": {
"main": [[{ "node": "AI Agent with Tools", "type": "main", "index": 0 }]]
},
"AI Agent with Tools": {
"main": [[{ "node": "Final Result Processor", "type": "main", "index": 0 }]]
},
"Final Result Processor": {
"main": [[{ "node": "Send Response", "type": "main", "index": 0 }]]
}
}
},
"data": {
"query": "Analyze sales data for Q4 2024",
"salesData": {
"q4_revenue": 2500000,
"q4_growth": "15%",
"top_products": ["Product A", "Product B", "Product C"],
"regions": {
"north": 850000,
"south": 650000,
"east": 750000,
"west": 250000
}
},
"metadata": {
"source": "automation-executor",
"created": "2024-07-02",
"version": "1.0"
}
}
}