-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLearn JSON Workflow.json
More file actions
572 lines (572 loc) · 16.1 KB
/
Learn JSON Workflow.json
File metadata and controls
572 lines (572 loc) · 16.1 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
{
"name": "Learn JSON",
"nodes": [
{
"parameters": {},
"id": "d9f8e6f3-8436-4abd-a2fb-df8aa203175d",
"name": "Execute to Start",
"type": "n8n-nodes-base.manualTrigger",
"position": [
220,
480
],
"typeVersion": 1
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "={\n \"my_field_1\": \"value\",\n \"my_field_2\": 1\n}\n",
"options": {}
},
"id": "a3b4291a-7ecb-438e-acae-1b415b17ddf9",
"name": "String",
"type": "n8n-nodes-base.set",
"position": [
840,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "key",
"type": "string",
"value": "value"
},
{
"id": "b5f030f4-6650-4181-881f-de44790bb24b",
"name": "another_key",
"type": "string",
"value": "another_value"
}
]
},
"options": {}
},
"id": "ab7da463-45a7-46cc-b6fd-2259d8d71b8b",
"name": "Key & Value",
"type": "n8n-nodes-base.set",
"position": [
560,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5c8e34fc-99c7-421d-b7d3-287e0410e409",
"name": "json_example_integer",
"value": null,
"type": "number"
},
{
"id": "9da6ca95-6dae-4405-8d3f-69626c20f0cb",
"name": "json_example_float",
"value": "12.5",
"type": "string"
}
]
},
"options": {}
},
"id": "1334d47e-b4b9-4584-83fe-6204d45425e3",
"name": "Number",
"type": "n8n-nodes-base.set",
"position": [
1120,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "json_example_boolean",
"type": "boolean",
"value": false
}
]
},
"options": {}
},
"id": "51dfc2b6-79e8-42ea-a149-dd7c53f87ddf",
"name": "Boolean",
"type": "n8n-nodes-base.set",
"position": [
1400,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "json_example_array",
"type": "array",
"value": "[\"first element\", 2, false, null]"
}
]
},
"options": {}
},
"id": "ec2d2c16-7623-4639-9b13-3ccb99021da3",
"name": "Array",
"type": "n8n-nodes-base.set",
"position": [
1960,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "json_example_object",
"type": "object",
"value": "{\"key\":\"value\",\"array\":[1,2,3],\"boolean\":false,\"integer\":123,\"sub_object\":{\"sub_key\":\"Find me!\"}}"
}
]
},
"options": {}
},
"id": "3924c986-24bd-442e-b987-9f6f3aaf06fb",
"name": "Object",
"type": "n8n-nodes-base.set",
"position": [
2240,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "## Tutorial - What is JSON?\n\nWelcome! This workflow will teach you the basics of JSON, the language that apps and n8n nodes use to exchange information.\n\n**What is JSON?**\nImagine a contact card:\n- **Name:** John Doe\n- **Age:** 30\n- **Has Children:** Yes\n- **Phone Numbers:** [\"555-1234\", \"555-5678\"]\n\n\nJSON is just a way of writing this down so a computer can understand it perfectly.\n\n**How to use this tutorial:**\n1. Click **\"Execute Workflow\"**.\n2. Click on each node, one by one, in order.\n3. Look at the node's output in the panel on the right and read the associated sticky note to understand what's happening.",
"height": 640,
"width": 460
},
"id": "8dbfb1ee-87a4-4798-bb4e-972f066b949b",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### The Heart of JSON: Key & Value\n\nEverything in JSON is built on this pair:\n- A **Key** (the name of the data, always in double quotes `\"`).\n- A **Value** (the data itself).\n\n\n`\"key\": \"value\"`\n\nIn this node's output, you see two key/value pairs. This is the basic building block for everything that follows.",
"height": 500,
"width": 260,
"color": 7
},
"id": "fdb0e989-b95a-4c0e-b15d-b7fe24141a2d",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
140
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### Data Type: String\n\nA string is simply **text**.\n- **Syntax:** The text is always enclosed in double quotes `\" \"`.\n\n\nLook at the output: the value of `json_example_string` is the text we defined.",
"height": 500,
"width": 260,
"color": 7
},
"id": "ba8c5a51-cc55-4ddb-8ba8-50f9df5b753d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
140
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### Data Type: Number\n\nThis is simply a number. It can be a whole number (integer) like 10, or a decimal (float) like 12.5.\n- **Syntax:** Just write the number directly, **WITHOUT quotes**.\n\n\n`\"age\": 30` (Correct)\n`\"age\": \"30\"` (Incorrect, this is a String!)\n\nThis distinction is crucial for doing math!",
"height": 500,
"width": 260,
"color": 7
},
"id": "627174b8-b40e-4ba0-9da8-a05fe1ff79fe",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1040,
140
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### Data Type: Boolean\n\nThis is a value that can only be **TRUE** or **FALSE**.\n- **Syntax:** `true` or `false` (always lowercase and **WITHOUT quotes**).\n\n\nThink of it like a light switch: on (`true`) or off (`false`). It's very useful for conditions (If/Then logic).",
"height": 500,
"width": 260,
"color": 7
},
"id": "7615528c-3b89-4187-8f0f-7d424818914e",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1320,
140
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### Data Type: Array\n\nAn array is an **ordered list** of items.\n- **Syntax:** Starts with `[` and ends with `]`. Items are separated by commas.\n\n\nAn array can hold anything: strings, numbers, booleans, and even other arrays or objects!",
"height": 500,
"width": 260,
"color": 7
},
"id": "d6fd5ae0-48a8-4c47-bc52-af908d9eb251",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1880,
140
],
"typeVersion": 1
},
{
"parameters": {
"content": "#### Data Type: Object (JSON Object)\n\nThis is the main concept! An object is a **collection of key/value pairs**.\n- **Syntax:** Starts with `{` and ends with `}`.\n\n\nThis is what allows us to structure complex data, like our contact card from the beginning. Notice how this object contains all the other data types we've seen!",
"height": 500,
"width": 280,
"color": 7
},
"id": "f4cec78d-e11a-4f33-8c13-487a8d4bff4b",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2160,
140
],
"typeVersion": 1
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "json_example_null",
"type": "null",
"value": null
}
]
},
"options": {}
},
"id": "af2c025a-2ac2-44e6-b031-5569ebee409b",
"name": "Null",
"type": "n8n-nodes-base.set",
"position": [
1680,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "#### Data Type: Null\n\nThis special type means \"nothing,\" \"no value,\" or \"empty.\"\n- **Syntax:** `null` (lowercase and **WITHOUT quotes**).\n\n\nIt's different from `0` (which is a number) or `\"\"` (which is an empty string). `null` is the intentional absence of a value.",
"height": 500,
"width": 260,
"color": 7
},
"id": "333ceba1-e8a6-42ca-b0d4-acc13c5100d5",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1600,
140
],
"typeVersion": 1
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "message",
"type": "string",
"value": "=Hello, the number from the tutorial is: {{ $('Number').item.json.json_example_integer }}"
},
{
"id": "61f385f4-b8e2-4c69-b873-9ffc3ab3fe94",
"name": "sub_key",
"type": "string",
"value": "={{ $json.json_example_object.sub_object.sub_key }}"
},
{
"id": "bd752a0f-64bf-44b1-b39b-fca28e86aa5b",
"name": "array_second_item",
"type": "string",
"value": "={{ $json.json_example_object.array[1] }}"
},
{
"id": "51edfc83-8150-4507-a3d2-2319ae0e70d7",
"name": "String_value",
"value": "=[\"{{ $('String').item.json.my_field_1 }}\" , \"{{ $('Key & Value').item.json.another_key }}\"]",
"type": "array"
},
{
"id": "ff4cb496-038c-4e39-83f2-936b672074b1",
"name": "name_of_user",
"value": "mayank",
"type": "string"
}
]
},
"options": {}
},
"id": "da98ff19-342b-4af6-bb5d-f6c665e8594d",
"name": "Using JSON (Expressions)",
"type": "n8n-nodes-base.set",
"position": [
2580,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "#### ⭐ THE KEY STEP: Using JSON in n8n!\n\nNow for the magic. How do you use data from a previous node? With **expressions** `{{ }}`.\n\nThis node creates a custom message. Look at the value of the `message` field:\n`Hello, the number from the tutorial is: {{ $('Number').item.json.json_example_integer }}`\n\nIt dynamically pulled the number `10` from the \"Number\" node! This is how you make your nodes talk to each other.",
"height": 500,
"width": 340,
"color": 5
},
"id": "8072721c-7c1f-4478-96e2-96e273fdd44b",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
2460,
140
],
"typeVersion": 1
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "e87952cb-878e-4feb-8261-342eaf887838",
"name": "summary_string",
"type": "string",
"value": "={{ $('String').item.json.my_field_1 }}"
},
{
"id": "12345",
"name": "summary_number",
"type": "number",
"value": "={{ $('Number').item.json.json_example_integer }}"
},
{
"id": "67890",
"name": "summary_boolean",
"type": "boolean",
"value": "={{ $('Boolean').item.json.json_example_boolean }}"
},
{
"id": "abcde",
"name": "summary_null",
"type": "null",
"value": "={{ $('Null').item.json.json_example_null }}"
},
{
"id": "fghij",
"name": "summary_array",
"type": "array",
"value": "={{ $('Array').item.json.json_example_array }}"
},
{
"id": "klmno",
"name": "summary_object",
"type": "object",
"value": "={{ $('Object').item.json.json_example_object }}"
}
]
},
"options": {}
},
"id": "5702ce7a-0dee-49e1-b6ad-bf3b0b11bab6",
"name": "Final Exam",
"type": "n8n-nodes-base.set",
"position": [
2940,
480
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "#### 🎓 FINAL EXAM: Putting It All Together\n\nThis last node creates a final object by using expressions to pull data from **all the previous nodes**.\n\nClick on this node and look at the expressions in each field. It's a perfect summary of everything you've learned.\n\n**Congratulations! You now understand the basics of JSON and how to use it in n8n.**",
"height": 500,
"width": 340,
"color": 6
},
"id": "21956847-3a4b-4e62-a430-5c42396d0e66",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
2820,
140
],
"typeVersion": 1
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
580,
820
],
"id": "8ddc9266-fec4-44f1-9083-afdf8f1d1ce3",
"name": "Edit Fields"
}
],
"pinData": {},
"connections": {
"Null": {
"main": [
[
{
"node": "Array",
"type": "main",
"index": 0
}
]
]
},
"Array": {
"main": [
[
{
"node": "Object",
"type": "main",
"index": 0
}
]
]
},
"Number": {
"main": [
[
{
"node": "Boolean",
"type": "main",
"index": 0
}
]
]
},
"Object": {
"main": [
[
{
"node": "Using JSON (Expressions)",
"type": "main",
"index": 0
}
]
]
},
"String": {
"main": [
[
{
"node": "Number",
"type": "main",
"index": 0
}
]
]
},
"Boolean": {
"main": [
[
{
"node": "Null",
"type": "main",
"index": 0
}
]
]
},
"Key & Value": {
"main": [
[
{
"node": "String",
"type": "main",
"index": 0
}
]
]
},
"Execute to Start": {
"main": [
[
{
"node": "Key & Value",
"type": "main",
"index": 0
}
]
]
},
"Using JSON (Expressions)": {
"main": [
[
{
"node": "Final Exam",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "7b024cdc-d6b3-4f6c-911a-d82e7afe6de5",
"meta": {
"instanceId": "470abe64dbe6aedf026d5e82b6678dbb6d54ed3d3fc1cd80d0b0b3449ccaf233"
},
"id": "IBx7Zr2berRV9fyo",
"tags": [
{
"createdAt": "2025-07-09T20:55:51.748Z",
"updatedAt": "2025-07-09T20:55:51.748Z",
"id": "NXBjAupXoVBrzcJ2",
"name": "learnn8n"
}
]
}