mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 09:34:07 -08:00
3a474552b2
Github issue / Community forum post (link here to close automatically): https://github.com/n8n-io/n8n/pull/6348 --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Marcus <marcus@n8n.io>
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
const commonDescription: INodeProperties = {
|
|
displayName: 'Python',
|
|
name: 'pythonCode',
|
|
type: 'string',
|
|
typeOptions: {
|
|
editor: 'codeNodeEditor',
|
|
editorLanguage: 'python',
|
|
rows: 5,
|
|
},
|
|
default: '',
|
|
description:
|
|
'Python code to execute.<br><br>Tip: You can use luxon vars like <code>_today</code> for dates and <code>$_mespath</code> for querying JSON structures. <a href="https://docs.n8n.io/nodes/n8n-nodes-base.function">Learn more</a>.',
|
|
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: '',
|
|
},
|
|
];
|