2023-05-04 11:00:00 -07:00
import type { INodeProperties } from 'n8n-workflow' ;
const commonDescription : INodeProperties = {
displayName : 'Python' ,
name : 'pythonCode' ,
type : 'string' ,
typeOptions : {
editor : 'codeNodeEditor' ,
editorLanguage : 'python' ,
} ,
default : '' ,
description :
2023-12-04 00:19:36 -08:00
'Python code to execute.<br><br>Tip: You can use built-in methods and variables like <code>_today</code> for dates and <code>_jmespath</code> for querying JSON structures. <a href="https://docs.n8n.io/code/builtin/">Learn more</a>.' ,
2023-05-04 11:00:00 -07:00
noDataExpression : true ,
} ;
export const pythonCodeDescription : INodeProperties [ ] = [
{
. . . commonDescription ,
displayOptions : {
show : {
language : [ 'python' ] ,
mode : [ 'runOnceForAllItems' ] ,
} ,
} ,
} ,
{
. . . commonDescription ,
displayOptions : {
show : {
language : [ 'python' ] ,
mode : [ 'runOnceForEachItem' ] ,
} ,
} ,
} ,
{
displayName :
'Debug by using <code>print()</code> statements and viewing their output in the browser console.' ,
name : 'notice' ,
type : 'notice' ,
displayOptions : {
show : {
language : [ 'python' ] ,
} ,
} ,
default : '' ,
} ,
] ;