Skip to main content

n8n

Introduction

n8n (https://n8n.io/) is one of the favoured orchestation tools, and comes with a nice workflow designer. You can download/share the json represtation of the workflow, and here we describe how to visually recreate the graphical display of the workflow, as it would appear in n8n itself.

Indeed, it is a nice way to draw a workflow, using n8n, even if the workflow drawn is only to explain a concept rather than actually be used.

How to embed

To use

  • download the workflow json, from the n8n workflow designer (use the ... menu)
  • then add the json content to the markdown .md file, inside 'n8n-demo' tags
<n8n-demo workflow='

{
"name": "Workflow Scheduler Once Per Day 1am",
"nodes": [
{
...

"id": "BXOXucM1UzYvf4rw",
"tags": []
}

'></n8n-demo>


with the result that the n8n workflow

n8n workflow json
{
"name": "Workflow Scheduler Once Per Day 1am",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 1
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
-360,
-180
],
"id": "77f83699-d570-4075-8fa6-63f416cf27e4",
"name": "Schedule Trigger",
"notesInFlow": true,
"notes": "Set at once a day 1am currently"
},
{
"parameters": {
"content": "\n\nTo decide where to make decision on how often a downstream workflow runs get round it now by only having schedule run once a day",
"height": 240,
"width": 480
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-920,
-440
],
"typeVersion": 1,
"id": "2cbdc6d1-e8e2-4444-82c7-03440ac467d0",
"name": "Sticky Note"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "31f01b2c-b0f2-44ec-9c66-d5cdf5c3a3ac",
"leftValue": "={{ $json[\"Day of week\"] }}",
"rightValue": "Monday",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Monday"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "fe6d7d54-f534-4f90-8d71-6b2ba26e7407",
"leftValue": "={{ $json[\"Day of week\"] }}",
"rightValue": "Tuesday",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Tuesday"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "3cc81687-4b15-49d9-b70c-f2e599c96e6a",
"leftValue": "={{ $json[\"Day of week\"] }}",
"rightValue": "Wednesday",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Wednesday"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "405dd2bd-f3f1-4584-8a51-d52bd82f0d1c",
"leftValue": "={{ $json[\"Day of week\"] }}",
"rightValue": "Thursday",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Thursday"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "b3a0bb08-8984-44fd-9f9d-f60b6003fc90",
"leftValue": "={{ $json[\"Day of week\"] }}",
"rightValue": "Friday",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Friday"
}
]
},
"options": {
"allMatchingOutputs": true
}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-120,
-220
],
"id": "a04a8bfb-656d-42c0-bc16-42ccb86f6c82",
"name": "Switch",
"executeOnce": true
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "B4vd0DViuL6oUxfs",
"mode": "list",
"cachedResultName": "CDP — Extract DnB Zip Data SFTP"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"options": {}
},
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.2,
"position": [
400,
-140
],
"id": "0d15a074-de30-42a2-b61a-f84051193a14",
"name": "Execute DnB Workflow",
"notesInFlow": true,
"notes": "Only needs to execute once a week on a wednesday Morning"
}
],
"pinData": {},
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[],
[],
[
{
"node": "Execute DnB Workflow",
"type": "main",
"index": 0
}
],
[],
[]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1",
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "RgUOmY2LdJGytWb5"
},
"versionId": "6c1fdfbc-2a27-4b7a-96b9-951b55111b1e",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "187d94c86574671164544db42185bf2bad1afca0ca3595f1be647bf453252934"
},
"id": "BXOXucM1UzYvf4rw",
"tags": []
}

is embedded in the page:

warning

As always, check you content contains nothing sensitive... here especially, copying a real workflow without santising could risk sensitive details being published.