code.json•2.06 kB
{
"nodeType": "n8n-nodes-base.code",
"displayName": "Code",
"description": "Run custom JavaScript or Python code",
"version": [
1,
2
],
"properties": [
{
"name": "notice",
"displayName": "Type <code>$</code> for a list of <a target=\"_blank\" href=\"https://docs.n8n.io/code-examples/methods-variables-reference/\">special vars/methods</a>. Debug by using <code>console.log()</code> statements and viewing their output in the browser console.",
"type": "notice",
"default": "",
"displayOptions": {
"show": {
"language": [
"javaScript"
]
}
}
},
{
"name": "mode",
"displayName": "Mode",
"type": "options",
"default": "runOnceForAllItems",
"description": "Run this code only once, no matter how many input items there are",
"options": [
{
"name": "Run Once for All Items",
"value": "runOnceForAllItems",
"description": "Run this code only once, no matter how many input items there are"
},
{
"name": "Run Once for Each Item",
"value": "runOnceForEachItem",
"description": "Run this code as many times as there are input items"
}
]
},
{
"name": "language",
"displayName": "Language",
"type": "options",
"default": "javaScript",
"options": [
{
"name": "JavaScript",
"value": "javaScript"
},
{
"name": "Python (Beta)",
"value": "python"
}
],
"displayOptions": {
"show": {
"@version": [
2
]
}
}
}
],
"credentialsConfig": [],
"io": {
"inputs": [
"Main"
],
"outputs": [
"Main"
],
"outputNames": [],
"hints": {}
},
"wiring": {
"role": "generic",
"requires": [],
"optional": [],
"consumedBy": [],
"consumes": [
"Main"
],
"produces": [
"Main"
]
}
}