-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path31-salesforce-sync.json
More file actions
232 lines (232 loc) · 6.53 KB
/
Copy path31-salesforce-sync.json
File metadata and controls
232 lines (232 loc) · 6.53 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
{
"name": "Sync Local Falcon rankings to Salesforce",
"nodes": [
{
"parameters": {
"content": "## Sync Local Falcon Rankings to Salesforce\n\n**Who is this for:** Agencies using Salesforce CRM who want ranking data automatically synced to Account or Opportunity records.\n\n**What this workflow does:**\n1. Fetches scan reports from Local Falcon daily\n2. Matches locations to Salesforce records via custom field\n3. Updates records with latest ranking data\n4. Creates activity records for significant changes\n\n**How to set up:**\n1. Add your Local Falcon API credentials (get your key at https://www.localfalcon.com/api/credentials)\n2. Add your Salesforce API credentials\n3. Create custom fields: Local_Falcon_Place_ID__c, Avg_Rank__c, Last_Scan_Date__c\n4. Populate place IDs on your Account records\n5. Activate the workflow\n\n**Requirements:**\n- Local Falcon account with API access\n- Salesforce account with API access\n- Custom fields configured in Salesforce\n\n**How to customize:**\n- Sync to Opportunities or custom objects\n- Trigger Salesforce flows based on rankings\n- Create cases for rank drops\n- Build Salesforce reports and dashboards",
"height": 520,
"width": 460,
"color": 5
},
"id": "sticky-main",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [100, -180]
},
{
"parameters": {
"content": "### Step 1: Schedule\nRuns daily to sync data.",
"height": 100,
"width": 200
},
"id": "sticky-step1",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [40, 660]
},
{
"parameters": {
"content": "### Step 2: Get Reports\nFetches ranking data.",
"height": 100,
"width": 200
},
"id": "sticky-step2",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [300, 660]
},
{
"parameters": {
"content": "### Step 3: Transform\nFormats for Salesforce fields.",
"height": 100,
"width": 200
},
"id": "sticky-step3",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [560, 660]
},
{
"parameters": {
"content": "### Step 4: Find Account\nSearches by place_id.",
"height": 100,
"width": 200
},
"id": "sticky-step4",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [820, 660]
},
{
"parameters": {
"content": "### Step 5: Update SF\nSyncs ranking data.",
"height": 100,
"width": 200
},
"id": "sticky-step5",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [1080, 660]
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "days",
"triggerAtHour": 6
}
]
}
},
"id": "schedule",
"name": "Every Day 6am",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [140, 440]
},
{
"parameters": {
"resource": "scan",
"operation": "listReports",
"additionalFields": {
"limit": 50
}
},
"id": "get-reports",
"name": "Get Scan Reports",
"type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
"typeVersion": 1,
"position": [400, 440],
"credentials": {
"localFalconApi": {
"id": "",
"name": "Local Falcon API"
}
}
},
{
"parameters": {
"jsCode": "const reports = $input.first().json.reports || [];\n\nreturn reports.map(report => ({\n json: {\n place_id: report.place_id,\n location_name: report.location_name,\n avg_rank: report.avg_rank,\n scan_date: report.scan_date,\n platform: report.platform,\n keyword: report.keyword\n }\n}));"
},
"id": "transform",
"name": "Transform Data",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [660, 440]
},
{
"parameters": {
"operation": "getAll",
"objectType": "Account",
"options": {
"conditionsUi": {
"conditionValues": [
{
"field": "Local_Falcon_Place_ID__c",
"value": "={{ $json.place_id }}"
}
]
}
}
},
"id": "find-account",
"name": "Find Salesforce Account",
"type": "n8n-nodes-base.salesforce",
"typeVersion": 1,
"position": [920, 440],
"credentials": {
"salesforceOAuth2Api": {
"id": "",
"name": "Salesforce OAuth2"
}
}
},
{
"parameters": {
"operation": "update",
"objectType": "Account",
"recordId": "={{ $json.Id }}",
"fieldsToUpdate": {
"field": [
{
"fieldId": "Avg_Rank__c",
"value": "={{ $('Transform Data').item.json.avg_rank }}"
},
{
"fieldId": "Last_Scan_Date__c",
"value": "={{ $('Transform Data').item.json.scan_date }}"
}
]
}
},
"id": "update-account",
"name": "Update Salesforce Account",
"type": "n8n-nodes-base.salesforce",
"typeVersion": 1,
"position": [1180, 440],
"credentials": {
"salesforceOAuth2Api": {
"id": "",
"name": "Salesforce OAuth2"
}
}
}
],
"connections": {
"Every Day 6am": {
"main": [
[
{
"node": "Get Scan Reports",
"type": "main",
"index": 0
}
]
]
},
"Get Scan Reports": {
"main": [
[
{
"node": "Transform Data",
"type": "main",
"index": 0
}
]
]
},
"Transform Data": {
"main": [
[
{
"node": "Find Salesforce Account",
"type": "main",
"index": 0
}
]
]
},
"Find Salesforce Account": {
"main": [
[
{
"node": "Update Salesforce Account",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true
}
}